<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] After clearing the denominators we have $$x^4-x^3+2x^2-x+2 = A(x^2+2)^2 + (Bx+C)(x-1)(x^2+2) + (Dx+E)(x-1)(*)$$
as you obtained.
Indeed, $A=\frac{1}{3}$ if we let $x=1$.
Differentiate $(*)$ to get that $$4x^3-3x^2+4x-1=\frac{4}{3}x(x^2+2)+B(4x^3-3x^2+4x-2)+C(3x^2-2x+2)+D(2x-1)+E(**)$$
Differentiate the above relation again to get that $$12x^2-6x+4=\frac{4}{3}(3x^2+2)+B(12x^2-6x+4)+C(6x-2)+2D(***)$$
Differentiate again to get that $$24x-6=8x+B(24x-6)+6C(****)$$
Now let $x=\frac{1}{4}$. It follows that $-2=6C$, so $C=-\frac{1}{3}$.
For $x=0$ in $(****)$ we have $-6=-6B-2$, so $B=\frac{2}{3}$.
For $x=0$ in $(***)$ we obtain that $4=6+2D$, so $D=-1$.
Finally, for $x=0$ in $(**)$ we have $-1=1+E$, so $E=0$.   
</s>