Partial fraction expansion question I have to integrate following expression (but integration is not the problem):
$$\frac{x^2+3x-2}{(x-1)(x^2+x+1)^2}$$
It is pretty obvious that:
$$\frac{x^2+3x-2}{(x-1)(x^2+x+1)^2}=\frac{A}{x-1} + \frac{Mx+N}{x^2+x+1} + \frac{Px+Q}{(x^2+x+1)^2}$$
The first and the easiest step is to find an $A$:
$$A=\frac{x^2+3x-2}{(x^2+x+1)^2}, x=1$$
$$A=\frac{2}{9}$$
And then there comes a problem - I don't know how to do the rest. I tried to multiply the whole thing by $(x^2+x+1)^2$ and differentiate, but it didn't seem to be useful at all, especially because $(x^2+x+1)^2$ doesn't have real roots.
As popping900 suggested. I can take just four different x values and solve system of for equations, but i would like to see a more elegant or shorter solution, if one exists

Not saying this is the easiest nor the most elegant one, but here's how I usually solve this kind of problem:
$$
\begin{align}
\frac{x^{2}+3x+2}{\left(x-1\right)\left(x^{2}+x+1\right)^{2}}&=\frac{\left(x-1\right)\left(x+4\right)+2}{\left(x-1\right)\left(x^{2}+x+1\right)^{2}}\\
\\
&=\frac{x+4}{\left(x^{2}+x+1\right)^{2}}+\frac{2}{\left(x-1\right)\left(x^{2}+x+1\right)^{2}}\\
\\
&=\frac{x+4}{\left(x^{2}+x+1\right)^{2}}+\frac{\frac{2}{3}\left[\left(x^{2}+x+1\right)-\left(x-1\right)\left(x+2\right)\right]}{\left(x-1\right)\left(x^{2}+x+1\right)^{2}}\\
\\
&=\frac{\frac{1}{3}x+\frac{8}{3}}{\left(x^{2}+x+1\right)^{2}}+\frac{2}{3}\frac{1}{\left(x-1\right)\left(x^{2}+x+1\right)}\\
\\
&=\frac{\frac{1}{3}x+\frac{8}{3}}{\left(x^{2}+x+1\right)^{2}}+\frac{2}{3}\frac{\frac{1}{3}\left[\left(x^{2}+x+1\right)-\left(x-1\right)\left(x+2\right)\right]}{\left(x-1\right)\left(x^{2}+x+1\right)}\\
\\
&=\frac{\frac{1}{3}x+\frac{8}{3}}{\left(x^{2}+x+1\right)^{2}}+\frac{\frac{2}{9}}{x-1}+\frac{-\frac{2}{9}x-\frac{4}{9}}{x^{2}+x+1}
\end{align}
$$
