# How do you integrate int 1/sqrt(-e^(2x)-20e^x-101)dx using trigonometric substitution?

$- \frac{\sqrt{101}}{101} i \cdot \ln \left(\frac{10 \left(\frac{{e}^{x} + 10}{\sqrt{{e}^{2 x} + 20 {e}^{x} + 101} + 1}\right) + 1 - \sqrt{101}}{10 \left(\frac{{e}^{x} + 10}{\sqrt{{e}^{2 x} + 20 {e}^{x} + 101} + 1}\right) + 1 + \sqrt{101}}\right) + C$

#### Explanation:

The solution is a little bit lengthy !!!
From the given $\int \frac{1}{\sqrt{- {e}^{2 x} - 20 {e}^{x} - 101}} \cdot \mathrm{dx}$

int 1/((sqrt(-1)*sqrt(e^(2x)+20e^x+101))*dx

Take note that $i = \sqrt{- 1}$ the imaginary number
Set aside that complex number for a while and proceed to the integral

$\int \frac{1}{\sqrt{{e}^{2 x} + 20 {e}^{x} + 101}} \cdot \mathrm{dx}$

by completing the square and doing some grouping:
$\int \frac{1}{\sqrt{{\left({e}^{x}\right)}^{2} + 20 {e}^{x} + 100 - 100 + 101}} \cdot \mathrm{dx}$

$\int \frac{1}{\sqrt{\left({\left({e}^{x}\right)}^{2} + 20 {e}^{x} + 100\right) - 100 + 101}} \cdot \mathrm{dx}$

$\int \frac{1}{\sqrt{\left({\left({e}^{x} + 10\right)}^{2} - 100 + 101\right)}} \cdot \mathrm{dx}$

$\int \frac{1}{\sqrt{\left({\left({e}^{x} + 10\right)}^{2} + 1\right)}} \cdot \mathrm{dx}$

## First Trigonometric substitution:

The acute angle $w$ with side opposite $= {e}^{x} + 10$ and adjacent side $= 1$ with hypotenuse =$\sqrt{{\left({e}^{x} + 10\right)}^{2} + 1}$

Let ${e}^{x} + 10 = \tan w$

${e}^{x} \mathrm{dx} = {\sec}^{2} w$ $\mathrm{dw}$

$\mathrm{dx} = \frac{{\sec}^{2} w \cdot \mathrm{dw}}{e} ^ x$

and then

$\mathrm{dx} = \frac{{\sec}^{2} w \cdot \mathrm{dw}}{\tan} \left(w - 10\right)$

The integral becomes

$\int \frac{1}{\sqrt{{\tan}^{2} w + 1}} \cdot \frac{{\sec}^{2} w \cdot \mathrm{dw}}{\tan w - 10}$

$\int \frac{1}{\sqrt{{\sec}^{2} w}} \cdot \frac{{\sec}^{2} w \cdot \mathrm{dw}}{\tan w - 10}$

$\int \frac{1}{\sec} w \cdot \frac{{\sec}^{2} w \cdot \mathrm{dw}}{\tan w - 10}$

$\int \frac{\sec w \cdot \mathrm{dw}}{\tan w - 10}$

from trigonometry $\sec w = \frac{1}{\cos} w$ and $\tan w = \sin \frac{w}{\cos} w$
The integral becomes

$\int \frac{\frac{1}{\cos} w \cdot \mathrm{dw}}{\sin \frac{w}{\cos} w - 10}$ and

$\int \frac{\mathrm{dw}}{\sin w - 10 \cos w}$

## Second Trigonometric substitution:

Let $w = 2 {\tan}^{-} 1 z$

$\mathrm{dw} = 2 \cdot \frac{\mathrm{dz}}{1 + {z}^{2}}$

and also $z = \tan \left(\frac{w}{2}\right)$

The right triangle: The acute angle $\frac{w}{2}$ with opposite side $= z$
Adjacent side $= 1$ and hypotenuse $= \sqrt{{z}^{2} + 1}$

From Trigonometry : Recalling half-angle formulas

sin (w/2)=sqrt((1-cos w)/2

z/sqrt(z^2+1)=sqrt((1-cos w)/2

solving for $\cos w$

$\cos w = \frac{1 - {z}^{2}}{1 + {z}^{2}}$

Also using the identity ${\sin}^{2} w = 1 - {\cos}^{2} w$
it follows that

$\sin w = \frac{2 z}{1 + {z}^{2}}$

the integral becomes

$\int \frac{\mathrm{dw}}{\sin w - 10 \cos w} = \int \frac{2 \cdot \frac{\mathrm{dz}}{1 + {z}^{2}}}{\frac{2 z}{1 + {z}^{2}} - 10 \cdot \frac{1 - {z}^{2}}{1 + {z}^{2}}}$

Simplifying the integral results to

$\int \frac{2 \cdot \mathrm{dz}}{2 z - 10 + 10 {z}^{2}}$

$\int \frac{\left(\frac{1}{5}\right) \cdot \mathrm{dz}}{{z}^{2} + \frac{z}{5} - 1}$

By completing the square:

$\int \frac{\left(\frac{1}{5}\right) \cdot \mathrm{dz}}{{z}^{2} + \frac{z}{5} + \frac{1}{100} - \frac{1}{100} - 1}$

$\int \frac{\left(\frac{1}{5}\right) \cdot \mathrm{dz}}{{\left(z + \frac{1}{10}\right)}^{2} - \frac{101}{100}}$

$\int \frac{\left(\frac{1}{5}\right) \cdot \mathrm{dz}}{{\left(z + \frac{1}{10}\right)}^{2} - {\left(\frac{\sqrt{101}}{10}\right)}^{2}}$

Use now the formula $\int \frac{\mathrm{du}}{{u}^{2} - {a}^{2}} = \frac{1}{2 a} \cdot \ln \left(\frac{u - a}{u + a}\right) + C$

Let $u = z + \frac{1}{10}$ and $a = \frac{\sqrt{101}}{10}$ and including back the $i = \sqrt{- 1}$

Write the final answer using original variables
$- \frac{\sqrt{101}}{101} i \cdot \ln \left(\frac{10 \left(\frac{{e}^{x} + 10}{\sqrt{{e}^{2 x} + 20 {e}^{x} + 101} + 1}\right) + 1 - \sqrt{101}}{10 \left(\frac{{e}^{x} + 10}{\sqrt{{e}^{2 x} + 20 {e}^{x} + 101} + 1}\right) + 1 + \sqrt{101}}\right) + C$