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

Another easy coefficient is $M$. Multiply both sides by $x$ and take the limit as $x\to +\infty$:
$$0=A+M\implies M=-A=-2/9$$
For $x=0$ we find
$$2=-A+N+Q\implies N+Q=A+2=20/9.$$
For $x=i$ we find
$$-3=\frac{A}{i-1} + \frac{Mi+N}{i} + \frac{Pi+Q}{-1}\implies Q=8/3, N+P=-1/9$$
Therefore $N=20/9-Q=-4/9$ and $P=-N-1/9=1/3$.
