<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] $\overbrace{ x^4\!-\!x^3\!+\!2x^2\!-\!x\!+\!2}^{\large \bbox[5px,border:1px solid #0a0]{\!\!(\color{#c00}{x^2})^2-x(\color{#c00}{x^2})+2\color{#c00}{x^2}\!}\color{#0a0}{-x+2}\ \ }\!\!\! = a(x^2\!+\!2)^2\! + (bx\!+\!c)(x^2\!+\!2)(x\!-\!1) + (dx\!+\!e)(x\!-\!1)\,$ via clear denoms
$x=1 \,\Rightarrow\, 3=9a\,\Rightarrow\,\bbox[5px,border:1px solid #c00]{a=1/3}\ \ $ Compare lead coef's $\,\Rightarrow\, 1 = a\!+\!b=1/3+b\iff \bbox[5px,border:1px solid #c00]{b= 2/3}$
$\!\!\!\!\left.\begin{align}\bmod\ x^2\!+2\ \\ {\rm so}\,\ \color{#c00}{x^2\equiv -2}\  &\end{align}\!\!\right\}\! $
$\!\begin{align} \bbox[5px,border:1px solid #0a0]{4\!+\!2x\!-\!4\!}\!\color{#0a0}{-\!x\!+\!2}&\equiv (d\color{#c00}x+e)(\color{#c00}x-1)\\ \iff\ x\!+\!2 &\equiv (e\!-\!d)x\!-\!e\!\color{#c00}{-\!\!2}d\end{align} $
$\!\!\!\iff\!\!\!\!\! \begin{align} e-\,d &=1\\ -e\!-\!2d& =2\end{align}$
$\!\!\!\iff\!\!\!\!\!\begin{align}-3d&=3\\  3e&=0\end{align}$
$\!\!\iff\!\!\bbox[5px,border:1px solid #c00]{\!\!\!\begin{align}&d=-1\\ &e\ =\ 0\end{align}\!\!}$
$x=0 \,\Rightarrow\, 2 = 4a\!-\!2c\!-\!e =  4/3-2c\iff 2c=-2/3\iff \bbox[5px,border:1px solid #c00]{c=-1/3}$
Remark $ $ The modular calculation is the higher degree Heaviside cover-up method described here.
</s>