# Trigonometric Substitution

This is a new method of substitution, and at first, it can be difficult to get used to. The biggest difference from the substitution methods we've used so far (u-substitution and integration by parts) is that rather than defining a new variable explicitly in terms of $x$, like $u=$ "some expression of $x$," we'll define the new variable ($\theta$ in this case) implicitly by writing $x=$ "some expression of $\theta$."

Just like before, we'll do this so that the integral becomes something we can handle (usually by means of trig integration, as outlined in the previous section), and we'll have to back-substitute in order to have an answer in terms of $x$.

Let's illustrate this process with an example.

Evaluate $\displaystyle\int \dfrac{1}{\sqrt{1-x^2}}\ dx$.

### Solution

Look carefully at what we have: $1-x^2$. If we let $x=\sin \theta$, this part will become $1-\sin^2 \theta$, which can be replaced with $\cos^2 \theta$, since $\sin^2 \theta + \cos^2 \theta = 1.$

Then we have $\int \dfrac{1}{\sqrt{\cos^2 \theta}}\ dx$

As always, when we do a substitution, we need to account for $dx$: since $x=\sin \theta$, $dx = \cos \theta \ d\theta$.

That leaves us with $\int \dfrac{1}{\sqrt{\cos^2 \theta}} \ \cos \theta \ d\theta = \int \dfrac{1}{\cos \theta} \ \cos \theta \ d\theta = \int d\theta$

This is something we can integrate: $\int d\theta = \theta + C$

All that remains is to substitute back to get the answer in terms of $x$: to do this, go back to where we defined $\theta$: if $x = \sin \theta$, $\theta = \sin^{-1} x$.

Thus, $\int \dfrac{1}{\sqrt{1-x^2}}\ dx = \ans{\sin^{-1} x + C}$

# Process

This method is very limited: it applies to exactly three forms. All of these are related to the Pythagorean identity and its variations.

Recall that $\sin^2 \theta + \cos^2 \theta = 1$ and if we divide each term by $\cos^2 \theta$, we get $\tan^2 \theta + 1 = \sec^2 \theta.$

We've already seen the first form: the problem involved $\sqrt{1-x^2}$, so we let $x=\sin \theta$ so that the first identity helped us simplify the integral. We could also use $x=\cos \theta$ in this case, but for simplicity we'll stick with the sine function.

## Case 1: $x = a \sin \theta$

When the integral involves $\sqrt{a^2-x^2}$, let $x=a \sin \theta$ (in the example above, $a=1$).

Then $dx = a\cos \theta \ d\theta$ and \begin{aligned} \sqrt{a^2-x^2} &= \sqrt{a^2 - a^2\sin^2 \theta}\ &= a\sqrt{1-\sin^2 \theta}\ &= a\sqrt{\cos^2 \theta}\ &= a \cos \theta \end{aligned}

Evaluate $\displaystyle\int \sqrt{4-x^2} \ dx$.

### Solution

In this case, $a=2$ ($a^2=4$), so we'll let $x=2 \sin \theta$.

Then $dx = 2 \cos \theta \ d\theta$ and $\sqrt{4-x^2} = 2 \cos \theta$

Making the substitution: $\int \sqrt{4-x^2} \ dx = \int 2 \cos \theta \cdot 2 \cos \theta \ d\theta$

To integrate this, recall what we did in the previous section: to integrate $\cos^2 \theta$, we'll need to use the half-angle identity: \begin{aligned} \int 4 \cos^2 \theta \ d\theta &= \int 4 \left(\dfrac{1}{2} + \dfrac{1}{2}\cos(2\theta)\right)\ d\theta\ &= \int 2 + 2\cos (2\theta) \ d\theta\ &= 2\theta + \sin(2\theta) + C \end{aligned}

### Get the answer in terms of $x$

This part is a bit tricky. First, we need another identity that we haven't used before: $\sin (2\theta) = 2 \sin \theta \cos \theta$

This makes our answer look like $2\theta + 2\sin \theta \cos \theta + C$

Now finally, we need to figure out what $\theta$, $\sin \theta$, and $\cos \theta$ are in terms of $x$.

The first we've already seen: if $x=2\sin \theta$, we can solve for $\theta$: $\theta = \sin^{-1} \dfrac{x}{2}$

Also, from this we can see that $\sin \theta = \dfrac{x}{2}.$

The last part is to find $\cos \theta$. There are two ways to do this:

#### Algebraic Method

Look back at what we have at the beginning of the problem: $\sqrt{4-x^2} = 2 \cos \theta \longrightarrow \cos \theta = \dfrac{\sqrt{4-x^2}}{2}$

#### Geometric Method

Since $\sin \theta = \dfrac{x}{2}$, we can draw the following right triangle and use it to find $\cos \theta$:

We get the same answer from this method: $\cos \theta = \dfrac{\sqrt{4-x^2}}{2}$

Putting it all together: \begin{aligned} \int \sqrt{4-x^2}\ dx &= \int 4 \cos^2 \theta \ d\theta\ &= 2\theta + \sin (2\theta) + C\ &= 2\theta + 2 \sin \theta \cos \theta + C\ &= 2\sin^{-1} \dfrac{x}{2} + 2\left(\dfrac{x}{2}\right)\left(\dfrac{\sqrt{4-x^2}}{2}\right) + C\ &= \ans{2\sin^{-1} \dfrac{x}{2} + \dfrac{1}{2}x\sqrt{4-x^2} + C} \end{aligned}

## Case 2: $x = a \tan \theta$

When the integral involves $\sqrt{a^2 + x^2}$, let $x= a \tan \theta$. Then $dx = a \sec^2 \theta \ d\theta$ and \begin{aligned} \sqrt{a^2 + x^2} &= \sqrt{a^2 + a^2 \tan^2 \theta}\ &= a\sqrt{1+\tan^2 \theta}\ &= a\sqrt{\sec^2 \theta}\ &= a \sec \theta \end{aligned}

Evaluate $\displaystyle\int \dfrac{x^3}{\sqrt{x^2+9}}\ dx$.

### Solution

Here $a = 3$, so let $x = 3 \tan \theta$. Then $dx = 3 \sec^2 \theta\ d\theta$ and $\sqrt{x^2+9} = 3 \sec \theta.$

Substitute and simplify: \begin{aligned} \int \dfrac{x^3}{\sqrt{x^2+9}}\ dx &= \int \dfrac{(3 \tan \theta)^3}{3 \sec \theta} \cdot 3 \sec^2 \theta \ d\theta\ &= \int 27 \tan^3 \theta \sec \theta \ d\theta \end{aligned}

Then look back again at what we did in the previous section: since the power of tangent is odd, we'll let $u=\sec \theta$, so that $du = \sec \theta \tan \theta \ d\theta$. Then we'll use the identity $\tan^2 \theta = \sec^2 \theta - 1$ to rewrite the remainder in terms of $\sec \theta$: \begin{aligned} \int 27 \tan^3 \theta \sec \theta \ d\theta &= \int 27 \tan^2 \theta \ \sec \theta \tan \theta \ d\theta\ &= \int 27 (\sec^2 \theta - 1) \sec \theta \tan \theta \ d\theta\ &= \int 27u^2 - 27 \ du\ &= 9u^3 - 27u + C\ &= 9\sec^3 \theta - 27 \sec \theta + C \end{aligned}

Finally, to get the answer in terms of $x$, notice that we found that $\sqrt{x^2+9} = 3 \sec \theta$ so $\sec \theta = \dfrac{\sqrt{x^2 + 9}}{3}$.

The answer, then, is $\int \dfrac{x^3}{\sqrt{x^2+9}}\ dx = 9\left(\dfrac{\sqrt{x^2 + 9}}{3}\right)^3 - 27 \left(\dfrac{\sqrt{x^2 + 9}}{3}\right) + C$

After a bit of simplification, we get $\ans{\dfrac{1}{3}(\sqrt{x^2+9})^3 - 9\sqrt{x^2+9} + C}$

## Case 3: $x= a \sec \theta$

When the integral involves $\sqrt{x^2-a^2}$, let $x=a\sec \theta$. Then $dx = a \sec \theta \tan \theta\ d\theta$ and \begin{aligned} \sqrt{x^2-a^2} &= \sqrt{a^2 \sec^2 \theta - a^2}\ &= a\sqrt{\sec^2 \theta - 1}\ &= a \sqrt{tan^2 \theta}\ &= a \tan \theta \end{aligned}

Evaluate $\displaystyle\int \dfrac{\sqrt{x^2-1}}{x}\ dx$.

### Solution

Since this fits the third case with $a=1$, let $x = \sec \theta$. Thus $dx = \sec \theta \tan \theta\ d\theta$ and $\sqrt{x^2-1} = \tan \theta.$

Substitute: \begin{aligned} \int \dfrac{\sqrt{x^2-1}}{x}\ dx &= \int \dfrac{\tan \theta}{\sec \theta} \cdot \sec \theta \tan \theta \ d\theta\ &= \int \tan^2 \theta \ d\theta \end{aligned}

To integrate this, replace $\tan^2 \theta$ with $\sec^2 \theta - 1$ and remember that $\int \sec^2 \theta \ d\theta = \tan \theta + C$ Thus \begin{aligned} \int \dfrac{\sqrt{x^2-1}}{x}\ dx &= \int \tan^2 \theta \ d\theta\ &= \int \sec^2 \theta - 1\ d\theta\ &= \tan \theta - \theta + C \end{aligned}

Finally, look back at the beginning of the problem, and you'll find that $\tan \theta = \sqrt{x^2-1} \textrm{ and } \theta = \sec^{-1} x$ so the final answer is $\int \dfrac{\sqrt{x^2-1}}{x}\ dx = \ans{\sqrt{x^2-1} - \sec^{-1} x + C}$

1. $\displaystyle\int x^3 \sqrt{9-x^2}\ dx$

2. Let $x=3 \sin \theta$. Then $dx=3\cos \theta \ d\theta$ and $\sqrt{9-x^2} = 3\cos \theta$. \begin{aligned} \int x^3 \sqrt{9-x^2}\ dx &= \int 27 \sin^3 \theta \cdot 3 \cos \theta \cdot 3 \cos \theta \ d\theta\ &= \int 243 \sin^3 \theta \cos^2 \theta \ d\theta\ &= \int 243 \sin^2 \theta \cos^2 \theta \sin \theta \ d\theta\ &= \int 243 (1 - \cos^2 \theta) \cos^2 \theta \sin \theta \ d\theta \end{aligned} Then let $u=\cos \theta$, so that $-du = \sin \theta\ d\theta$. \begin{aligned} \int 243 (1 - \cos^2 \theta) \cos^2 \theta \sin \theta \ d\theta &= \int -243 (1-u^2) u^2 \ du\ &= \int -243u^2 + 243u^4 \ du\ &= -81u^3 + \dfrac{243}{5}u^5 + C\ &= -81\cos^3 \theta + \dfrac{243}{5}\cos^5 \theta + C\ &= \ans{-3(\sqrt{9-x^2})^3 + \dfrac{1}{5}(\sqrt{9-x^2})^5 + C} \end{aligned}

3. $\displaystyle\int \dfrac{x^3}{\sqrt{x^2+100}}\ dx$

4. Let $x=10 \tan \theta$. Then $dx=10\sec^2 \theta \ d\theta$ and $\sqrt{x^2+100} = 10\sec \theta$. \begin{aligned} \int \dfrac{x^3}{\sqrt{x^2+100}}\ dx &= \int \dfrac{1000 \tan^3 \theta}{10 \sec \theta} \cdot 10\sec^2 \theta \ d\theta\ &= \int 1000 \tan^3 \theta \sec \theta \ d\theta\ &= \int 1000 \tan^2 \theta \sec \theta \tan \theta \ d\theta\ &= \int 1000 (\sec^2 \theta - 1) \sec \theta \tan \theta \ d\theta \end{aligned} Then let $u=\sec \theta$, so that $du = \sec \theta \tan \theta\ d\theta$. \begin{aligned} \int 1000 (\sec^2 \theta - 1) \sec \theta \tan \theta \ d\theta &= \int 1000 (u^2-1) \ du\ &= \dfrac{1000}{3}u^3 - 1000u + C\ &= \dfrac{1000}{3}\sec^3 \theta - 1000 \sec \theta + C\ &= \ans{\dfrac{1}{3}(\sqrt{x^2+100})^3 - 100 \sqrt{x^2+100} + C} \end{aligned}

5. $\displaystyle\int \dfrac{x^3}{\sqrt{16-x^2}}\ dx$

6. Let $x=4 \sin \theta$. Then $dx=4\cos \theta \ d\theta$ and $\sqrt{16-x^2} = 4\cos \theta$. \begin{aligned} \int \dfrac{x^3}{\sqrt{16-x^2}}\ dx &= \int \dfrac{64 \sin^3 \theta}{4 \cos \theta} \cdot 4 \cos \theta \ d\theta\ &= \int 64 \sin^3 \theta \ d\theta\ &= \int 64 \sin^2 \theta \sin \theta \ d\theta\ &= \int 64 (1 - \cos^2 \theta) \sin \theta \ d\theta \end{aligned} Then let $u=\cos \theta$, so that $-du = \sin \theta\ d\theta$. \begin{aligned} \int 64 (1 - \cos^2 \theta) \sin \theta \ d\theta &= \int -64 (1-u^2) \ du\ &= \int -64 + 64u^2 \ du\ &= -64u + \dfrac{64}{3}u^3 + C\ &= -64\cos \theta + \dfrac{64}{3}\cos^3 \theta + C\ &= \ans{-16\sqrt{16-x^2} + \dfrac{1}{3}(\sqrt{16-x^2})^3 + C} \end{aligned}

7. $\displaystyle\int x \sqrt{x^2+4}\ dx$

8. Let $x=2 \tan \theta$. Then $dx=2\sec^2 \theta \ d\theta$ and $\sqrt{x^2+4} = 2\sec \theta$. \begin{aligned} \int x \sqrt{x^2+4}\ dx &= \int 2\tan \theta \cdot 2 \sec \theta \cdot 2 \sec^2 \theta \ d\theta\ &= \int 8 \tan \theta \sec^3 \theta \ d\theta\ &= \int 8 \sec^2 \theta \sec \theta \tan \theta \ d\theta\ \end{aligned} Then let $u=\sec \theta$, so that $du = \sec \theta \tan \theta\ d\theta$. \begin{aligned} \int 8 \sec^2 \theta \sec \theta \tan \theta \ d\theta &= \int 8u^2 \ du\ &= \dfrac{8}{3}u^3 + C\ &= \dfrac{8}{3}\sec^3 \theta + C\ &= \ans{\dfrac{1}{3}(\sqrt{x^2+4})^3 + C} \end{aligned}