Partial Fractions Integral

I have a feeling that I made my mistake in this question near the end, but I'll write it all out anyway:

$\displaystyle \int \frac{4x+3}{(x^2+1)(x^2+2)}dx $

$\displaystyle \frac{4x+3}{(x^2+1)(x^2+2)} = \frac{Ax+B}{x^2+1} + \frac{Cx+D}{x^2+2} $

$\displaystyle (Ax + B)(x^2 + 2) + (Cx+D)(x^2 +1) = 4x + 3 $

$\displaystyle 4x + 3 = Ax^3 + Cx^3 + Bx^2 + Dx^2 + 2Ax + Cx + 2B + D $

equated co-efficients to get :

$\displaystyle 4\int\frac{x}{x^2 + 1}dx + 3\int\frac{1}{x^2 + 2}dx - 4\int\frac{x}{x^2 + 2}dx - 3\int\frac{1}{x^2 + 2}dx $

I can do the second and fourth integrals fine, so I'll just show work for the first and third.

First $\displaystyle 4\int\frac{x}{x^2 + 1}dx $ let $\displaystyle x = tan(u) $

therefore $\displaystyle dx = sec^(u)du $

now I sub them in: $\displaystyle 4\int\frac{tan(u)}{sec^2(u)}sec^2(u)du $

$\displaystyle 4\int\ tan(u)du = -4log[cos(u)] + E $

from the substitution I derived: $\displaystyle cos(u) = \frac{1}{\sqrt{1 + x^2}} $

therefore $\displaystyle = 3log(1 + x^2) + E $

I'll stop here, because I think that by here I've made a mistake (this part of my answer does not match the correct answer). If anyone can spot it, it would be great.

Thanks,

Forgive typos, this one was quite tedious for me to write out.