Where is the mistake in calculations for $\int \frac {2x+1}{(x-3)^2(x+1)}$ In here, theoretically you confirm me that I can use this partial fraction decomposition of fraction and I wanted to apply for that integral.
First way:
$\frac {2x+1}{(x-3)^2(x+1))}=\frac{A}{x+1} + \frac{B}{(x-3)} + \frac{C}{(x-3)^2} $
and at the final I found coefficients as $A=-1/16,B=1/16 , C= 7/4$
(Which is correct as I checked in calculator.)
Second Way: $\frac {2x+1}{(x-3)^2(x+1))}=\frac {A}{x+1} + \frac {Bx+C}{(x-3)^2}$ (because I thought since I divide something by degree $2$ which is $(x-3)^2$ so remainder at most can be degree $1$) and at the final I couldn't find same coefficients as above. Again $A$ is $-1/16$ and $B=1/16$ but I have two results for $C$ so that leads to contradiction.
I got $A,B,C$ from: $A(x-3)^2 + (Bx+C)(x+1)=Ax^2-6Ax+9A+Bx^2+Bx+Cx+C=2x+1$
Where is the mistake? What am I missing?