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

Oct 2, 2016

$\frac{{x}^{2} - 4 x + 16 \ln \left\mid x + 2 \right\mid}{2} + C$

#### Explanation:

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

Before performing any integration, let's rewrite this function:

$I = \int {x}^{2} / \left(x + 2\right) \mathrm{dx} + \int \frac{4}{x + 2} \mathrm{dx}$

Perform long division on ${x}^{2} \div \left(x + 2\right)$ to see that ${x}^{2} / \left(x + 2\right) = x - 2 + \frac{4}{x + 2}$:

$I = \int x \mathrm{dx} - 2 \int \mathrm{dx} + 8 \int \frac{\mathrm{dx}}{x + 2}$

The first two don't require substitution:

$I = {x}^{2} / 2 - 2 x + 8 \int \frac{\mathrm{dx}}{x + 2}$

For the final integral, let $u = x + 2$, so $\mathrm{du} = \mathrm{dx}$:

$I = \frac{{x}^{2} - 4 x}{2} + 8 \int \frac{\mathrm{du}}{u}$

This is a common integral:

$I = \frac{{x}^{2} - 4 x}{2} + 8 \ln \left\mid u \right\mid + C$

Back-substitute $u = x + 2$:

$I = \frac{{x}^{2} - 4 x + 16 \ln \left\mid x + 2 \right\mid}{2} + C$