Integration by Trigonometric Substitution

# Integration by Trigonometric Substitution

Suppose that $f$ is a function and $a$ is a constant. Sometimes we come in contact with a function containing $\sqrt{a^2 - x^2}$, $\sqrt{a^2 + x^2}$, or $\sqrt{x^2 - a^2}$. For example, consider evaluating the integral $\int \sqrt{a^2 + x^2} \: dx$. Evaluating this integral is very difficult, so we will apply a technique known as integration by trigonometric substitution, or more generally, inverse substitution. If we notice one of the three forms mentioned above within the integrand, then we can apply an appropriate trigonometric substitution and utilize a corresponding trigonometric identity to evaluate the integral.

Within the Integrand Appropriate Substitution Appropriate Trigonometric Identity
$a^2 + x^2$ $x = a \tan \theta$, $-\frac{\pi}{2} ≤ \theta ≤ \frac{\pi}{2}$ $\tan ^2 \theta + 1 = \sec ^2 \theta$
$a^2 - x^2$ $x = a \sin \theta$, $-\frac{\pi}{2} ≤ \theta ≤ \frac{\pi}{2}$ $1 - \sin ^2 \theta = \cos ^2 \theta$
$x^2 - a^2$ $x = a \sec \theta$, $0 ≤ \theta ≤ \frac{\pi}{2}$ $\sec ^2 \theta - 1 = \tan ^2 \theta$

Note that if were wanted to calculate $\int \sqrt{a^2 - x^2} \: dx$ for example, then making the substitution of $x = a \sin \theta$, then we obtain the following integral:

(1)
\begin{align} \int \sqrt{a^2 - a^2 \sin ^2 \theta }\: d \theta \\ = \int \sqrt{a^2(1 - \sin ^2 \theta) }\: d \theta \\ = \int \sqrt{a^2 \cos ^2 \theta }\: d \theta \\ = \int a | \cos \theta | \: d \theta \end{align}

The integral above is much easier to evaluate.

## Example 1

Evaluate the following integral $\int \frac{1}{x^2 - 4} \: dx$.

We can see that in the denominator we have the form $x^2 - a^2$. Hence we will use the substitution that $x = 2 \sec \theta$. It thus follows that $dx = 2 \sec \theta \tan \theta \: d \theta$. Using this substitution we obtain that:

(2)
\begin{align} \int \frac{1}{x^2 - 4} \: dx = \int \frac{2 \sec \theta \tan \theta}{4 \sec^2 \theta - 4} \: d \theta \\ \int \frac{1}{x^2 - 4} \: dx = \int \frac{2 \sec \theta \tan \theta}{4 (\sec^2 \theta - 1 )} \: d \theta \\ \int \frac{1}{x^2 - 4} \: dx = \int \frac{2 \sec \theta \tan \theta}{4 (\tan^2 \theta )} \: d \theta \\ \int \frac{1}{x^2 - 4} \: dx = \int \frac{\sec \theta}{2 \tan \theta } \: d \theta \\ \int \frac{1}{x^2 - 4} \: dx = \frac{1}{2} \cdot \int \frac{\sec \theta}{\tan \theta } \: d \theta \\ \int \frac{1}{x^2 - 4} \: dx = \frac{1}{2} \cdot \int \csc \theta \: d \theta \\ \int \frac{1}{x^2 - 4} \: dx = \frac{1}{2} \cdot ( \ln | \csc \theta - \cot \theta | ) + C \end{align}

We now want to rewrite our solution in terms of x. We can thus construct a triangle to assist us in doing so. We made the original substitution that $x = 2 \sec \theta$, so it follows that $\sec \theta = \frac{x}{2}$, or rather that $\cos \theta = \frac{2}{x}$, and we obtain the following triangle: Hence it follows that $\csc \theta = \frac{x}{\sqrt{x^2 + 4}}$, and $\cot \theta = \frac{2}{\sqrt{x^2 + 4}}$. Substituting these back into our integral we obtain:

(3)
\begin{align} \int \frac{1}{x^2 - 4} \: dx = \frac{1}{2} \cdot ( \ln \mid \frac{x}{\sqrt{x^2 + 4}} - \frac{2}{\sqrt{x^2 + 4}}\mid ) + C \\ \int \frac{1}{x^2 - 4} \: dx = \frac{1}{2} \cdot ( \ln \mid \frac{x - 2}{\sqrt{x^2 - 4}} \mid ) + C \\ \int \frac{1}{x^2 - 4} \: dx = \frac{1}{2} \cdot ( \ln \mid \frac{x - 2}{\sqrt{(x-2)(x+2)}} \mid ) + C \\ \int \frac{1}{x^2 - 4} \: dx = \frac{1}{2} \cdot ( \ln \mid \sqrt{\frac{x - 2}{x + 2}} \mid ) + C \\ \int \frac{1}{x^2 - 4} \: dx = \frac{1}{4} \cdot ( \ln \mid \frac{x - 2}{x + 2} \mid ) + C \end{align}