<s>[INST] Integration of $\int \frac{x^2}{(x-3)(x+2)^2}$ by partial fractions 
Integration of $\int \frac{x^2}{(x-3)(x+2)^2}$

I know that we can use substitution to make the expression simplier before solving it, but I am trying to solve this by using partial fractions only.
$\frac{x^2}{(x-3)(x+2)^2} = \frac{A}{x-3} + \frac{B}{x+2} + \frac{C}{(x+2)^2} = \frac{A(x+2)^2+B(x-3)(x+2) + C(x-3)}{(x-3)(x+2)} = \frac{Ax^2 + 4Ax + 4A + Bx^2 - Bx - 6B +Cx - 3C}{(x-3)(x+2)}$
Looking at the numerator: $x^2(A+B) + x(4A-B+C) + (4A-6B-3C)$
So, comparing coefficients:
$A+B=1$,
$4A-B+C=0$
$4A-6B-3C=0$
I am struggling to solve these 3 equations to find A,B,C
 [/INST] From
$$\frac{x^2}{(x-3)(x+2)^2} = \frac{A}{x-3} + \frac{B}{x+2} + \frac{C}{(x+2)^2}$$
we evaluate  the coefficients directly as follows
\begin{align}
&A=\left[\frac{x^2}{(x+2)^2} - \frac{B(x-3)}{x+2} + \frac{C(x-3)}{(x+2)^2} \right]_{x=3}=\frac9{25}\\
&B=\left[\frac{x^2}{(x-3)(x+2)} - \frac{A(x+2)}{x-3} -{\frac C{x+2}}\right]_{x\to\infty}=1-A=\frac{16}{25}\\
 &C=\left[\frac{x^2}{x-3} - \frac{A(x+2)^2}{x-3} -{B(x+2)}\right]_{x=-2}=-\frac4{5}
\end{align}
</s>