# How do you integrate int (3x^2+x+4)/((x^2+2)(x^2+1)) using partial fractions?

Oct 25, 2016

The integral $= - \ln \frac{{x}^{2} + 2}{2} + \ln \frac{{x}^{2} + 1}{2} + \arctan x + \sqrt{2} \arctan \left(\frac{x}{\sqrt{2}}\right) + C$

#### Explanation:

The decomposition in partial fractions is
$\frac{3 {x}^{2} + x + 4}{\left({x}^{2} + 2\right) \left({x}^{2} + 1\right)} = \frac{A x + B}{{x}^{2} + 2} + \frac{C x + D}{{x}^{2} + 1}$

$3 {x}^{2} + x + 4 = \left(A x + B\right) \left({x}^{2} + 1\right) + \left(C x + D\right) \left({x}^{2} + 2\right)$
Let $x = 0$ then 4= B+2D
Coefficients of ${x}^{2}$, $3 = B + D$
From thes equations. we get $D = 1$ and $B = 2$
So,
$3 {x}^{2} + x + 4 = \left(A x + 2\right) \left({x}^{2} + 1\right) + \left(C x + 1\right) \left({x}^{2} + 2\right)$
We compare the coefficients of $x$
$1 = A + 2 C$
and coefficients of ${X}^{3}$, $0 = A + C$
So, $A = - 1$ and $C = 1$

$\frac{3 {x}^{2} + x + 4}{\left({x}^{2} + 2\right) \left({x}^{2} + 1\right)} = \frac{- x + 2}{{x}^{2} + 2} + \frac{x + 1}{{x}^{2} + 1}$
$\int \frac{\left(3 {x}^{2} + x + 4\right) \mathrm{dx}}{\left({x}^{2} + 2\right) \left({x}^{2} + 1\right)} = \int \frac{\left(- x + 2\right) \mathrm{dx}}{{x}^{2} + 2} + \int \frac{\left(x + 1\right) \mathrm{dx}}{{x}^{2} + 1}$
$= \int \frac{- x \mathrm{dx}}{{x}^{2} + 2} + \int \frac{2 \mathrm{dx}}{{x}^{2} + 2} + \int \frac{x \mathrm{dx}}{{x}^{2} + 1} + \int \frac{\mathrm{dx}}{{x}^{2} + 1}$
$= - \ln \frac{{x}^{2} + 2}{2} + \ln \frac{{x}^{2} + 1}{2} + \arctan x + \sqrt{2} \arctan \left(\frac{x}{\sqrt{2}}\right) + C$
as$\int \frac{\mathrm{dx}}{{x}^{2} + 1} = \arctan x$

and $\int \frac{x \mathrm{dx}}{{x}^{2} + 1} = \ln \frac{{x}^{2} + 1}{2}$