<s>[INST] integration of. $\int \frac{x}{x^3-3x+2}$ I am trying to integrate    :

$\Large \int \frac{x}{x^3-3x+2}dx$

I decomposed the fraction and got :
$\Large \frac{x}{x^3-3x+2} = \frac {x}{(x-1)^2(x+2)}$
Then I tried to get two different fractions:
$ \Large \frac {x}{(x-1)^2(x+2)} = \frac {Ax}{(x-1)^2} + \frac {B}{(x+2)}$
Well I got A=1/3 and B=-1/3. as possible values. but that was not correct. I guess I missed something. 
 [/INST] $$ I=\int \frac{x}{x^3-3x+2}dx$$
$$I= \int \frac {xdx}{(x-1)^2(x+2)}$$
Since $\frac {-1}{(x-1)^2}$ is an obvious derivative substitute $$u=\dfrac {1}{x-1} \implies -du=\dfrac {dx}{(x-1)^2}$$
The integral becomes:
$$I=-\int \dfrac {u+1}{3u+1}du$$
Which is easier to integrate. 
$$u+1=u+\frac 1 3 +\frac 2 3$$
</s>