# How do you find the integral of int (x-2)/((x+1)^2+4)?

Dec 18, 2017

$\frac{1}{2} \ln \left({x}^{2} + 2 x + 5\right) - 3 \left(\frac{1}{2} \arctan \left(\frac{x + 1}{2}\right)\right) + C$

#### Explanation:

$\int \frac{x - 2}{{\left(x + 1\right)}^{2} + 4} \mathrm{dx}$
you can't use the integral of arctan(x) yet, because the numerator isn't just a constant. to remove the x term from the numerator, you have to use ln(x).

the formula for using ln(x) for integrals: $\int \frac{f ' \left(x\right)}{f} \left(x\right) \mathrm{dx} = \ln \left(f \left(x\right)\right) + C$

expand the denominator: $\int \frac{x - 2}{{x}^{2} + 2 x + 5} \mathrm{dx}$. now you want to change the numerator to be the derivative of the denominator ${x}^{2} + 2 x + 5$. that means you want to create two fractions, one of which has the numerator $\frac{d}{\mathrm{dx}} \left({x}^{2} + 2 x + 5\right)$ or $2 x + 2$

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

now the first integral has the $\frac{f ' \left(x\right)}{f} \left(x\right)$ format and the second integral will now integrate into some form of $\arctan \left(x\right)$

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

for $- \int \frac{3}{{\left(x + 1\right)}^{2} + 4} \mathrm{dx}$, use the formula: for this problem, (x+1) will equal the x in the formula, and 2 will equal the a.
$- 3 \int \frac{1}{{\left(x + 1\right)}^{2} + 4} \mathrm{dx} = - 3 \left(\frac{1}{2} \arctan \left(\frac{x + 1}{2}\right)\right) + C$

combining everything:
$\int \frac{x - 2}{{\left(x + 1\right)}^{2} + 4} \mathrm{dx} = \frac{1}{2} \ln \left({x}^{2} + 2 x + 5\right) + C - 3 \left(\frac{1}{2} \arctan \left(\frac{x + 1}{2}\right)\right) + C$
you can merge the two C's into a single C because adding any two constants still results in a constant.

final answer: $\frac{1}{2} \ln \left({x}^{2} + 2 x + 5\right) - 3 \left(\frac{1}{2} \arctan \left(\frac{x + 1}{2}\right)\right) + C$