# How do you integrate (x^3+x^2+2x+1)/((x^2+1)(x^2+2)) dx?

Oct 30, 2016

$\frac{{x}^{3} + {x}^{2} + 2 x + 1}{\left({x}^{2} + 1\right) \left({x}^{2} + 2\right)} = \frac{{x}^{3} + 2 x}{\left({x}^{2} + 1\right) \left({x}^{2} + 2\right)} + \frac{{x}^{2} + 1}{\left({x}^{2} + 1\right) \left({x}^{2} + 2\right)}$

#### Explanation:

$= \frac{x}{{x}^{2} + 1} + \frac{1}{{x}^{2} + 2}$

There terms may be integrated by substitution.

For the first, use $u = {x}^{2} + 1$ to get $\frac{1}{2} \ln \left({x}^{2} + 1\right)$.

For the second use $x = \sqrt{2} u$ to get $\frac{1}{\sqrt{2}} {\tan}^{-} 1 \left(\frac{x}{\sqrt{2}}\right)$

We can write the integral as

$\frac{1}{2} \ln \left({x}^{2} + 1\right) + \frac{\sqrt{2}}{2} {\tan}^{-} 1 \left(\frac{x}{\sqrt{2}}\right)$