How do you evaluate the integral int (xdx)/(x^2+4x+5)?

Feb 11, 2017

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

Explanation:

Let

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

We can complete the square on the denominator, to get

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

Let $u = x + 2 \iff x = u - 2 \implies \frac{\mathrm{dx}}{\mathrm{du}} = 1$, so then substituting into the integral we get:

$I = \int \setminus \frac{u - 2}{{u}^{2} + 1} \setminus \mathrm{du}$
$\setminus \setminus = \int \setminus \frac{u}{{u}^{2} + 1} \setminus - \frac{2}{{u}^{2} + 1} \setminus \mathrm{du}$
$\setminus \setminus = \int \setminus \frac{u}{{u}^{2} + 1} \setminus \mathrm{du} \setminus - 2 \int \frac{1}{{u}^{2} + 1} \setminus \mathrm{du}$
$\setminus \setminus = \frac{1}{2} \int \setminus \frac{2 u}{{u}^{2} + 1} \setminus \mathrm{du} \setminus - 2 \int \frac{1}{{u}^{2} + 1} \setminus \mathrm{du}$

The first intergral is of the form $\int \setminus \frac{f ' \left(u\right)}{f \left(u\right)} \setminus \mathrm{du}$ which is a standard result with solution $\ln | f \left(u\right) |$, And so:

$\int \setminus \frac{2 u}{{u}^{2} + 1} \setminus \mathrm{du} = \ln | {u}^{2} + 1 |$
$\text{ } = \ln | {\left(x + 2\right)}^{2} + 1 |$
$\text{ } = \ln | {x}^{2} + 4 x + 5 |$

For the second integral, we can use the substitution $x = \tan \theta$

$u = \tan \theta \implies \frac{\mathrm{du}}{d \theta} = {\sec}^{2} \theta$, and, $\theta = {\tan}^{-} 1 u$
$u = \tan \theta \iff {u}^{2} = {\tan}^{2} \theta$
$\text{ } \implies 1 + {u}^{2} = 1 + {\tan}^{2} \theta$
$\text{ } \implies 1 + {u}^{2} = {\sec}^{2} \theta$

Substituting into the integral we get:

$\int \frac{1}{{u}^{2} + 1} \setminus \mathrm{du} = \int \setminus d \theta$
$\text{ } = \theta$
$\text{ } = {\tan}^{-} 1 u$
$\text{ } = {\tan}^{-} 1 \left(x + 2\right)$

Combining the result from both result we get:

$I = \frac{1}{2} \ln | {x}^{2} + 4 x + 5 | - 2 {\tan}^{-} 1 \left(x + 2\right) + C$