Express as partial fractions

(1)    \( \frac{-3x^2+x-1}{(x+2)^2(x-3)} \)

\begin{align} \frac{-3x^2+x-1}{(x+2)^2(x-3)} & = \frac{A}{x+2} + \frac{B}{(x+2)^2} + \frac{C}{x-3} \\ \\ \frac{-3x^2+x-1}{(x+2)^2(x-3)} & = \frac{A(x+2)(x-3)}{(x+2)(x+2)(x-3)} + \frac{B(x-3)}{(x+2)^2(x-3)} + \frac{C(x+2)^2}{(x-3)(x+2)^2} \\ \\ -3x^2+x-1 & = A(x+2)(x-3) + B(x-3) + C(x+2)^2 \\ \\ let\ x = -2\,, \quad then \quad -3(-2)^2 -2 -1 & = A(-2+2)(-2-3)+B(-2-3)+C(-2+2)^2 \\ -15 & = -5B \\ \implies B & =3 \\ \\ let\ x =3\,, \quad then \quad -3(3)^2+3-1 & =A(3+2)+B(3-3) + C(3+2)^2 \\ -25& = 25C \\ \implies C & = -1 \\ \\ Equating\ constants\,, \quad -1 & = -6A -9-4 \\ 12 & = -6A \\ \implies\ A & = -2 \\ \\ \therefore \quad \frac{-3x^2+x-1}{(x+2)^2(x-3)} & = \frac{-2}{x+2} + \frac{3}{(x+2)^2} + \frac{-1}{x-3} \end{align}



(2)      \(\frac{3x^2-3x-4}{x^2(x+1)} \)

\begin{align} \frac{3x^2-3x-4}{x^2(x+1)} & = \frac{A}{x} + \frac{B}{x^2} + \frac{C}{x+1} \\ \\ \frac{3x^2-3x-4}{x^2(x+1)} & = \frac{A(x)(x+1)}{(x)(x)(x+1)} + \frac{B(x^2)(x+1)}{x^2(x+1)} + \frac{C(x)^2}{x^2(x+1)} \\ \\ 3x^2-3x-4 & = A(x)(x+1) + B(x+1) + C(x)^2 \\ \\ let\ x = 0\,, \quad then \quad -4 & = A(0)(0+1)+B+(0)^2 \\ \implies\ -4 & = B \\ \\ let\ x =-1\,, \quad then \quad 3+3-4 & = A(-1)(-1+1)+B(-1+1)+C(-1)^2 \\ 3+3-4 & = C \\ \implies C & = 2 \\ \\ Equating\ x^2\ coefficients\,, \quad 3x^2 & =Ax^2 + Cx^2 \\ 3 & = A+2 \\ \implies\ A & = 1 \\ \\ \therefore \quad \frac{3x^2-3x-4}{x^2(x+1)} & = \frac{1}{x} - \frac{4}{x^2} + \frac{2}{x+1} \\ \end{align}