<s>[INST] Finding constants in partial fraction In an example for partial fractions we want to find $A$, $B$, $C$, $D$ and $E$ in the expression:
$$
\frac{x^4-x^3+2x^2-x+2}{(x-1)(x^2+2)^2} = \frac{A}{(x-1)} + \frac{Bx+C}{(x^2+2)} + \frac{Dx+E}{(x^2+2)^2}
$$
Multiplying through to clear the fractions I obtained:
$$x^4-x^3+2x^2-x+2 = A(x^2+2)^2 + (Bx+C)(x-1)(x^2+2) + (Dx+E)(x-1)$$
I found $A=\frac{1}{3}$ by letting $x=1$. 
Now in the book they let me know that $B=\frac{2}{3}$, $C=-\frac{1}{3}$, $D=-1$ and $E=0$. But I would really like to figure out how I can find the values for $B, C, D, E$.
 [/INST] Since\begin{multline}A(x^2+2)^2+(Bx+C)(x-1)(x^2+2)+(Dx+E)(x-1)=\\=Ax^4+Bx^4-Bx^3+Cx^3+4Ax^2+2Bx^2-Cx^2+Dx^2+\\-2Bx+2Cx-Dx+Ex+4A-2C-E,\end{multline}solve the system$$\left\{\begin{array}{l}A+B=1\\-B+C=-1\\4A+2B-C+D=2\\-2B+2C-D+E=-1\\4A-2C-E=2.\end{array}\right.$$
</s>