Where did you get [imath] x+1 [/imath] in the denominator from? You correctly split the quotient
[math] \dfrac{1}{x(x^2+1)} =\dfrac{1}{x}-\dfrac{x}{x^2+1}[/math]This can be solved by logarithms, the first one is directly a logarithm, and the second one needs a substitution [imath] u=x^2+1. [/imath]
Did you switch to your original problem at this stage without mention?
The original problem has a nasty anti-derivative with logs and arcus tangent.
[math] \int \dfrac{x-2}{x^2-x+1}\, dx = \dfrac{1}{2} (\log(x^2 - x + 1) - 2 \sqrt{3} \tan^{-1}((2 x - 1)\sqrt{3})) + constant [/math]
You could probably do it by looking up the anti-derivatives of [imath] \dfrac{1}{x^2-x+1} [/imath] and [imath] \dfrac{x}{x^2-x+1} [/imath] eventually after another substitution. However, it is a definite integral. It is easier to solve by the residue method than by partial fraction decomposition. Did you read the article I linked? It contains an example of how it is done, although it only mentions that [imath] \int (x^3+1)^{-1} dx [/imath] can be solved accordingly.
Allow me a remark: stop using [imath] \infty [/imath] as if it were a number, it is not! [imath] \int_0^\infty \dfrac{1}{x+1}\,dx [/imath] does not converge! This is another problem with the partial fraction decomposition: it leaves you with two divergent integrals! Since [imath] \int_0^\infty (x^3+1)^{-1} dx [/imath] is finite, the two "divergencies" cancel each other what cannot be seen by the partial fractions.
[math] \dfrac{1}{x(x^2+1)} =\dfrac{1}{x}-\dfrac{x}{x^2+1}[/math]This can be solved by logarithms, the first one is directly a logarithm, and the second one needs a substitution [imath] u=x^2+1. [/imath]
Did you switch to your original problem at this stage without mention?
The original problem has a nasty anti-derivative with logs and arcus tangent.
[math] \int \dfrac{x-2}{x^2-x+1}\, dx = \dfrac{1}{2} (\log(x^2 - x + 1) - 2 \sqrt{3} \tan^{-1}((2 x - 1)\sqrt{3})) + constant [/math]
You could probably do it by looking up the anti-derivatives of [imath] \dfrac{1}{x^2-x+1} [/imath] and [imath] \dfrac{x}{x^2-x+1} [/imath] eventually after another substitution. However, it is a definite integral. It is easier to solve by the residue method than by partial fraction decomposition. Did you read the article I linked? It contains an example of how it is done, although it only mentions that [imath] \int (x^3+1)^{-1} dx [/imath] can be solved accordingly.
Allow me a remark: stop using [imath] \infty [/imath] as if it were a number, it is not! [imath] \int_0^\infty \dfrac{1}{x+1}\,dx [/imath] does not converge! This is another problem with the partial fraction decomposition: it leaves you with two divergent integrals! Since [imath] \int_0^\infty (x^3+1)^{-1} dx [/imath] is finite, the two "divergencies" cancel each other what cannot be seen by the partial fractions.