I'm trying to solve this indefinite integral by means of partial fraction decomposition:
$\int\dfrac{x+1}{\left(x^2+4x+5\right)^2}\ dx$.
The denominator has complex (but not real) roots because $\Delta<0$; so, according with my calculus book, i try to decompose the integrand function in this form:
$\dfrac{x+1}{\left(x^2+4x+5\right)^2}= \dfrac{Ax+B}{\left(x^2+4x+5\right)}+\dfrac{Cx+D}{\left(x^2+4x+5\right)^2}$.
I get:
$\dfrac{x+1}{\left(x^2+4x+5\right)^2}= \dfrac{\left(Ax+B\right)\left(x^2+4x+5\right)+Cx+D}{\left(x^2+4x+5\right)^2}$.
Multiplying the right term:
$\dfrac{x+1}{\left(x^2+4x+5\right)^2}= \dfrac{Ax^3+4Ax^2+5Ax+Bx^2+4Bx+5B+Cx+D}{\left(x^2+4x+5\right)^2}$.
Now i collect the terms with the same pwer of $x$:
$\dfrac{x+1}{\left(x^2+4x+5\right)^2}= \dfrac{Ax^3+\left(4A+B\right)x^2+\left(5A+4B+C\right)x+D+ 5B}{\left(x^2+4x+5\right)^2}$.
Now i equate the two numerators:
$x+1=Ax^3+\left(4A+B\right)x^2+\left(5A+4B+C\right)x+D$
and equate term by term: i get:
$A=0$, $B=0$, $C=1$, $D=1$.
With these values i get a correct identity:
$\dfrac{x+1}{\left(x^2+4x+5\right)^2}= \dfrac{x+1}{\left(x^2+4x+5\right)^2}$
but this is unuseful in order to solve the integral.
Where is my mistake ?