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. 
 A: You don't have all the components in the decomposition. It should be 
$$\frac {x}{(x-1)^2(x+2)} = \frac {Ax+C}{(x-1)^2} + \frac {B}{x+2}
=\frac {\frac29x+\frac19}{(x-1)^2} - \frac {\frac29}{x+2}$$
A: Instead of $\frac{Ax}{(x-1)^2}$ you should have
$$\frac A{(x-1)^2}+\frac C{x-1}$$
I get $A=\frac13,B=\frac19,C=-\frac19$.
A: When the denominator of a fraction has an irreducible factor $\bigl(p(x)\bigr)^m$ with order of multiplicity $m>1$, its contribution to the decomposition into partial fractions is not
$$\frac{A(x)}{\bigl(p(x)\bigr)^m} \qquad (\deg A(x)<\deg p(x)),$$
but
$$\frac{A_1(x)}{p(x)\vphantom{\Big)}}+\frac{A_2(x)}{\bigl(p(x)\bigr)^2}+\dots+\frac{A_m(x)}{\bigl(p(x)\bigr)^m}\\(\deg A_1(x),\deg A_2(x),\dots,\deg A_m(x)<\deg p(x)) $$
Therefore here, as the irreducible factors have degree $1$, the decomposition has the form
$$\frac{x}{x^3-3x+2} = \frac {x}{(x-1)^2(x+2)}=\frac{A}{x-1}+\frac{B}{(x-1)^2}+\frac{C}{x+2}.$$
Addendum: 
Here is the short way to determine the coefficients: multiply both sides of the above equality by $(x-1)^2(x+2)$ to obtain the relation
$$x=(x-1)(x+2)A+(x+2)B+(x-1)^2C.$$
Setting $x=1$, then $x=-2$, yields instantly
$B=\frac 13$ and $C=-\frac29$. To obtain $C$, observe that the r.h.s. must have no quadratic term, so $A+C=0$ and finally $A=\frac29$.
A: $$ 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$$
