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

Sep 10, 2016

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

#### Explanation:

We have:

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

Let $x + 1 = \sqrt{3} \tan \theta$. Thus, $\mathrm{dx} = \sqrt{3} {\sec}^{2} \theta d \theta$. Also note that this means $x + 4 = 3 + \sqrt{3} \tan \theta$. This yields:

$= \int \frac{3 + \sqrt{3} \tan \theta}{3 {\tan}^{2} \theta + 3} \left(\sqrt{3} {\sec}^{2} \theta d \theta\right)$

$= \int \frac{3 \sqrt{3} + 3 \tan \theta}{3 \left({\tan}^{2} \theta + 1\right)} \left({\sec}^{2} \theta d \theta\right)$

Cancel the $3$ terms and recall that tan^2theta+1=sec^2theta#:

$= \int \frac{\sqrt{3} + \tan \theta}{\sec} ^ 2 \theta \left({\sec}^{2} \theta d \theta\right)$

$= \int \left(\sqrt{3} + \tan \theta\right) d \theta$

These are common integrals:

$= \sqrt{3} \theta + \ln \left\mid \sec \right\mid \theta + C$

Note that $\theta = \arctan \left(\frac{x + 1}{\sqrt{3}}\right)$. Also, we can draw the right triangle where $\tan \theta = \frac{x + 1}{\sqrt{3}}$ to see that $\sec \theta = \frac{\sqrt{{\left(x + 1\right)}^{2} + 3}}{\sqrt{3}} = \sqrt{\frac{{x}^{2} + 2 x + 4}{3}}$. Thus:

$= \sqrt{3} \arctan \left(\frac{x + 1}{\sqrt{3}}\right) + \ln \left\mid \sqrt{\frac{{x}^{2} + 2 x + 4}{3}} \right\mid + C$

Using the log rule $\log \left({A}^{B}\right) = B \log \left(A\right)$:

$= \sqrt{3} \arctan \left(\frac{x + 1}{\sqrt{3}}\right) + \frac{1}{2} \ln \left\mid \frac{{x}^{2} + 2 x + 4}{3} \right\mid + C$

Using the $\log \left(\frac{A}{B}\right) = \log \left(A\right) - \log \left(B\right)$ the $- \frac{1}{2} \ln \left(3\right)$ will come out of the natural logarithm and be absorbed into $C$:

$= \sqrt{3} \arctan \left(\frac{x + 1}{\sqrt{3}}\right) + \frac{1}{2} \ln \left\mid {x}^{2} + 2 x + 4 \right\mid + C$

Since ${x}^{2} + 2 x + 4 > 0$ for all (real) values of $x$:

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