Solve the following integral: $ \int \frac{x^2}{x^2+x-2} dx $ Solve the integral: $ \int \frac{x^2}{x^2+x-2} dx $
I was hoping that writing it in the form $ \int 1 - \frac{x-2}{x^2+x-2} dx $ would help but I'm still not getting anywhere.
In the example it was re-written as $ \int 1 - \frac{4}{3x+6} - \frac{1}{3x-3} dx $
but I am not sure how this was accomplished. Any ideas? I am more interested in the method than the answer.

when you get the $\int 1 - \frac{x-2}{x^2+x-2} dx$, you can use  $x^2+x-2 = (x-1)(x+2)$.
then it become
$$
\int 1 - \frac{x+2-4}{(x+2)(x-1)}dx
$$
which equal to 
$$
\int 1 - \frac{1}{x-1}-\frac{4}{(x+2)(x-1)}dx
$$
$$
\int 1 - \frac{1}{x-1}-4/3(\frac{1}{(x-1)}+\frac{1}{(x+2)})dx
$$
