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

Mar 17, 2018

$\int \setminus \frac{x + 4}{{x}^{2} + 2 x + 5} \setminus \mathrm{dx} = \frac{1}{2} \setminus \ln | {x}^{2} + 2 x + 5 | + \frac{3}{2} \setminus \arctan \left(\frac{x + 1}{2}\right) + C$

#### Explanation:

We seek:

$I = \int \setminus \frac{x + 4}{{x}^{2} + 2 x + 5} \setminus \mathrm{dx}$

We not that the denominator does not factorise with real factors so use of Partial Fractions would not be appropriate. Instead we can decompose the integrand as follows:

$I = \int \setminus \frac{\frac{1}{2} \left(2 x + 2\right) + 3}{{x}^{2} + 2 x + 5} \setminus \mathrm{dx}$

Where we have manipulated the numerator in such a way that it is the derivative of the denominator, so that:

$I = \int \setminus \frac{\frac{1}{2} \left(2 x + 2\right)}{{x}^{2} + 2 x + 5} + \frac{3}{{x}^{2} + 2 x + 5} \setminus \mathrm{dx}$
$\setminus \setminus = \frac{1}{2} \setminus \int \setminus \frac{2 x + 2}{{x}^{2} + 2 x + 5} \setminus \mathrm{dx} + 3 \setminus \int \frac{1}{{x}^{2} + 2 x + 5} \setminus \mathrm{dx}$

For the First Integral, ${I}_{1}$, say, we can use a substitution, Lte

$u = {x}^{2} + 2 x + 5 \implies \frac{\mathrm{du}}{\mathrm{dx}} = 2 x + 2$

Then substituting we get (omitting the constant of integration):

${I}_{1} = \frac{1}{2} \setminus \int \setminus \frac{1}{u} \setminus \mathrm{du}$
$\setminus \setminus \setminus = \frac{1}{2} \setminus \ln | u |$

And restoring the substitution, we get:

${I}_{1} = \frac{1}{2} \setminus \ln | {x}^{2} + 2 x + 5 |$

Next, we consider the second integral, ${I}_{2}$, say, we complete the square of the denominator, thus:

${I}_{2} = 3 \setminus \int \frac{1}{{\left(x + 1\right)}^{2} - {1}^{2} + 5} \setminus \mathrm{dx}$
$\setminus \setminus \setminus = 3 \setminus \int \frac{1}{{\left(x + 1\right)}^{2} + 4} \setminus \mathrm{dx}$

And we can perform a substitution, Let:

$u = \frac{x + 1}{2} \implies \frac{\mathrm{du}}{\mathrm{dx}} = \frac{1}{2}$

And substituting we get (omitting the constant of integration):

${I}_{2} = 3 \setminus \int \frac{2}{{\left(2 u\right)}^{2} + 4} \setminus \mathrm{du}$
$\setminus \setminus \setminus = 3 \setminus \int \frac{2}{4 {u}^{2} + 4} \setminus \mathrm{du}$
$\setminus \setminus \setminus = \frac{3}{2} \setminus \int \frac{1}{{u}^{2} + 1} \setminus \mathrm{du}$
$\setminus \setminus \setminus = \frac{3}{2} \setminus \arctan u$

And restoring the substitution, we get:

${I}_{2} = \frac{3}{2} \setminus \arctan \left(\frac{x + 1}{2}\right)$

Combining both result and incorporating the integration constant, we get:

$I = \frac{1}{2} \setminus \ln | {x}^{2} + 2 x + 5 | + \frac{3}{2} \setminus \arctan \left(\frac{x + 1}{2}\right) + C$