Integration by partial fractions I've attempted to integrate the function $$\frac{2x^3 + 5x^2 + 8x + 4}{(x^2 + 2x + 2)^2}$$ using several techniques, but none of them are solving it nicely.
I've tried to slve it by partial fractions:
$$\frac{A + Bx}{x^2 + 2x + 2} + \frac{C + Dx}{(x^2 + 2x + 2)^2},$$ but i get wrong coefficients.

You can also get the partial fraction form by separating the numerator into multiples of $x^2+2x+2$:
$$2x^3+5x^2+8x+4 = 2x(x^2+2x+2)+x^2+4x+4$$
$$=2x(x^2+2x+2)+(x^2+2x+2) + 2x+2$$
$$=(2x+1)(x^2+2x+2) + 2x+2$$
Once you cancel the $x^2+2x+2$ from the first part you are left with the partial fraction form, and from then on integrate as above.
