# Trigonometric Substitutions In Integrals

Trigonometric Substitutions are especially useful when we want to get rid of $\sqrt{{{{x}}^{{2}}-{{a}}^{{2}}}}$, $\sqrt{{{{x}}^{{2}}+{{a}}^{{2}}}}$ and $\sqrt{{{{a}}^{{2}}-{{x}}^{{2}}}}$ under integral sign.

Recall that trignomeric identity states ${{\cos}}^{{2}}{\left({x}\right)}+{{\sin}}^{{2}}{\left({x}\right)}={1}$.

Multiplying both sides by ${{a}}^{{2}}$ gives ${{a}}^{{2}}{{\cos}}^{{2}}{\left({x}\right)}+{{a}}^{{2}}{{\sin}}^{{2}}{\left({x}\right)}={{a}}^{{2}}$.

Dividing both sides of equation by ${{\cos}}^{{2}}{\left({x}\right)}$ yields: ${{a}}^{{2}}+{{a}}^{{2}}{{\tan}}^{{2}}{\left({x}\right)}={{a}}^{{2}}{{\sec}}^{{2}}{\left({x}\right)}$.

From these equations we have that ${\cos{{\left({x}\right)}}}=\frac{{1}}{{a}}\sqrt{{{{a}}^{{2}}-{{\left({\operatorname{asin}{{\left({x}\right)}}}\right)}}^{{2}}}}$ and ${\tan{{\left({x}\right)}}}=\frac{{1}}{{a}}\sqrt{{{\left({a}{\sec{{\left({x}\right)}}}\right)}-{{a}}^{{2}}}}$ (since integral is indefinite, we can drop absolute value bars, but this can't be done in definite integral). Notice similarity with above roots.

In general:

1. If you have $\sqrt{{{{a}}^{{2}}-{{x}}^{{2}}}}$, make substitution ${x}={\operatorname{asin}{{\left({u}\right)}}}$.
2. If you have $\sqrt{{{{x}}^{{2}}-{{a}}^{{2}}}}$, make substitution ${x}={a}{\sec{{\left({u}\right)}}}$.
3. If you have $\sqrt{{{{x}}^{{2}}+{{a}}^{{2}}}}$, make substitution ${x}={a}{\tan{{\left({u}\right)}}}$.

However, carefully examine integral: maybe you don't need none of the above substitutions: for example, for integral $\int{x}\sqrt{{{{x}}^{{2}}+{{a}}^{{2}}}}{d}{x}$ there is a simpler substitution ${u}={{x}}^{{2}}+{{a}}^{{2}}$.

Example 1. Find $\int\frac{\sqrt{{{4}{{x}}^{{2}}-{16}}}}{{x}}{d}{x}$

We see similar to above root in numerator, just need to rewrite it a bit: $\sqrt{{{4}{{x}}^{{2}}-{16}}}={2}\sqrt{{{{x}}^{{2}}-{4}}}$.

Now, we are ready to make substitution ${x}={2}{\sec{{\left({u}\right)}}}$, then ${d}{x}={2}{\sec{{\left({u}\right)}}}{\tan{{\left({u}\right)}}}{d}{u}$.

So, ${2}\int\frac{\sqrt{{{{x}}^{{2}}-{4}}}}{{x}}{d}{x}={2}\int\frac{\sqrt{{{4}{{\sec}}^{{2}}{\left({u}\right)}-{4}}}}{{{2}{\sec{{\left({u}\right)}}}}}{2}{\sec{{\left({u}\right)}}}{\tan{{\left({u}\right)}}}{d}{u}=$

$={4}\int{\left|{\tan{{\left({u}\right)}}}\right|}{\tan{{\left({u}\right)}}}{d}{u}$

Since integral is indefinite we will drop absolute value bars: ${4}\int{{\tan}}^{{2}}{\left({u}\right)}{d}{u}$. We know how to do such integrals (see Trigonometric Integrals note). So, ${4}\int{{\tan}}^{{2}}{\left({u}\right)}{d}{u}={4}\int{\left({{\sec}}^{{2}}{\left({u}\right)}-{1}\right)}{d}{u}={4}{\left({\tan{{\left({u}\right)}}}-{u}\right)}+{C}$.

To return to old variable we will need to find ${\tan{{\left({u}\right)}}}$ in terms of ${x}$. From our substitution we see that ${\sec{{\left({u}\right)}}}=\frac{{x}}{{2}}$.

Since ${\tan{{\left({u}\right)}}}=\sqrt{{{{\sec}}^{{2}}{\left({u}\right)}-{1}}}$ then ${\tan{{\left({u}\right)}}}=\sqrt{{\frac{{{{x}}^{{2}}}}{{4}}-{1}}}=\frac{{1}}{{2}}\sqrt{{{{x}}^{{2}}-{4}}}$.

Since ${\sec{{\left({u}\right)}}}=\frac{{x}}{{2}}$ then ${\cos{{\left({u}\right)}}}=\frac{{2}}{{x}}$ and ${u}={\operatorname{arccos}{{\left(\frac{{2}}{{x}}\right)}}}$ (note that we could express ${u}$ in terms of ${x}$ through inverse secant: ${u}=\text{arcsec}{\left(\frac{{x}}{{2}}\right)}$, people just more familiar with cosines therefore we use inverse cosine).

Finally, $\int\frac{{\sqrt{{{4}{{x}}^{{2}}-{16}}}}}{{x}}{d}{x}={4}{\left(\frac{{1}}{{2}}\sqrt{{{{x}}^{{2}}-{4}}}-{\operatorname{arccos}{{\left(\frac{{2}}{{x}}\right)}}}\right)}+{C}=$

$={2}{\left(\sqrt{{{{x}}^{{2}}-{4}}}-{2}{\operatorname{arccos}{{\left(\frac{{2}}{{x}}\right)}}}\right)}+{C}$.

Now, let's see how to handle absolute value bars in the definite integral.

Example 2. Calculate ${\int_{{2}}^{{4}}}\frac{\sqrt{{{4}{{x}}^{{2}}-{16}}}}{{x}}{d}{x}$.

It is same integral as in example 1. First, simplify expression under square root: ${2}{\int_{{2}}^{{4}}}\frac{\sqrt{{{{x}}^{{2}}-{4}}}}{{x}}{d}{x}$.

Let ${x}={2}{\sec{{\left({u}\right)}}}$ then ${d}{x}={2}{\sec{{\left({u}\right)}}}{\tan{{\left({u}\right)}}}{d}{u}$.

${x}$ is changing from 2 to 4, so ${\sec{{\left({u}\right)}}}$ is changing from $\frac{{2}}{{2}}={1}$ to $\frac{{4}}{{2}}={2}$, that's why ${\cos{{\left({u}\right)}}}$ is changing from $\frac{{1}}{{2}}$ to ${1}$ and u is changing from 0 to $\frac{\pi}{{3}}$. Tangent on this interval is positive, so $\sqrt{{{{x}}^{{2}}-{4}}}=\sqrt{{{4}{{\sec}}^{{2}}{\left({u}\right)}-{4}}}={2}{\left|{\tan{{\left({u}\right)}}}\right|}={2}{\tan{{\left({u}\right)}}}$.

Note that in determining value of ${u}$ we took the smallest positive value.

Now, integral becomes ${4}{\int_{{0}}^{{\frac{\pi}{{3}}}}}{{\tan}}^{{2}}{\left({u}\right)}{d}{u}={4}{\int_{{0}}^{{\frac{\pi}{{3}}}}}{\left({{\sec}}^{{2}}{\left({u}\right)}-{1}\right)}{d}{u}={4}{\left({\tan{{\left({u}\right)}}}-{u}\right)}{{\mid}_{{0}}^{{\frac{\pi}{{2}}}}}=$

$={4}{\left({\left({\tan{{\left({0}\right)}}}-{0}\right)}-{\left({\tan{{\left(\frac{\pi}{{3}}\right)}}}-\frac{{\pi}}{{3}}\right)}\right)}=-{4}{\left({0}-{0}-\sqrt{{{3}}}+\frac{{\pi}}{{3}}\right)}=$

$={4}\sqrt{{{3}}}-\frac{{{4}\pi}}{{3}}$.

Example 3. Calculate ${\int_{{-{4}}}^{{-{2}}}}\frac{\sqrt{{{4}{{x}}^{{2}}-{16}}}}{{x}}{d}{x}$.

It is same integral as in example 1. First, simplify expression under square root: ${2}{\int_{{-{4}}}^{{-{2}}}}\frac{\sqrt{{{{x}}^{{2}}-{4}}}}{{x}}{d}{x}$.

Let ${x}={2}{\sec{{\left({u}\right)}}}$ then ${d}{x}={2}{\sec{{\left({u}\right)}}}{\tan{{\left({u}\right)}}}{d}{u}$.

${x}$ is changing from -4 to -2, so ${\sec{{\left({u}\right)}}}$ is changing from $\frac{{-{4}}}{{2}}=-{2}$ to $\frac{{-{2}}}{{2}}=-{1}$, that's why ${\cos{{\left({u}\right)}}}$ is changing from $-\frac{{1}}{{2}}$ to $-{1}$ and ${u}$ is changing from $\frac{{{2}\pi}}{{3}}$ to $\pi$.

This means that tangent on this interval is negative, so $\sqrt{{{{x}}^{{2}}-{4}}}=\sqrt{{{4}{{\sec}}^{{2}}{\left({u}\right)}-{4}}}={2}{\left|{\tan{{\left({u}\right)}}}\right|}=-{2}{\tan{{\left({u}\right)}}}$.

Note that in determining value of ${u}$ we took the smallest positive value.

Now, integral becomes $-{4}{\int_{{\frac{{{2}\pi}}{{3}}}}^{{\pi}}}{{\tan}}^{{2}}{\left({u}\right)}{d}{u}=-{4}{\int_{{\frac{{{2}\pi}}{{3}}}}^{{\pi}}}{\left({{\sec}}^{{2}}{\left({u}\right)}-{1}\right)}{d}{u}={4}{\left({\tan{{\left({u}\right)}}}-{u}\right)}{{\mid}_{{\frac{{{2}\pi}}{{3}}}}^{{\pi}}}=$

$=-{4}{\left({\left({\tan{{\left(\pi\right)}}}-\pi\right)}-{\left({\tan{{\left(\frac{{{2}\pi}}{{3}}\right)}}}-\frac{{{2}\pi}}{{3}}\right)}\right)}=-{4}{\left({0}-\pi+\sqrt{{{3}}}+\frac{{{2}\pi}}{{3}}\right)}=$

$=\frac{{{4}\pi}}{{3}}-{4}\sqrt{{{3}}}$.

Example 4. Calculate $\int\frac{{1}}{{{{x}}^{{2}}\sqrt{{{4}-{{x}}^{{2}}}}}}{d}{x}$.

We will need substitution 2 here: ${x}={2}{\sin{{\left({u}\right)}}}$ then ${d}{x}={2}{\cos{{\left({u}\right)}}}{d}{u}$ and integral can be rewritten as:

$\int\frac{{1}}{{{4}{{\sin}}^{{2}}{\left({u}\right)}\sqrt{{{4}-{4}{{\sin}}^{{2}}{\left({u}\right)}}}}}{2}{\cos{{\left({u}\right)}}}{d}{u}=\frac{{1}}{{4}}\int\frac{{1}}{{{{\sin}}^{{2}}{\left({u}\right)}{\left|{\cos{{\left({u}\right)}}}\right|}}}{\cos{{\left({u}\right)}}}{d}{u}$.

Since integral is indefinite, we can drop absolute value bars (we assume that cosine is positive):

$\frac{{1}}{{4}}\int\frac{{1}}{{{{\sin}}^{{2}}{\left({u}\right)}}}{d}{u}=\frac{{1}}{{4}}\int{{\csc}}^{{2}}{\left({u}\right)}{d}{u}=-\frac{{1}}{{4}}{\cot{{\left({u}\right)}}}+{C}$.

Since ${x}={2}{\sin{{\left({u}\right)}}}$ then ${\sin{{\left({u}\right)}}}=\frac{{x}}{{2}}$ and ${\cos{{\left({u}\right)}}}=\sqrt{{{1}-\frac{{{{x}}^{{2}}}}{{4}}}}=\frac{{1}}{{2}}\sqrt{{{4}-{{x}}^{{2}}}}$, so ${\cot{{\left({u}\right)}}}=\frac{{\cos{{\left({u}\right)}}}}{{\sin{{\left({u}\right)}}}}=\frac{{\frac{{1}}{{2}}\sqrt{{{4}-{{x}}^{{2}}}}}}{{\frac{{1}}{{2}}{x}}}=\frac{{\sqrt{{{4}-{{x}}^{{2}}}}}}{{x}}$.

Finally, $\int\frac{{1}}{{{{x}}^{{2}}\sqrt{{{4}-{{x}}^{{2}}}}}}{d}{x}=-\frac{{\sqrt{{{4}-{{x}}^{{2}}}}}}{{{4}{x}}}+{C}$.

Example 5. Calculate ${\int_{{0}}^{{2}}}\frac{{{{x}}^{{2}}}}{{{\left({{x}}^{{2}}+{4}\right)}}^{{\frac{{5}}{{2}}}}}{d}{x}$

Since ${{\left({{x}}^{{2}}+{4}\right)}}^{{\frac{{5}}{{2}}}}={{\left(\sqrt{{{{x}}^{{2}}+{4}}}\right)}}^{{5}}$ then make substitution number 3: ${x}={2}{\tan{{\left({u}\right)}}}$. In this case ${d}{x}={2}{{\sec}}^{{2}}{\left({u}\right)}{d}{u}$.

So, integral can be rewritten as ${\int_{{0}}^{{2}}}\frac{{{4}{{\tan}}^{{2}}{\left({u}\right)}}}{{{\left(\sqrt{{{4}{{\tan}}^{{2}}{\left({u}\right)}+{4}}}\right)}}^{{5}}}{2}{{\sec}}^{{2}}{\left({u}\right)}{d}{u}={\int_{{0}}^{{2}}}\frac{{{4}{{\tan}}^{{2}}{\left({u}\right)}}}{{{\left({2}{\left|{\sec{{\left({u}\right)}}}\right|}\right)}}^{{5}}}{2}{{\sec}}^{{2}}{\left({u}\right)}{d}{u}$.

Since ${x}$ is changing from 0 to 2 then ${\tan{{\left({u}\right)}}}$ is changing from $\frac{{0}}{{2}}={0}$ to $\frac{{2}}{{2}}={1}$. This means that ${u}$ is changing from ${0}$ to $\frac{\pi}{{4}}$. This means that ${\sec{{\left({u}\right)}}}$ is positive on this interval, so ${\left|{\sec{{\left({u}\right)}}}\right|}={\sec{{\left({u}\right)}}}$.

So, integral becomes $\frac{{1}}{{4}}{\int_{{0}}^{{\frac{\pi}{{4}}}}}\frac{{{{\tan}}^{{2}}{\left({u}\right)}}}{{{{\sec}}^{{3}}{\left({u}\right)}}}{d}{u}$.

To calculate this integral it is better to convert it to sines and cosines: $\frac{{1}}{{4}}{\int_{{0}}^{{\frac{\pi}{{4}}}}}\frac{{{{\tan}}^{{2}}{\left({u}\right)}}}{{{{\sec}}^{{3}}{\left({u}\right)}}}{d}{u}=\frac{{1}}{{4}}{\int_{{0}}^{{\frac{\pi}{{4}}}}}{{\sin}}^{{2}}{\left({u}\right)}{\cos{{\left({u}\right)}}}{d}{u}$.

Let ${t}={\sin{{\left({u}\right)}}}$ then ${d}{t}={\cos{{\left({u}\right)}}}{d}{u}$. Since u is changing from 0 to $\frac{{\pi}}{{4}}$ then ${t}$ is changing from sin(0)=0 to ${\sin{{\left(\frac{\pi}{{4}}\right)}}}=\frac{{1}}{\sqrt{{{2}}}}$.

And integral becomes $\frac{{1}}{{4}}{\int_{{0}}^{{\frac{{1}}{\sqrt{{{2}}}}}}}{{t}}^{{2}}{d}{t}=\frac{{1}}{{12}}{{t}}^{{3}}{{\mid}_{{0}}^{{\frac{{1}}{\sqrt{{{2}}}}}}}=\frac{{1}}{{12}}{\left(\frac{{1}}{{{\left(\sqrt{{{2}}}\right)}}^{{3}}}-{{0}}^{{3}}\right)}=\frac{{1}}{{{24}\sqrt{{{2}}}}}$.

Example 6. Evaluate $\int\sqrt{{{{x}}^{{2}}+{4}{x}+{13}}}{d}{x}$.

It seems that this integral can't be evaluated using above substitution. However, recall that any quadratic function ${a}{{x}}^{{2}}+{b}{x}+{c}$ can be transformed into ${a}{{\left({x}+{d}\right)}}^{{2}}+{e}$ by completing a square.

So, ${{x}}^{{2}}+{4}{x}+{13}={{x}}^{{2}}+{4}{x}+{4}+{9}={{\left({x}+{2}\right)}}^{{2}}+{9}$.

This is similar to $\sqrt{{{{x}}^{{2}}+{{a}}^{{2}}}}$ except ${x}+{2}$ term. But this doesn't matter. Let ${x}+{2}={3}{\tan{{\left({u}\right)}}}$. Then ${d}{x}={3}{{\sec}}^{{2}}{\left({u}\right)}{d}{u}$.

Integral, thus, becomes $\int\sqrt{{{9}{{\tan}}^{{2}}{\left({u}\right)}+{9}}}\cdot{3}{{\sec}}^{{2}}{\left({u}\right)}{d}{u}=\int{3}{\left|{\sec{{\left({u}\right)}}}\right|}\cdot{3}{{\sec}}^{{2}}{\left({u}\right)}{d}{u}={9}\int{{\sec}}^{{3}}{\left({u}\right)}{d}{u}$.

This integral was found in Trigonometric Integrals note: ${9}\int{{\sec}}^{{3}}{\left({u}\right)}{d}{u}=\frac{{9}}{{2}}{\left({\sec{{\left({u}\right)}}}{\tan{{\left({u}\right)}}}+{\ln}{\left|{\sec{{\left({u}\right)}}}+{\tan{{\left({u}\right)}}}\right|}\right)}+{C}$.

Since ${\tan{{\left({u}\right)}}}=\frac{{{x}+{2}}}{{3}}$ then ${\sec{{\left({u}\right)}}}=\sqrt{{\frac{{{{\left({x}+{2}\right)}}^{{2}}}}{{9}}+{1}}}=\frac{{1}}{{3}}\sqrt{{{{x}}^{{2}}+{4}{x}+{13}}}$.

Finally, $\int\sqrt{{{{x}}^{{2}}+{4}{x}+{13}}}{d}{x}=$

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

$=\frac{{1}}{{2}}{\left(\sqrt{{{{x}}^{{2}}+{4}{x}+{13}}}{\left({x}+{2}\right)}+{9}\text{arcsinh}{\left(\frac{{{x}+{2}}}{{3}}\right)}\right)}+{C}$.

Example 7. Evaluate $\int\sqrt{{{{e}}^{{x}}-{1}}}{d}{x}$.

Again expression under the square root is not like the above 3 expressions. However, note that $\sqrt{{{{e}}^{{x}}-{1}}}=\sqrt{{{{\left({{e}}^{{\frac{{x}}{{2}}}}\right)}}^{{2}}-{1}}}$. And it is similar to substitution 2. So, let ${{e}}^{{\frac{{x}}{{2}}}}={\sec{{\left({u}\right)}}}$ then $\frac{{1}}{{2}}{{e}}^{{\frac{{x}}{{2}}}}{d}{x}={\sec{{\left({u}\right)}}}{\tan{{\left({u}\right)}}}{d}{u}$. We need to express ${d}{x}$ in terms of ${u}$ only.

Since ${{e}}^{{\frac{{x}}{{2}}}}={\sec{{\left({u}\right)}}}$ then $\frac{{1}}{{2}}{\sec{{\left({u}\right)}}}{d}{x}={\sec{{\left({u}\right)}}}{\tan{{\left({u}\right)}}}{d}{u}$ or ${d}{x}={2}{\tan{{\left({u}\right)}}}{d}{u}$.

Integral now becomes $\int\sqrt{{{{\sec}}^{{2}}{\left({u}\right)}-{1}}}\cdot{2}{\tan{{\left({u}\right)}}}{d}{u}={2}\int{\left|{\tan{{\left({u}\right)}}}\right|}{\tan{{\left({u}\right)}}}{d}{u}$.

Since integral is indefinite, we drop absolute value bars: ${2}\int{{\tan}}^{{2}}{\left({u}\right)}{d}{u}={2}\int{\left({{\sec}}^{{2}}{\left({u}\right)}-{1}\right)}{d}{u}={2}{\left({\tan{{\left({u}\right)}}}-{u}\right)}+{C}$.

Since ${\sec{{\left({u}\right)}}}={{e}}^{{\frac{{x}}{{2}}}}$ then ${\tan{{\left({u}\right)}}}=\sqrt{{{{\left({{e}}^{{\frac{{x}}{{2}}}}\right)}}^{{2}}-{1}}}=\sqrt{{{{e}}^{{x}}-{1}}}$.

And ${u}$ is either $\text{arcsec}{\left({{e}}^{{\frac{{x}}{{2}}}}\right)}$ or ${\operatorname{arctan}{{\left(\sqrt{{{{e}}^{{x}}-{1}}}\right)}}}$ (we choose second option).

So, $\int\sqrt{{{{e}}^{{x}}-{1}}}{d}{x}={2}{\left(\sqrt{{{{e}}^{{x}}-{1}}}-{\operatorname{arctan}{{\left(\sqrt{{{{e}}^{{x}}-{1}}}\right)}}}\right)}+{C}$.

Note, that this integral can be solved another way: with double substitution; first substitution is ${u}={{e}}^{{x}}$ and second is ${t}=\sqrt{{{u}-{1}}}$.

We have seen (last two examples) that some integrals can be converted into integrals that can be solved using trigonometric substitution described above.