<s>[INST] Partial Fraction Expansion of $12\frac{x^3+4}{(x^2-1)(x^2+3x+2)}$ Find the vector $(A,B,C,D)$ if $A$, $B$, $C$, and $D$ are the coefficients of the partial fractions expansion of
$$12\frac{x^3+4}{(x^2-1)(x^2+3x+2)} = \frac{A}{x-1} + \frac{B}{x+2} + \frac{C}{x+1} + \frac{D}{(x+1)^2}.$$

After plugging in a few values for $x,$ I got these equations:
$$6A+D=12$$
$$4A+B+2C+D=0$$
$$5A+D=B+C$$
$$2A+B=2C+2D+48$$
But now I'm stuck.  Thanks in advance for answering!
 [/INST] You should not begin with solving systems of linear equations. Rewrite the partial fractions decomposition so as to remove all denominators. Multiplying both sides with $(x-1)(x+2)(x+1)^2$, you get
$$12(x^3+4)=A(x+2)(x+1)^2+B(x-1)(x+1)^2 +C(x-1)(x+2)(x+1)+D(x-1)(x+2).$$ 
Now set 


*

*$x=1$: it  yields at once $12\cdot 5= 12A$, whence $A=5$;

*$x=-2\;$ yields $\;12^2=-3B$, whence $B=-48$;

*$x=-1\;$ yields $\;12\cdot 5=-2D$, whence $D=-30$.


There remains to calculte $C$. The simplest is to set $x=0$, and you get $48=2A-B-2C-2D$, i.e. $C=35$.
</s>