
## Section5.8Trigonometric Substitutions

###### Motivating Questions
• How does the method of trigonometric substitutions help us find antiderivatives of functions that may include expressions like $\sqrt{a^2-x^2}\text{,}$ $a^2 + x^2 \text{,}$ and $\sqrt{a^2 + x^2}$ where $a$ is any real number?

We've now studied three integration techniques: $u$-substitution, integration by parts, and the method of partial fractions. However, none of these may be used in situations involving rational functions with a single quadratic factor in the denominator like $\int \frac{1}{1+x^2} \, dx$ or when integrating many functions containing expressions like $\sqrt{a^2-x^2}\text{.}$

In this section, we'll study the technique of trigonometric substitution. You may wish to revisit Example5.54, further considering which integrals also cannot be evaluated using the method of partial fractions.

### SubsectionTrigonometric Substitutions

In Section5.5, we saw that certain integrals could be simplified considerably by making a $u$-substitution. Here, we'll see an extension of this idea that will allow us to compute some integrals which don't immediately appear amenable to traditional substitutions. Making a substitution of the form $x=\sin(\theta)$ or $x=\tan(\theta)$ and applying of one of the following trigonometric identities will be our modus operandi.

###### Key Trigonometric Identities
• Pythagorean Identity:

\begin{equation*} \sin^2(\theta) + \cos^2(\theta)=1 \end{equation*}
• Modified Pythagorean Identity:

\begin{equation*} \tan^2(\theta) + 1=\sec^2(\theta) \end{equation*}

(Note that this identity follows from the regular Pythagorean identity and dividing both sides by $\cos^2(\theta) \text{.}$)

First, let's look at the substitution $x=\sin(\theta)$ where $-\frac{\pi}{2}\leq \theta \leq \frac{\pi}{2}$ 8Example5.60 will show why we need these bounds on $\theta$ to see how it can be used to find the indefinite integral $\int \frac{1}{\sqrt{1-x^2}} \, dx\text{.}$

###### Example5.60

Use the substitution $x=\sin(\theta)$ where $-\frac{\pi}{2} \leq \theta \leq \frac{\pi}{2}$ to find the general antiderivative

\begin{equation*} \int \frac{1}{\sqrt{1-x^2}}\, dx. \end{equation*}

When using the substitution $x=\sin(\theta)$ where $-\frac{\pi}{2} \leq \theta \leq \frac{\pi}{2} \text{,}$ we are regarding $x$ as a function of $\theta \text{.}$ The goal is to change the integrand to contain trigonometric functions so that the Pythagorean Identity can be used. To do this, the integral will be changed to be in terms of the variable $\theta\text{.}$ With this in mind, both $x$ and $dx$ will need to be changed. Starting from $x=\sin(\theta) \text{,}$ take the derivative with respect to $\theta$ to find that

\begin{equation*} \frac{dx}{d\theta}=\cos(\theta) . \end{equation*}

In other words, $dx=\cos(\theta) \, d\theta \text{.}$ Now, change the original integral to be in terms of the variable $\theta \text{:}$

\begin{equation*} \int\frac{1}{\sqrt{1-x^2}}\, dx=\int \frac{\cos(\theta)}{\sqrt{1-\sin^2(\theta)}} \, d\theta \end{equation*}

Use the Pythagorean Identity, $1-\sin^2(\theta)=\cos^2(\theta)$ to simplify the denominator of the integrand:

\begin{equation*} \int \frac{\cos(\theta)}{\sqrt{1-\sin^2(\theta)}} \, d\theta = \int\frac{\cos(\theta)}{\sqrt{\cos^2(\theta)}} \, d \theta. \end{equation*}

Now we need to use the assumption that $-\frac{\pi}{2} \leq \theta \leq \frac{\pi}{2}\text{.}$ In general, $\sqrt{\cos^2(\theta)}=|\cos(\theta)|\text{,}$ but $\cos(\theta)\geq 0$ on the interval $-\frac{\pi}{2} \leq \theta \leq \frac{\pi}{2}\text{.}$ Thus, $|\cos(\theta)|=\cos(\theta)$ if $-\frac{\pi}{2} \leq \theta \leq \frac{\pi}{2} \text{.}$ The denominator can now be further simplified, and the remaining steps lead to a familar integral:

\begin{align*} \int\frac{\cos(\theta)}{\sqrt{\cos^2(\theta)}} \, d\theta \amp = \int\frac{\cos(\theta)}{|\cos(\theta)|} \, d\theta \\ \amp =\int\frac{\cos(\theta)}{\cos(\theta)} \, d\theta \\ \amp =\int 1 \, d\theta \\ \amp =\theta + C \end{align*}

While we have computed an antiderivative successfully, we aren't quite done yet because the answer is not written in terms of the original variable $x \text{.}$ Rearrange the substitution equation $x=\sin(\theta)$ to find that $\theta=\arcsin(x)$ and use this to turn $\theta$ back into a function of $x \text{.}$ Therefore,

\begin{equation*} \int\frac{1}{\sqrt{1-x^2}} \, dx= \arcsin(x) + C \end{equation*}

From now on, we'll usually omit the explanation that $\sqrt{\cos^2(\theta)}=|\cos(\theta)|=\cos(\theta)$ since we additionally assume that $-\frac{\pi}{2} \leq \theta \leq \frac{\pi}{2}$ in order to force $\cos(\theta) \geq 0 \text{.}$ It is still incredibly important so that the calculation of the antiderivative is seamless, but since we always assume that $-\frac{\pi}{2} \leq \theta \leq \frac{\pi}{2}$ the same reasoning always applies.

The substitution demonstrated in the previous example can be generalized to situations in which the integrand contains $a^2-x^2 \text{,}$ where $a$ is a real number and $x$ is a variable. In this case, setting $x = a\sin(\theta)$ results in the simplification $a^{2}-x^{2} = a^{2}(1-\sin^{2}(\theta))=a^{2}\cos^{2}(\theta) \text{.}$

###### Example5.61

In this example, we'll evaluate the definite integral $\int_{0}^{4} \sqrt{16-x^{2}} \,dx \text{.}$

1. Use a trigonometric substitution of the form $x = a\sin(\theta) \text{,}$ with $a$ a real number, to find an antiderivative of

\begin{equation*} \int \sqrt{16-x^{2}} \, dx. \end{equation*}

Leave the antiderivative in terms of $\theta \text{.}$

Hint

Use the substitution $x=4\sin(\theta)$ with $-\frac{\pi}{2} \leq \theta \leq \frac{\pi}{2} \text{.}$ The double angle formula $\cos^{2}(\theta) = \frac{1+\cos(2\theta)}{2}$ will be useful in evaluating the integral that results from this substitution.

With $x = 4\sin(\theta) \text{,}$ a general antiderivative in terms of $\theta$ is given by

\begin{equation*} 8\theta +4\sin(2\theta) + C \end{equation*}
Solution

Use the substitution $x=4\sin(\theta) \text{.}$ Then $x^2=16\sin^2(\theta)$ and $dx=4\cos(\theta) d\theta \text{.}$ So

\begin{align*} \int \sqrt{16-x^{2}} \, dx \amp = \int \sqrt{16-16\sin^2(\theta)}\cdot 4\cos(\theta) \, d\theta \\ \amp = \int \sqrt{16(1-\sin^2(\theta))}\cdot 4\cos(\theta) \, d\theta \\ \amp = \int \sqrt{16\cos^2(\theta)}\cdot 4\cos(\theta) \, d\theta\\ \amp = \int 4\cos(\theta) \cdot 4\cos(\theta) \, d\theta\\ \amp = 16\int \cos^{2}(\theta) \, d\theta \end{align*}

From the hint, we may write $\cos^{2}(\theta) = \frac{1+\cos(2\theta)}{2} \text{.}$ Thus,

\begin{align*} 16\int \cos^{2}(\theta) \, d\theta \amp = 16\int\frac{1+\cos(2\theta)}{2} \, d\theta \\ \amp = 8 \int 1+\cos(2\theta) \,d \theta \\ \amp = 8(\theta+\frac{1}{2}\sin(2\theta))+C \\ \amp = 8\theta+4\sin(2\theta)+C \end{align*}
2. Using the solution to part (a), evaluate the definite integral $\int_{0}^{4} \sqrt{16-x^{2}} \,dx$ by writing the bounds of integration in terms of $\theta \text{.}$

Hint

To rewrite the bounds in terms of $\theta \text{,}$ solve the equations $0 = 4 \sin(\theta)$ and $4 = 4 \sin(\theta)$ for $\theta \in [-\pi/2, \pi/2] \text{.}$

\begin{equation*} \int_{0}^{4} \sqrt{16-x^{2}} \,dx = 4 \pi \end{equation*}
Solution

Using $x = 4\sin(\theta) \text{,}$ when $x = 0$ we must have $0 = 4\sin(\theta) \text{,}$ which implies $\theta = 0$ (recall $-\pi /2 \leq \theta \leq \pi/2$). Similarly, when $x = 4$ we have $4=4\sin(\theta) \text{,}$ which has solution $\theta = \pi/2.$

Thus, using part (a), we may write

\begin{align*} \int_{0}^{4} \sqrt{16-x^{2}} \,dx \amp = \left. 8\theta+4\sin(2\theta) \right|_{0}^{\pi/2} \\ \amp = 4\pi+4\sin(\pi)-(0+4\sin(0)) \\ \amp = 4\pi \end{align*}

It is worth noting that the curve $y = \sqrt{16-x^{2}}$ for $0 \leq x \leq 4$ is the part of the circle of radius $4$ centered at the origin which lies in the first quadrant of the plane. The definite integral $\int_{0}^{4} \sqrt{16-x^{2}} \,dx$ thus gives the area of the part of this circle which lies in the first quadrant. Since the circle in question has total area $16 \pi$ and the portion in the first quadrant compirese precisely $1/4$ of the total area, we are assured our solution of $4\pi$ is correct.

###### Example5.62

Use a trigonometric substitution to find the indefinite integral

\begin{equation*} \int \frac{1}{\sqrt{9-4x^2}} \, dx. \end{equation*}
Hint

Notice that $\sqrt{9-4x^2}=\sqrt{9-(2x)^2}\text{,}$ so we'll want to replace $2x$ by an appropriate trigonometric function.

\begin{equation*} \int \frac{1}{\sqrt{9-4x^2}} \, dx=\frac{1}{2} \arcsin \left(\frac{2x}{3}\right) + C \end{equation*}
Solution

Compared to the first example, where the substitution $x=\sin(\theta)$ worked, we'll need to make two adjustments so that we can still use Pythagoren's Identity. Since $\sqrt{9-4x^2}=\sqrt{9-(2x)^2}\text{,}$ we'll want to substitute $2x=3\sin(\theta)$ so that we can factor out the 9 and obtain the expression $1-\sin^2(\theta) \text{.}$ Assuming $2x=3\sin(\theta)$ then $(2x)^2=9 \sin^2(\theta)$ and $2 dx=3 \cos(\theta)d\theta\text{.}$

\begin{align*} \int \frac{1}{\sqrt{9-4x^2}} \, dx \amp = \int \frac{1}{\sqrt{9-(2x)^2}} \, dx\\ \amp = \int \frac{1}{\sqrt{9-(2x)^2}} \, dx\\ \amp = \int \frac{(3/2)\cos(\theta)}{\sqrt{9-9\sin^2(\theta)}} \, d\theta\\ \amp = \frac{3}{2}\int \frac{\cos(\theta)}{\sqrt{9(1-\sin^2(\theta))}} \, d\theta\\ \amp = \frac{3}{2}\int \frac{\cos(\theta)}{3\sqrt{\cos^2(\theta)}} \, d\theta\\ \amp = \frac{3}{2}\int \frac{\cos(\theta)}{3\cos(\theta)} \, d\theta\\ \amp = \frac{3}{6}\int 1 \, d\theta\\ \amp = \frac{1}{2}\theta+ C \ \end{align*}

We can solve for $\theta$ in our substitution equation to find that the antiderivative is:

\begin{equation*} \int \frac{1}{\sqrt{9-4x^2}} \, dx=\frac{1}{2} \arcsin\left(\frac{2x}{3} \right) + C \end{equation*}

Note that we could have also computed the integral above using a $u$-substitution and the fact that $\int \frac{1}{\sqrt{1-x^{2}}} \, dx = \arcsin(x)+C \text{.}$ What is the right choice for $u$ in this substitution?

###### Example5.63

Find the antiderivative

\begin{equation*} \int \frac{9}{(9-x^2)^{3/2}} \, dx \end{equation*}
Hint

Use the substitution $x=3\sin(\theta)$ and treat $(9-x^2)^{3/2}$ as $((9-x^2)^{1/2})^3 \text{.}$

$\int \frac{9}{(9-x^2)^{3/2}} \, dx=\dfrac{x}{9-x^2} + C$

Solution

Use the substitution $x=3\sin(\theta) \text{.}$ Then $x^2=9\sin^2(\theta)$ and $dx=3\cos(\theta) d\theta\text{.}$ As stated in the hint, we'll use that $(9-x^2)^{3/2}=((9-x^2)^{1/2})^3$ and simplify the inner most set of parentheses before cubing.

\begin{align*} \int \frac{9}{(9-x^2)^{3/2}} \, dx \amp = \int \frac{9\cdot 3\cos(\theta)}{(9-9\sin^2(\theta))^{3/2}} \, d\theta \\ \amp = 27\int \frac{\cos(\theta)}{(9(1-\sin^2(\theta)))^{3/2}} \, d\theta \\ \amp = 27\int \frac{\cos(\theta)}{9^{3/2}((1-\sin^2(\theta))^{1/2})^3} \, d\theta \\ \amp = \frac{27}{27}\int \frac{\cos(\theta)}{((\cos^2(\theta))^{1/2})^3} \, d\theta \\ \amp =\int \frac{\cos(\theta)}{(\cos(\theta))^3} \, d\theta \\ \amp =\int \frac{1}{\cos^2(\theta)} \, d\theta \\ \amp = \tan(\theta) + C \end{align*}

When we solve for $\theta$ and replace it with a function of $x \text{,}$ we obtain

\begin{equation*} \int \frac{9}{(9-x^2)^{3/2}} \, dx = \tan(\arcsin(x/3)) + C \text{.} \end{equation*}

In other words, the general antiderivative is the tangent of the angle whose sine is $\frac{x}{3}$. To simplify this expression, we can look at a right triangle that has $\theta$ as one of its angles and use some trigonometry. Since $\sin(\theta) = \frac{x}{3} \text{,}$ we'll assume that the hypotenuse has length 3 and the side opposite the angle $\theta$ has length $x \text{.}$ The missing side length is found by using Pythagorean's Theorem. Then using this right triangle, we find that $\tan(\theta)=\frac{x}{\sqrt{9-x^2}} \text{.}$ Therefore,

\begin{equation*} \int \frac{9}{(9-x^2)^{3/2}} \, dx = \frac{x}{\sqrt{9-x^2}} + C \end{equation*}

We summarize the substitution $x = a \sin(\theta)$ below.

###### Trigonometric Substitution: $u=a\sin(\theta)$

The substitution $u=a\sin(\theta)$ where $u$ is some function of $x \text{,}$ $a$ is a real number, and $-\frac{\pi}{2} \leq \theta \leq \frac{\pi}{2}$ is often helpful when the integrand contains an expression of the form $a^2-u^2 \text{.}$ When this substitution is used, then $u^2=a^2\sin^2(\theta)$ and after factoring out $a^2 \text{,}$ the Pythagorean Identity 9$1-\sin^2(\theta)=\cos^2(\theta)$ can be used to simplify part of the integrand:

\begin{equation*} a^2-u^2=a^2-a^2\sin^2(\theta)=a^2(1-\sin^2(\theta))=a^2\cos^2(\theta) \text{.} \end{equation*}

Since we assumed $-\frac{\pi}{2} \leq \theta \leq \frac{\pi}{2} \text{,}$ then $\cos (\theta) \geq 0 \text{.}$ This implies that $\sqrt{\cos^2(\theta)}=|\cos(\theta)|=\cos(\theta) \text{.}$

Another important trigonometric substitution is $x=\tan(\theta)$ where $-\frac{\pi}{2} < \theta < \frac{\pi}{2}\text{.}$ This substitution can be used to show that $\int \frac{1}{1+x^2} \, dx= \arctan(x) + C \text{.}$

###### Example5.65

Use the trigonometric substitution $x=\tan(\theta)$ to find the antiderivative

\begin{equation*} \int \frac{1}{1+x^2} \, dx \text{.} \end{equation*}
Hint

Proceed in a manner analogous to Example5.60.

\begin{equation*} \int \frac{1}{1+x^2} \, dx = \arctan(x)+C \end{equation*}
Solution

When using the substitution $x=\tan(\theta)$ where $-\frac{\pi}{2} < \theta < \frac{\pi}{2} \text{,}$ we are regarding $x$ as a function of $\theta \text{.}$ The goal is to change the integrand to contain trigonometric functions so that a modified version of the Pythagorean Identity can be used. The version of the Pythagorean Identity we will use when simplifying after a tangent substitution is $\tan^2(\theta) + 1 =\sec^2(\theta) \text{.}$ To achieve this goal, the integral will be changed to be in terms of the variable $\theta\text{.}$ With this in mind, both $x$ and $dx$ will need to be changed. Starting from $x=\tan(\theta) \text{,}$ take the derivative with respect to $\theta$ to find that

\begin{equation*} \frac{dx}{d\theta}=\sec^2(\theta) . \end{equation*}

In other words, $dx=\sec^2(\theta) \, d\theta \text{.}$ Now, change the original integral to be in terms of the variable $\theta \text{:}$

\begin{equation*} \int\frac{1}{1+x^2}\, dx=\int \frac{\sec^2(\theta)}{1+\tan^2(\theta)} \, d\theta \end{equation*}

Use a modified version of the Pythagorean Identity, $1+\tan^2(\theta)=\sec^2(\theta)$ to simplify the denominator of the integrand:

\begin{equation*} \int \frac{\sec^2(\theta)}{1+\tan^2(\theta)} \, d\theta = \int\frac{\sec^2(\theta)}{\sec^2(\theta)} \, d \theta. \end{equation*}

The integrand can now be further simplified, and the remaining steps lead to a familar antiderivative:

\begin{align*} \int\frac{\sec^2(\theta)}{\sec^2(\theta)} \, d \theta&= \int 1 \, d \theta\\ &=\theta + C \end{align*}

While we have computed an antiderivative successfully, we aren't quite done yet because the answer is not written in terms of the original variable $x \text{.}$ Rearrange the substitution equation $x=\tan(\theta)$ to find that $\theta=\arctan(x)$ and use this to turn $\theta$ back into a function of $x \text{.}$ Therefore,

\begin{equation*} \int\frac{1}{1+x^2} \, dx= \arctan(x) + C \end{equation*}

Just as the substition $x = a\sin(\theta)$ can be useful when $a^{2}-x^{2}$ appears in the integrand, $x = a \tan(\theta)$ may be the right substitution when dealing with terms involving $a^{2}+x^{2} \text{.}$ The following examples will explore this idea.

###### Example5.66

Use a trigonometric substitution to find the antiderivative

\begin{equation*} \int \frac{1}{x^{2}\sqrt{4 + x^{2}}} \, dx \text{.} \end{equation*}
Hint

Try the substitution $x=2\tan(\theta) \text{.}$ The integral that results from this substitution may require a $u$-substitution to compute.

\begin{equation*} \int \frac{1}{x^{2}\sqrt{4 + x^{2}}} \, dx = -\frac{\sqrt{4+x^{2}}}{4x}+C. \end{equation*}
Solution

Set $x=2\tan(\theta) \text{,}$ so that $dx=2\sec^2(\theta) d\theta\text{.}$ Since $x^{2}=4\tan^{2}(\theta) \text{,}$ we get

\begin{align*} \int \frac{1}{x^{2}\sqrt{4 + x^2}} \, dx \amp= \int \frac{2\sec^2(\theta)}{4\tan^{2}(\theta)\sqrt{4 + 4\tan^2(\theta)}} \, d \theta\\ \amp= \int \frac{2\sec^2(\theta)}{4\tan^{2}(\theta)\cdot 2\sec(\theta)} \, d \theta\\ \amp= \frac{1}{4}\int \frac{\sec(\theta)}{\tan^{2}(\theta)} \, d \theta \end{align*}

Since $\tan(\theta)=\frac{\sin(\theta)}{\cos(\theta)}$ and $\sec(\theta) = \frac{1}{\cos(\theta)} \text{,}$ we have

\begin{equation*} \frac{\sec(\theta)}{\tan^{2}(\theta)}=\frac{\cos^{2}(\theta)}{\sin^{2}(\theta)}\frac{1}{\cos(\theta)}=\frac{\cos(\theta)}{\sin^{2}(\theta)}. \end{equation*}

The integral $\frac{1}{4}\int \frac{\cos(\theta)}{\sin^{2}(\theta)}\, d\theta$ can be evaluated via yet another substitution---this time, a $u$-substitution in which we set $u = \sin(\theta).$ Then $du = \cos(\theta) d\theta \text{.}$ Finally,

\begin{align*} \frac{1}{4}\int \frac{\cos(\theta)}{\sin^{2}(\theta)}\, d\theta \amp = \frac{1}{4}\int\frac{1}{u^{2}}\,du \\ \amp = -\frac{1}{4u}+C \end{align*}

Substituting back for $u \text{,}$ we reach $-\frac{1}{4u} = -\frac{1}{4\sin(\theta)}=-\frac{\csc(\theta)}{4} \text{.}$

Now, one may establish a right triangle relating the angle $\theta$ and the variable $x \text{,}$ just as in Example5.63. Doing this yields $\sin(\theta) = \frac{x}{\sqrt{4+x^{2}}} \text{,}$ and thus $-\frac{\csc(\theta)}{4} = -\frac{\sqrt{4+x^{2}}}{4x}.$ We conclude $\int \frac{1}{x^{2}\sqrt{4 + x^{2}}} \, dx = -\frac{\sqrt{4+x^{2}}}{4x}+C.$

In the following example, we'll see why it is important that we restrict $\theta$ to be in the interval $-\frac{\pi}{2} < \theta < \frac{\pi}{2}$ when we use a tangent substitution.

###### Example5.67
1. Use a trigonometric substitution to find the integral

\begin{equation*} \int \frac{3x}{\sqrt{25+9x^2}} \, dx \text{.} \end{equation*}
Hint

The expression $25 + 9x^2$ can be rewritten as $5^2+(3x)^2$ so that it looks like $u^2+a^2\text{.}$ Try the substitution $3x=5\tan(\theta) \text{.}$

\begin{equation*} \int \frac{3x}{\sqrt{25+9x^2}} \, dx =\frac{1}{3} \sqrt{9x^2+25} + C \end{equation*}
Solution

The expression $25 + 9x^2$ can be rewritten as $5^2+(3x)^2$ so that it looks like $u^2+a^2\text{.}$ The substitution $3x=5\tan(\theta)$ will allow us to use the modified Pythagorean Identity. Then $(3x)^2=25\tan^2(\theta)$ and $dx=\frac{5}{3} \sec^2(\theta) d\theta \text{.}$ The original integral can be transformed using this substitution:

\begin{align*} \int \frac{3x}{\sqrt{25+9x^2}} \, dx &= \frac{5}{3}\int \frac{5\tan(\theta)\sec^2(\theta)}{\sqrt{25+25\tan^2(\theta)}} \, d\theta \\ &= \frac{25}{3}\int \frac{\tan(\theta)\sec^2(\theta)}{\sqrt{25(1+\tan^2(\theta)}} \, d\theta \\ &= \frac{25}{3}\int \frac{\tan(\theta)\sec^2(\theta)}{\sqrt{25\sec^2(\theta)}} \, d\theta \\ &= \frac{25}{3}\int \frac{\tan(\theta)\sec^2(\theta)}{\sqrt{25}\sqrt{\sec^2(\theta)}} \, d\theta \end{align*}

We must be careful at this step when we simplify $\sqrt{\sec^2(\theta)}\text{.}$ Because we chose $-\frac{\pi}{2} < \theta < \frac{\pi}{2} \text{,}$ then $\sec^2(\theta) \geq 1 \geq 0 \text{.}$ Notice that if we had picked a different interval for $\theta \text{,}$ $\sec(\theta)$ could be negative and then we would have to introduce an absolute value in order for the square root to be defined. Since we know $\sec^2(\theta) \geq 1\geq 0$ on the interval of $\theta$ we care about then $\sqrt{\sec^2(\theta)}=\sec(\theta)\text{.}$ Therefore, the integral simplifies further:

\begin{align*} \frac{25}{3}\int \frac{\tan(\theta)\sec^2(\theta)}{\sqrt{25}\sqrt{\sec^2(\theta)}} \, d\theta &= \frac{5}{3} \int \frac{\tan(\theta) \sec^2(\theta) }{\sec(\theta)} \, d \theta \\ &= \frac{5}{3} \int \tan(\theta)\sec(\theta) \, d \theta \\ &=\frac{5}{3} \sec(\theta) + C \\ &= \frac{5}{3} \sec\left(\arctan\left(\frac{3x}{5} \right)\right) + C \end{align*}

This answer can be simplified to a more recognizable form by using a right triangle with angle $\theta$ and $\tan(\theta)=\frac{3x}{5} \text{,}$ and finding $\sec(\theta)$ by using the triangle.

Thus

\begin{align*} \int \frac{3x}{\sqrt{25+9x^2}} \, dx &=\frac{5}{3} \sec\left(\arctan\left(\frac{3x}{5} \right)\right) + C\\ &= \frac{5}{3} \cdot \frac{\sqrt{9x^2+25}}{5} + C\\ &=\frac{1}{3} \sqrt{9x^2+25} + C \end{align*}
2. A trigonometric substitution was not necessary to find the antiderivative in part (a). In fact, only a standard $u$-subsitution was needed. Verify the answer from part (a) using the method of $u$-substitution.

Hint

The expressions $3x$ and $9x^2 + 25$ are nearly a function-derivative pair.

\begin{equation*} \int \frac{3x}{\sqrt{25+9x^2}} \, dx =\frac{1}{3} \sqrt{9x^2+25} + C \end{equation*}
Solution

Use the substitution $u=9x^2 + 25$ with $du=18x dx$ to change the original integral.

\begin{align*} \int \frac{3x}{\sqrt{25+9x^2}} \, dx &= \frac{1}{6} \int u^{-1/2} \, du \\ &= \frac{1}{6} \cdot \frac{u^{1/2}}{1/2} + C\\ &= \frac{1}{3} \sqrt{9x^2+25} + C \end{align*}

In our study of the method of partial fractions, we saw how to deal with rational functions whose denominators could be factored into smaller degree pieces. What if the denominator cannot be factored, as is the case with $\frac{1}{x^2+4x+13}\text{?}$

If we complete the square in the denominator to recognize it as $(x-a)^{2}+b$ where $a$ and $b$ are real numbers, then substitution becomes feasible. (For more on completing the square, see the relevant section in the Precalculus Textbook).

###### Example5.69

Find the integral

\begin{equation*} \int \frac{1}{x^2+4x+13} \, dx\text{.} \end{equation*}
Hint

Completing the square in the denominator gives

\begin{equation*} \frac{1}{x^2+4x+13}=\frac{1}{(x+2)^2 + 9} \end{equation*}
\begin{equation*} \int \frac{1}{x^2+4x+13} \, dx= \frac{1}{3} \arctan\left(\frac{x+2}{3} \right) + C \end{equation*}
Solution

To complete the square in the denominator, we need to add and substract $4$ so that we can factor a portion of the expression into a linear term that is squared:

\begin{equation*} \frac{1}{x^2+4x+13}=\frac{1}{x^2+4x+4-4+13}=\frac{1}{(x+2)^2+9} \end{equation*}

Now, use the $u$-substitution $u=x+2 \ , du=dx \text{.}$

\begin{equation*} \int \frac{1}{(x+2)^2+9} \, dx = \int \frac{1}{u^2+9} \, du \end{equation*}

Use the tangent subsitution10We could also factor out $9$ from the denominator and use a substitution with $w=\frac{x+2}{3}$ as demonstrated in Example5.66. $u=3\tan(\theta) \text{,}$ so $u^2=9\tan^2(\theta)$ and $du=3\sec^2(\theta) \, d\theta \text{.}$

\begin{align*} \int \frac{1}{u^2+9} \, du&= \int \frac{3\sec^2(\theta)}{9\tan^2(\theta) +9 }\, d \theta \\ &= 3\int \frac{\sec^2(\theta)}{9(\tan^2(\theta) +1) }\, d \theta \\ &= \frac{3}{9}\int \frac{\sec^2(\theta)}{\sec^2(\theta) }\, d \theta \\ &= \frac{1}{3}\int 1 \, d \theta \\ &= \frac{1}{3} \theta + C\\ &= \frac{1}{3} \arctan\left(\frac{u}{3} \right) + C \\ &= \frac{1}{3} \arctan\left(\frac{x+2}{3} \right) + C \end{align*}

###### Trigonometric Substitution: $u=a\tan(\theta)$

The substitution $u=a\tan(\theta)$ where $u$ is some function of $x \text{,}$ $a$ is a real number, and $-\frac{\pi}{2} < \theta < \frac{\pi}{2}$ is often helpful when the integrand contains an expression of the form $a^2+u^2 \text{.}$ When this substitution is used, then $u^2=a^2\tan^2(\theta)$ and after factoring out $a^2 \text{,}$ the modified Pythagorean Identity 11$1+\tan^2(\theta)=\sec^2(\theta)$ can be used to simplify part of the integrand:

\begin{equation*} a^2+u^2=a^2+a^2\tan^2(\theta)=a^2(1+\tan^2(\theta))=a^2\sec^2(\theta) \text{.} \end{equation*}

Since we assumed $-\frac{\pi}{2} < \theta < \frac{\pi}{2} \text{,}$ then $\sec (\theta) \geq 1\geq 0 \text{.}$ This implies that $\sqrt{\sec^2(\theta)}=|\sec(\theta)|=\sec(\theta) \text{.}$

###### Example5.70

Find the following antiderivatives using a trigonometric substitution or some other method.

1. $\int \frac{3}{(9x^2+1)^{3/2}} \, dx$

2. $\int \frac{1}{x^2\sqrt{5-x^2}} \, dx$

3. $\int \frac{\sqrt{25-9x^2}}{9x^2} \, dx$

4. $\int \frac{2x+7}{x^2+6x+18} \, dx$

Hint
1. There is a sum of squares, $9x^2 + 1 =(3x)^2+1^2 \text{,}$ so a tangent substitutuion is likely to help.

2. There is a difference of squares since $5-x^2=(\sqrt{5})^2-x^2\text{,}$ so a sine substitution is likely to help.

3. There is a difference of squares starting with a constant term $25-9x^2=5^2-(3x)^2 \text{,}$ so a sine substitution is likely to help.

4. First, complete the square in the denominator. Then, split the integrand into two rational expressions and use different methods for each of the resulting rational expressions.

1. \begin{equation*} \int \frac{3}{(9x^2+1)^{3/2}} \, dx = \frac{3x}{\sqrt{9x^2+1}} + C \end{equation*}
2. \begin{equation*} \int \frac{1}{x^2\sqrt{5-x^2}} \, dx =\frac{-\sqrt{5-x^2}}{5x} + C \end{equation*}
3. \begin{equation*} \int \frac{\sqrt{25-9x^2}}{9x^2} \, dx=- \frac{\sqrt{25x^2-9}}{9x} - \frac{1}{3} \arcsin\left(\frac{3x}{5} \right) + C\ \end{equation*}
4. \begin{equation*} \int \frac{2x+7}{x^2+6x+18} \, dx= \ln|x^2+6x+18| + \frac{4}{3}\arctan\left(\frac{x+3}{3} \right) + C \end{equation*}
Solution
1. Use the substitution $3x=\tan(\theta) \text{,}$ so $(3x)^2=9x^2=\tan^2(\theta)$ and $3dx=\sec^2(\theta)d\theta \text{.}$ We can transform the orignal integral using this substitution:

\begin{align*} \int \frac{3}{(9x^2+1)^{3/2}} \, dx&=\int \frac{\sec^2(\theta)}{(\tan^2(\theta)+ 1)^{3/2}} \, d \theta\\ &=\int \frac{\sec^2(\theta)}{(\sec^2(\theta))^{3/2}} \, d \theta\\ &=\int \frac{\sec^2(\theta)}{\sec^3(\theta)} \, d \theta\\ &=\int \cos(\theta) \, d \theta\\ &=\sin(\theta) + C \end{align*}

To find the antiderivative in terms of $x\text{,}$ consider a right triangle with angle $\theta$ and $\tan(\theta)=3x\text{.}$

From the triangle, we can see that $\sin(\theta)=\frac{3x}{\sqrt{9x^2+1}} \text{,}$ so

\begin{equation*} \int \frac{3}{(9x^2+1)^{3/2}} \, dx=\frac{3x}{\sqrt{9x^2+1}} + C \end{equation*}
2. Use the substitution $x=\sqrt{5} \sin(\theta) \text{,}$ then $x^2=5\sin^2(\theta)$ and $dx=\sqrt{5} \cos(\theta) d\theta\text{.}$

\begin{align*} \int \frac{1}{x^2\sqrt{5-x^2}} \, dx&=\int \frac{\sqrt{5}\cos(\theta)}{5\sin^2(\theta) \sqrt{5-5\sin^2(\theta)}} \, d\theta\\ &=\int \frac{\sqrt{5}\cos(\theta)}{5\sin^2(\theta) \sqrt{5\cos^2(\theta)}} \, d\theta\\ &=\frac{\sqrt{5}}{5\sqrt{5}}\int \frac{\cos(\theta)}{\sin^2(\theta) \cos(\theta) } \, d\theta\\ &=\frac{1}{5}\int \frac{1}{\sin^2(\theta)} \, d\theta\\ &=-\frac{1}{5}\cot(\theta) + C \end{align*}

Use a right triangle with one angle measuring $\theta$ and with $\sin(\theta)=\frac{x}{\sqrt{5}}$ to find the antiderivative with respect to $x \text{.}$

We can see from the triangle that $\cot(\theta)=\frac{\sqrt{5-x^2}}{x}\text{.}$ Therefore,

\begin{equation*} \int \frac{1}{x^2\sqrt{5-x^2}} \, dx =\frac{-\sqrt{5-x^2}}{5x} + C \end{equation*}
3. Use the substitution $3x=5\sin(\theta) \text{,}$ then $9x^2=25\sin^2(\theta)$ and $3dx=5\cos(\theta) d\theta \text{.}$

\begin{align*} \int\frac{\sqrt{25-9x^2}}{9x^2} \, dx &= \int \frac{\sqrt{25-25\sin^2(\theta)}}{25\sin^2(\theta)} \frac{5}{3} \cos(\theta) \, d\theta \\ &= \int \frac{25\cos^2(\theta)}{75\sin^2(\theta)} \, d\theta \\ &= \frac{1}{3}\int \frac{1-\sin^2(\theta)}{\sin^2(\theta)} \, d\theta \\ &= \frac{1}{3}\int \frac{1}{\sin^2(\theta)} \, d\theta - \frac{1}{3} \int 1 \, d\theta \\ &= -\frac{1}{3}\cot(\theta) -\frac{1}{3} \arcsin(\theta) + C \end{align*}

Use a right triangle with one angle measuring $\theta$ and with $\sin(\theta) =\frac{3x}{5}$ to find $\cot(\theta) \text{:}$

From the triangle, we can see that $\cot(\theta)=\frac{\sqrt{25-9x^2}}{3x} \text{.}$ Therefore,

\begin{equation*} \int\frac{\sqrt{25-9x^2}}{9x^2} \, dx= -\frac{\sqrt{25-9x^2}}{9x} -\frac{1}{3}\arcsin\left(\frac{3x}{5} \right) + C \end{equation*}
4. \begin{align*} \int \frac{2x+7}{x^2+6x+18} \, dx&=\int \frac{2x+ 7}{(x+3)^2+9} \, dx \\ \text{use the substitution } u=x+3 &\qquad du=dx \\ &=\int \frac{2(u-3)+ 7}{u^2+9} \, dx \\ &=\int \frac{2u}{u^2+9} \, du + \int \frac{4}{u^2+9} \, du \end{align*}

To integrate $\int \frac{2u}{u^2+9} \, du\text{,}$ use the substitution $w=u^2+9$ and $dw= 2u \, du\text{.}$ Thus,

\begin{align*} \int \frac{2u}{u^2+9} \, du&=\int \frac{1}{w} \, dw\\ &=\ln|w| + C_1\\ &=\ln|(x+3)^2 + 9| + C_1 \end{align*}

To integrate $\int \frac{4}{u^2+9} \, du \text{,}$ we can use a trigonometric substitution or we can factor out the 9, use the substitution $v=w/3 \text{ and }dv=dw/3$ and use the antidifferentiation rule $\int\frac{1}{1+u^2} \, du=\arctan(u) + C\text{.}$ The latter method will be shown:

\begin{align*} \int \frac{4}{u^2+9} \, du &=\frac{4}{9} \int \frac{1}{(u/3)^2 + 1} \, du\\ &=\frac{4}{3} \int \frac{1}{v^2 + 1} \, dv\\ &=\frac{4}{3} \arctan(v) + C_2 \\ &=\frac{4}{3} \arctan\left(\frac{x+3}{3}\right) + C_2 \end{align*}

Therefore,

\begin{equation*} \int \frac{2x+7}{x^2+6x+18} \, dx= \ln|(x+3)^2 + 9| + \frac{4}{3} \arctan\left(\frac{x+3}{3}\right) + C \end{equation*}

### SubsectionSummary

• Trigonometric substitutions of the form $u=\sin(x)\text{,}$ $u=\tan(x)\text{,}$ or variants thereof let us find integrals like $\int \frac{1}{\sqrt{1-x^2}} dx\text{,}$ $\int \frac{1}{1+x^2} dx\text{,}$ and $\int \frac{1}{\sqrt{1-x^2}} \, dx \text{.}$ A tangent-based substitution is essential for finding integrals of the form $\frac{Bx+C}{t(x)}$ where $t(x)$ is an irreducible quadratic.

### SubsectionExercises

Use a trigonometric substitution to find the following indefinite integrals:
1. $\int \frac{1}{\sqrt{25-x^2}} dx$

2. $\int \frac{1}{1+4x^2} dx$

3. $\int \frac{1}{\sqrt{25-4x^2}} dx$

4. $\int \frac{1}{7+9x^2} dx$

Use any method or combination of methods to find the following indefinite integrals:
1. $\int \frac{1+x}{1+x^2} dx$

2. $\int \frac{x^2+4x+1}{x^3+x} dx$

3. $\int \frac{1}{x^2+6x+10} dx$

4. $\int \frac{e^x}{e^{2x}+1} dx$