Skip to main content

Section 6.5 Trigonometric Integrals

In this section, we continue analyzing integrals involving trigonometric functions. In particular, we consider integrals involving higher powers and products of trigonometric functions.

Subsection 6.5.1 Powers of Sine and Cosine

Recall that previously, we did the integrals \(\int \sin^2{x} \,dx\) and \(\int \cos^2{x} \,dx\) using the power-reducing identities (Integrals of Sine and Cosine Squared). We can also evaluate integrals of higher powers of sine and cosine. We’ll start with the next higher power, \(\int \sin^3{x} \,dx\) and \(\int \cos^3{x} \,dx\text{,}\) and then move on to the 4th power, and then the general case.

Example 6.5.1. 3rd Power of Cosine.

Evaluate \(\int \cos^3{x} \,dx\text{.}\)
Solution.
It turns out that we would like to make a substitution, either \(u = \cos{x}\text{,}\) or \(u = \sin{x}\text{.}\) Notice that if we separate out one factor of \(\cos{x}\) to the right,
\begin{align*} \int \cos^3{x} \,dx \amp= \int \cos^2{x} \cdot \cos{x} \,dx \end{align*}
Then, we can use the Pythagorean identity \(\cos^2{x} = 1 - \sin^2{x}\) to rewrite \(\cos^2{x}\) in terms of sine,
\begin{align*} \amp= \int (1 - \sin^2{x}) \cdot \cos{x} \,dx \end{align*}
Then, the substitution \(u = \sin{x}\) gives \(du = \cos{x} \,dx\text{,}\) and \(\cos{x} \,dx\) is perfectly there on the right side to be replaced by \(du\text{.}\) Then,
\begin{align*} \amp= \int (1 - u^2) \,du\\ \amp= u - \frac{1}{3}u^3 + C\\ \amp= \sin{x} - \frac{1}{3}\sin^3{x} + C \end{align*}
Therefore,
\begin{equation*} \boxed{\int \cos^3{x} \,dx = \sin{x} - \frac{1}{3}\sin^3{x} + C} \end{equation*}

Example 6.5.2. 3rd Power of Sine.

Evaluate \(\int \sin^3{x} \,dx\text{.}\)
Solution.
We can use a technique similar to \(\int \cos^3{x} \,dx\text{.}\) Separate out one factor of \(\sin{x}\text{,}\) and then use the Pythagorean identity \(\sin^2{x} = 1 - \cos^2{x}\) to rewrite \(\sin^2{x}\) in terms of cosine,
\begin{align*} \int \sin^3{x} \,dx \amp= \int (1 - \cos^2{x}) \sin{x} \,dx \end{align*}
Then, \(u = \cos{x}\text{,}\) \(du = -\sin{x} \,dx\) gives,
\begin{align*} \amp= \int (1 - u^2) (-\,du)\\ \amp= \int (u^2 - 1) \,du\\ \amp= \frac{1}{3}u^3 - u + C\\ \amp= \frac{1}{3}\cos^3{x} - \cos{x} + C \end{align*}
Therefore,
\begin{equation*} \boxed{\int \sin^3{x} \,dx = \frac{1}{3}\cos^3{x} - \cos{x} + C} \end{equation*}

Example 6.5.3. 4th Power of Cosine.

Evaluate \(\int \cos^4{x} \,dx\text{.}\)
Solution.
Here, the previous technique will not work, because if we separate out one factor of \(\cos{x}\text{,}\) then we will be left with \(\cos^3{x}\text{,}\) which we can’t convert to sine using \(\cos^2{x} = 1 - \sin^2{x}\text{.}\)
Instead, it turns out the correct technique is similar to the one we used to evaluate \(\int \cos^2{x} \,dx\text{,}\) which is to use the power-reducing identity. First, we can write \(\cos^4{x}\) as \(\brac{\cos^2{x}}^2\text{,}\) and then use the power-reducing identity for \(\cos^2{x}\text{,}\)
\begin{align*} \cos^4{x} = \brac{\cos^2{x}}^2 \amp= \brac{\frac{1 + \cos{(2x)}}{2}}^2\\ \amp= \frac{1 + 2 \cos{(2x)} + \cos^2{(2x)}}{4} \amp\amp\text{expanding}\\ \amp= \frac{1}{4} + \frac{1}{2} \cos{(2x)} + \frac{1}{4} \cos^2{(2x)} \amp\amp\text{simplifying} \end{align*}
Here, we have reduced the power of cosine from 4 to 2, but we still have \(\cos^2{(2x)}\text{,}\) so we can apply the power-reducing identity again to \(\cos^2{(2x)}\text{,}\)
\begin{align*} \amp= \frac{1}{4} + \frac{1}{2} \cos{(2x)} + \frac{1}{4} \cdot \frac{1 + \cos{(4x)}}{2} \amp\amp\text{using power-reducing identity again}\\ \amp= \frac{3}{8} + \frac{1}{2} \cos{(2x)} + \frac{1}{8} \cos{(4x)} \amp\amp\text{simplifying} \end{align*}
Then, putting it all together,
\begin{align*} \int \cos^4{x} \,dx \amp= \int \brac{\frac{3}{8} + \frac{1}{2} \cos{(2x)} + \frac{1}{8} \cos{(4x)}} \,dx\\ \amp= \frac{3}{8}x + \frac{1}{4} \sin{(2x)} + \frac{1}{32} \sin{(4x)} + C \end{align*}
Therefore,
\begin{equation*} \boxed{\int \cos^4{x} \,dx = \frac{3}{8}x + \frac{1}{4} \sin{(2x)} + \frac{1}{32} \sin{(4x)} + C} \end{equation*}

Remark 6.5.4.

Interestingly, the integral \(\int \cos^4{x} \,dx\) results in a “non-trigonometric” term (the linear term \(\frac{3x}{8}\)), which had not occurred in the previous cases. This tends to happen when integrating even powers.

Example 6.5.5. 4th Power of Sine.

Evaluate \(\int \sin^4{x} \,dx\text{.}\)
Solution.
Using the same method as \(\int \cos^4{x} \,dx\text{,}\) we can write \(\sin^4{x}\) as \(\brac{\sin^2{x}}^2\text{,}\) and then use the power-reducing identity for \(\sin^2{x}\text{,}\)
\begin{align*} \sin^4{x} = \brac{\sin^2{x}}^2 = \brac{\frac{1 - \cos{(2x)}}{2}}^2 \amp= \frac{1 - 2 \cos{(2x)} + \cos^2{(2x)}}{4}\\ \amp= \frac{1}{4} - \frac{1}{2} \cos{(2x)} + \frac{1}{4} \cos^2{(2x)} \amp\amp\text{simplifying}\\ \amp= \frac{1}{4} - \frac{1}{2} \cos{(2x)} + \frac{1}{4} \cdot \frac{1 + \cos{(4x)}}{2} \amp\amp\text{using power-reducing identity again}\\ \amp= \frac{3}{8} - \frac{1}{2} \cos{(2x)} + \frac{1}{8} \cos{(4x)} \amp\amp\text{simplifying} \end{align*}
Then, putting it all together,
\begin{align*} \int \sin^4{x} \,dx \amp= \int \brac{\frac{3}{8} - \frac{1}{2} \cos{(2x)} + \frac{1}{8} \cos{(4x)}} \,dx\\ \amp= \frac{3}{8} x - \frac{1}{4} \sin{(2x)} + \frac{1}{32} \sin{(4x)} + C \end{align*}
Therefore,
\begin{equation*} \boxed{\int \sin^4{x} \,dx = \frac{3}{8} x - \frac{1}{4} \sin{(2x)} + \frac{1}{32} \sin{(4x)} + C} \end{equation*}
In general,
  • For odd powers, separate out one factor, and then convert the remaining to the opposite trigonometric function, using \(\sin^2{x} = 1 - \cos^2{x}\) or \(\cos^2{x} = 1 - \sin^2{x}\text{,}\) and then use substitution.
  • For even powers, use the power-reducing identities to reduce the power to the first power, and then integrate.

Checkpoint 6.5.6. 5th Power of Cosine.

\(\int \cos^5{x} \,dx\)
Hint.
Separate out one factor of \(\cos{x}\text{,}\) and then use the Pythagorean identity \(\cos^2{x} = 1 - \sin^2{x}\) to rewrite \(\cos^4{x}\) in terms of sine, and then use substitution \(u=\sin{x}\text{.}\)
Answer.
\(\frac{1}{5} \sin^5{x} - \frac{2}{3} \sin^3{x} + \sin{x} + C\)

Subsection 6.5.2 Integral of Products of Powers of Sine and Cosine

More generally, we can consider integrals with a power of sine multiplied with a power of cosine, of the form,
\begin{equation*} \int \sin^m(x) \cos^n(x) \,dx \end{equation*}
where \(m, n\) are whole numbers. Sometimes, these are called trigonometric integrals, even though they are not the only type of integrals involving trig functions.

Example 6.5.7. Integral of \(\sin^4{x} \cos{x}\).

Evaluate \(\int \sin^4{x} \cos{x} \,dx\text{.}\)
Solution.
We can use substitution, because the derivative of \(\sin{x}\) is \(\cos{x}\) which is also there. Then,
\begin{align*} u = \sin{x} \quad \longrightarrow \quad du \amp= \cos{x} \,dx \end{align*}
\begin{align*} \amp= \int u^4 \,du\\ \amp= \frac{1}{5} u^5 + C\\ \amp= \frac{1}{5} \sin^5{x} + C \end{align*}

Example 6.5.8. Integral of \(\sin^3{x} \cos^2{x}\).

Evaluate \(\int \sin^3{x} \cos^2{x} \,dx\text{.}\)
Solution.
It turns out that again, we can use substitution, because if we separate out one factor of \(\sin{x}\) to prepare for substitution,
\begin{align*} \int \sin^3{x} \cos^2{x} \,dx \amp= \int \sin^2{x} \cos^2{x} \cdot \sin{x} \,dx \end{align*}
Then, we can use the Pythagorean identity \(\sin^2{x} = 1 - \cos^2{x}\) to rewrite \(\sin^2{x}\) in terms of cosine,
\begin{align*} \amp= \int (1 - \cos^2{x}) \cos^2{x} \cdot \sin{x} \,dx \end{align*}
Now, the substitution \(u = \cos{x}\) will work, because the derivative of \(\cos{x}\) is \(-\sin{x}\text{,}\) and \(\sin{x} \,dx\) is perfectly there on the right side to be replaced by \(du\) (just account for the negative sign). Then,
\begin{align*} u = \cos{x} \quad \longrightarrow \quad du \amp= -\sin{x} \,dx\\ -du \amp= \sin{x} \,dx \end{align*}
Then,
\begin{align*} \amp= \int \brac{u^2 - u^4} (-\,du)\\ \amp= \int \brac{-u^2 + u^4} \,du\\ \amp= -\frac{1}{3}u^3 + \frac{1}{5} u^5 + C\\ \amp= -\frac{1}{3}\cos^3{x} + \frac{1}{5} \cos^5{x} + C \end{align*}
In general, if at least one of the exponents on sine or cosine is odd, then we can use this technique, where we separate out one factor of the odd power, and then convert the remaining to the other trig function, using the Pythagorean identity, and then use \(u\)-substitution.

Example 6.5.9. Integral of \(\sin^3{x} \cos^3{x}\).

Evaluate \(\int \sin^3{x} \cos^3{x} \,dx\text{.}\)
Solution.
Here, both powers are odd, so we can separate out either power. If we separate out one factor of \(\cos{x}\text{,}\) then we can use the Pythagorean identity \(\cos^2{x} = 1 - \sin^2{x}\) to rewrite \(\cos^2{x}\) in terms of sine,
\begin{align*} \amp= \int \sin^3{x} (1 - \sin^2{x}) \cdot \cos{x} \,dx \end{align*}
Then,
\begin{align*} u = \sin{x} \quad \longrightarrow \quad du \amp= \cos{x} \,dx \end{align*}
Then,
\begin{align*} \amp= \int \brac{u^3 - u^5} \,du\\ \amp= \frac{1}{4}u^4 - \frac{1}{6} u^6 + C\\ \amp= \frac{1}{4}\sin^4{x} - \frac{1}{6} \sin^6{x} + C \end{align*}
Alternatively, if we separate out one factor of \(\sin{x}\text{,}\) then convert the rest to cosine using \(\sin^2{x} = 1 - \cos^2{x}\text{,}\)
\begin{align*} \amp= \int (1 - \cos^2{x}) \cos^3{x} \cdot \sin{x} \,dx \end{align*}
Then,
\begin{align*} u = \cos{x} \quad \longrightarrow \quad du \amp= -\sin{x} \,dx \end{align*}
Then,
\begin{align*} \amp= \int \brac{u^3 - u^5} (-\,du)\\ \amp= \int \brac{-u^3 + u^5} \,du\\ \amp= -\frac{1}{4}u^4 + \frac{1}{6} u^6 + C\\ \amp= -\frac{1}{4}\cos^4{x} + \frac{1}{6} \cos^6{x} + C \end{align*}
In fact, both of the final answers are correct, and equivalent, even though they look different.
\begin{align*} \int \sin^3{x} \cos^3{x} \,dx \amp= \frac{1}{4}\sin^4{x} - \frac{1}{6} \sin^6{x} + C\\ \int \sin^3{x} \cos^3{x} \,dx \amp= -\frac{1}{4}\cos^4{x} + \frac{1}{6} \cos^6{x} + C \end{align*}
In fact, they only differ by a constant. Here is a graph of each: Graph of \(y=\frac{1}{4}\sin^4{x} - \frac{1}{6} \sin^6{x}\) and \(y=-\frac{1}{4}\cos^4{x} + \frac{1}{6} \cos^6{x}\). Notice that they are the same graph, just with a vertical shift.
In general,
  • If both exponents are odd, then you can separate off either sine or cosine.
  • With each choice, you will get answers which look different, but they will be equivalent.
If both powers are even, then the integral is more complicated, because we can’t use the previous technique. Instead, we can use the power-reducing identities to reduce the powers, and then integrate.

Example 6.5.10. Integral of \(\sin^2{x} \cos^2{x}\).

Evaluate \(\int \sin^2{x} \cos^2{x} \,dx\text{.}\)
Solution.
Here, both exponents are even, so we use the power-reducing identities,
\begin{align*} \int \sin^2{x} \cos^2{x} \,dx \amp= \int \frac{1-\cos{(2x)}}{2} \cdot \frac{1+\cos{(2x)}}{2} \,dx\\ \amp= \frac{1}{4} \int (1 - \cos{(2x)})(1 + \cos{(2x)}) \,dx \amp\amp\text{simplifying}\\ \amp= \frac{1}{4} \int (1 - \cos^2{(2x)}) \,dx \amp\amp\text{expanding the brackets} \end{align*}
There is still \(\cos^2{(2x)}\text{,}\) which is to the 2nd power, so apply the power-reducing identity again,
\begin{align*} \amp= \frac{1}{4} \int \brac{1 - \frac{1 + \cos{(4x)}}{2}}\,dx\\ \amp= \frac{1}{4} \int \brac{1 - \frac{1}{2} - \frac{1}{2} \cos{(4x)}}\,dx \amp\amp\text{simplifying}\\ \amp= \frac{1}{4} \int \brac{\frac{1}{2} - \frac{1}{2} \cos{(4x)}}\,dx \amp\amp\text{simplifying}\\ \amp= \frac{1}{4} \brac{\frac{1}{2}x - \frac{1}{8}\sin{(4x)}} + C\\ \amp= \frac{1}{8}x - \frac{1}{32} \sin{(4x)} + C \amp\amp\text{simplifying} \end{align*}

Example 6.5.11. Integral of \(\sin^2{x} \cos^4{x}\).

Evaluate \(\int \sin^2{x} \cos^4{x} \,dx\text{.}\)
Solution.
Both exponents are even again. This requires more tedious algebra than the previous example, because the exponents are bigger. But once again, we start with the power-reducing identities,
\begin{align*} \int \sin^2{x} \cos^4{x}\,dx \amp= \int \sin^2{x} \cdot \brac{\cos^2{x}}^2 \,dx\\ \amp= \int \frac{1-\cos{(2x)}}{2} \cdot \brac{\frac{1+\cos{(2x)}}{2}}^2 \,dx \end{align*}
We want to simplify as much as possible before integrating,
\begin{align*} \amp= \frac{1}{8} \int \brac{1-\cos{(2x)}}(1+\cos{(2x)})^2\,dx \amp\amp\text{simplifying}\\ \amp= \frac{1}{8} \int \brac{1-\cos{(2x)}} (1+ 2\cos{(2x)} + \cos^2{(2x)})\,dx \amp\amp\text{expanding}\\ \amp= \frac{1}{8} \int \brac{1 + \cos{(2x)} - \cos^2{(2x)} - \cos^3{(2x)}} \,dx \amp\amp\text{expanding, and combining like terms} \end{align*}
The integral of 1 and \(\cos{(2x)}\) are straightforward, but the integral of \(\cos^2{(2x)}\) and \(\cos^3{(2x)}\) are more complicated,
\begin{align*} \amp= \frac{1}{8} \brac{x + \frac{1}{2} \sin{(2x)} - \int \brac{\cos^2{(2x)} + \cos^3{(2x)}} \,dx} \end{align*}
Then, for \(\cos^2{(2x)}\text{,}\) the power is even, so use the power-reducing identity again,
\begin{align*} \int \cos^2{(2x)} \,dx \amp= \int \frac{1 + \cos{(4x)}}{2} \,dx\\ \amp= \frac{1}{2} \int \brac{1 + \cos{(4x)}} \,dx\\ \amp= \frac{1}{2} \brac{x + \frac{1}{4} \sin{(4x)}}\\ \amp= \frac{1}{2}x + \frac{1}{8} \sin{(4x)} \end{align*}
For \(\cos^3{(2x)}\text{,}\) the power is odd, so use substitution, by separating out one factor of \(\cos{(2x)}\text{,}\) and using the Pythagorean identity \(\cos^2{(2x)} = 1 - \sin^2{(2x)}\) to rewrite \(\cos^2{(2x)}\) in terms of sine,
\begin{align*} \int \cos^3{(2x)} \,dx \amp= \int (1 - \sin^2{(2x)}) \cdot \cos{(2x)} \,dx\\ \amp= \frac{1}{2} \int (1 - u^2) \,du \amp\amp\text{ }\\ \amp= \frac{1}{2} \brac{u - \frac{1}{3} u^3}\\ \amp= \frac{1}{2} \sin{(2x)} - \frac{1}{6} \sin^3{(2x)} \end{align*}
Finally, putting it all together,
\begin{align*} \amp= \frac{1}{8} \brac{x + \frac{1}{2} \sin{(2x)} - \brac{\frac{1}{2}x + \frac{1}{8} \sin{(4x)} + \frac{1}{2} \sin{(2x)} - \frac{1}{6} \sin^3{(2x)}}} + C\\ \amp= \frac{1}{8} \brac{\frac{1}{2} x - \frac{1}{8} \sin{(4x)} + \frac{1}{6} \sin^3{(2x)}} + C \end{align*}
In summary,

Exercise Group 6.5.1. Evaluate Each Integral.

Evaluate each integral.
(a)
\(\int \sin^3{x} \cos^4{x} \,dx\)
Hint.
Factor out \(\sin{x}\text{,}\) use \(\sin^2{x} = 1 - \cos^2{x}\text{,}\) and let \(u = \cos{x}\text{.}\)
Answer.
\(-\frac{1}{5} \cos^5{x} + \frac{1}{7} \cos^7{x} + C\)
(b)
\(\int \sin^5{x} \cos^3{x} \,dx\)
Hint.
Factor out \(\cos{x}\text{,}\) use \(\cos^2{x} = 1 - \sin^2{x}\text{,}\) and let \(u = \sin{x}\text{.}\)
Answer.
\(\frac{1}{6} \sin^6{x} - \frac{1}{8} \sin^8{x} + C\)
(c)
\(\int \cos^7{x} \sin^2{x} \,dx\)
Hint.
Factor out \(\cos{x}\text{,}\) use \(\cos^2{x} = 1 - \sin^2{x}\text{,}\) expand \((1 - u^2)^3\text{,}\) and let \(u = \sin{x}\text{.}\)
Answer.
\(\frac{1}{3} \sin^3{x} - \frac{3}{5} \sin^5{x} + \frac{3}{7} \sin^7{x} - \frac{1}{9} \sin^9{x} + C\)
(d)
\(\int \sin^4{x} \cos^2{x} \,dx\)
Hint.
Both exponents are even, so use power-reducing identities.
Answer.
\(\frac{1}{16} x - \frac{1}{64} \sin{(4x)} - \frac{1}{48} \sin^3{(2x)} + C\)
(e)
\(\int \sin^3{x} \cos^6{x} \,dx\)
Hint.
Factor out \(\sin{x}\text{,}\) use \(\sin^2{x} = 1 - \cos^2{x}\text{,}\) and let \(u = \cos{x}\text{.}\)
Answer.
\(-\frac{1}{7} \cos^7{x} + \frac{1}{9} \cos^9{x} + C\)
(f)
\(\int \sin^6{x} \cos^3{x} \,dx\)
Hint.
Factor out \(\cos{x}\text{,}\) use \(\cos^2{x} = 1 - \sin^2{x}\text{,}\) and let \(u = \sin{x}\text{.}\)
Answer.
\(\frac{1}{7} \sin^7{x} - \frac{1}{9} \sin^9{x} + C\)

Subsection 6.5.3 Powers of Tangents and Secants

We can also consider integrals of powers of tangent and secant. The techniques are similar to those for sine and cosine, but there are some differences, because the identities and derivatives are different. First, recall the derivatives of tangent and secant,
\begin{align*} \frac{d}{dx} \tan{x} \amp= \sec^2{x}\\ \frac{d}{dx} \sec{x} \amp= \sec{x} \tan{x} \end{align*}
And the Pythagorean identities for tangent and secant,
\begin{align*} \sec^2{x} \amp= \tan^2{x} + 1\\ \tan^2{x} \amp= \sec^2{x} - 1 \end{align*}

Subsection 6.5.4 Integral of Products of Powers of Tangents and Secants

Integrals of a product of powers of tangent and secant can be evaluated using similar methods as for products of sine and cosine. In other words, of the form,
\begin{equation*} \int \tan^{m}(x) \sec^{n}(x) \,dx \end{equation*}
Intuitively, this is because tangent and secant are related by the Pythagorean identity,
\begin{align*} \sec^2{x} \amp= \tan^2{x} + 1\\ \tan^2{x} \amp= \sec^2{x} - 1 \end{align*}
This allows us to convert between even powers of tangent and secant (just like we converted between sine and cosine).
Also, the derivatives of tangent and secant are related to each other,
\begin{align*} \frac{d}{dx} \tan{x} \amp= \sec^2{x}\\ \frac{d}{dx} \sec{x} \amp= \sec{x} \tan{x} \end{align*}
This means that often we can use substitution, with \(u\) being either tangent or secant, depending on the situation (just like we used substitution with sine and cosine).

Example 6.5.13. Tangent Squared.

We already did \(\int \sin^2{x} \,dx\) and \(\int \cos^2{x} \,dx\text{,}\) so let’s consider \(\int \tan^2{x} \,dx\text{.}\)
Solution.
This integral requires a bit of a trick. We can use the identity \(\tan^2{x} + 1 = \sec^2{x}\text{,}\)
\begin{align*} \amp= \int \brac{\sec^2{x} - 1} \,dx \end{align*}
Then, recall that \(\int \sec^2{x} \,dx = \tan{x}\text{,}\) so,
\begin{align*} \amp= \tan{x} - x + C \end{align*}
Thus,
\begin{equation*} \boxed{\int \tan^2{x} \,dx = \tan{x} - x + C} \end{equation*}

Example 6.5.14. Integral of \(\tan{x} \sec^2{x}\).

Evaluate \(\int \tan{x} \sec^2{x} \,dx\text{.}\)
Solution.
The derivative of \(\tan{x}\) is \(\sec^2{x}\text{,}\) so \(u = \tan{x}\) will work well. Then, \(du = \sec^2{x} \,dx\text{.}\) Then,
\begin{align*} \amp= \int u \,du\\ \amp= \frac{1}{2} u^2 + C\\ \amp= \frac{1}{2} \tan^2{x} + C \end{align*}

Example 6.5.15. Integral of \(\tan^3{x} \sec^2{x}\).

Evaluate \(\int \tan^3{x} \sec^2{x} \,dx\text{.}\)
Solution.
Again, the derivative of \(\tan{x}\) is \(\sec^2{x}\text{,}\) so \(u = \tan{x}\) will work well. Then, \(du = \sec^2{x} \,dx\text{.}\) Then,
\begin{align*} \amp= \int u^3 \,du\\ \amp= \frac{1}{4} u^4 + C\\ \amp= \frac{1}{4} \tan^4{x} + C \end{align*}
In general, if we have an expression involving tangent, and also \(\sec^2{x} \,dx\text{,}\) then we can use substitution with \(u = \tan{x}\text{.}\)

Example 6.5.16. Tangent Cubed.

Evaluate \(\int \tan^3{x} \,dx\text{.}\)
Solution.
This also requires a bit of a trick. Separate out \(\tan{x}\text{,}\) to leave \(\tan^2{x}\text{,}\) and use the Pythagorean identity \(\tan^2{x} = \sec^2{x} - 1\) to rewrite \(\tan^2{x}\) in terms of secant,
\begin{align*} \amp= \int \tan^2{x} \cdot \tan{x} \,dx\\ \amp= \int \brac{\sec^2{x} - 1} \cdot \tan{x} \,dx\\ \amp= \int \sec^2{x} \tan{x} \,dx - \int \tan{x} \,dx \amp\amp\text{splitting the integral} \end{align*}
For the 1st integral, we can use substitution with \(u=\tan{x}\text{,}\) so that \(du = \sec^2{x} \,dx\text{.}\) For the 2nd integral, this is the Integral of Tangent, which is \(\ln{\abs{\sec{x}}}\text{.}\) Then,
\begin{align*} \amp= \int u \,du\\ \amp= \frac{1}{2} u^2 + C\\ \amp= \frac{1}{2} \tan^2{x} + C \end{align*}
Putting it all together,
\begin{equation*} \boxed{\int \tan^3{x} \,dx = \frac{\sec^2{x}}{2} - \ln{\abs{\sec{x}}} + C} \end{equation*}

Example 6.5.17. Tangent 4th Power.

Evaluate \(\int \tan^4{x} \,dx\text{.}\)
Solution.
This is similar to \(\int \tan^2{x}\text{,}\) because we can convert \(\tan^4{x}\) to \(\tan^2{x} \cdot \tan^2{x}\text{,}\) and then use the Pythagorean identity \(\tan^2{x} = \sec^2{x} - 1\) to rewrite one of the \(\tan^2{x}\) in terms of secant,
\begin{align*} \amp= \int \tan^2{x} \cdot \tan^2{x} \,dx\\ \amp= \int \brac{\sec^2{x} - 1} \cdot \tan^2{x} \,dx\\ \amp= \int \brac{\sec^2{x} \tan^2{x} - \tan^2{x}} \,dx \end{align*}
Then, splitting the integral,
\begin{align*} \amp= \int \sec^2{x} \tan^2{x} \,dx - \int \tan^2{x} \,dx \end{align*}
For the 2nd integral, we have seen it before, as this is the Integral of Tangent Squared,
\begin{align*} \int \tan^2{x} \,dx \amp= \int \brac{\sec^2{x} - 1} \,dx\\ \amp= \tan{x} - x \end{align*}
For the first integral, we can use substitution, with \(u = \tan{x}\text{,}\) so that \(du = \sec^2{x} \,dx\text{.}\) Then,
\begin{align*} \amp= \int u^2 \,du\\ \amp= \frac{1}{3} u^3 + C\\ \amp= \frac{1}{3} \tan^3{x} + C \end{align*}
Therefore,
\begin{equation*} \boxed{\int \tan^4{x} \,dx = \frac{1}{3} \tan^3{x} - \tan{x} + x + C} \end{equation*}

Example 6.5.18. Integral of \(\tan^3{x} \sec^4{x}\).

Evaluate \(\int \tan^3{x} \sec^4{x} \,dx\text{.}\)
Solution.
First, like before, separate off \(\sec^2{x}\text{,}\) because it is the derivative of \(\tan{x}\text{,}\) to prepare for the substitution \(u = \tan{x}\text{,}\)
\begin{align*} \amp= \int \tan^3{x} \sec^2{x} \cdot \sec^2{x} \,dx \end{align*}
Then, convert the remaining \(\sec^2{x}\) to tangent, using the identity \(\sec^2{x} = 1 + \tan^2{x}\text{,}\)
\begin{align*} \amp= \int \tan^3{x} (1 + \tan^2{x}) \cdot \sec^2{x} \,dx \end{align*}
Then,
\begin{align*} u = \tan{x} \quad \longrightarrow \quad du \amp= \sec^2{x} \,dx \end{align*}
Then,
\begin{align*} \amp= \int u^3 (1 + u^2) \,du\\ \amp= \int \brac{u^3 + u^5} \,du\\ \amp= \frac{1}{4} u^4 + \frac{1}{6} u^6 + C\\ \amp= \frac{1}{4} \tan^4{x} + \frac{1}{6} \tan^6{x} + C \end{align*}
This technique of separating off \(\sec^2{x}\) works as long as the exponent of secant is even. Otherwise, if the exponent is odd, we’ll need a different technique.

Example 6.5.19. Integral of \(\tan{x} \sec^3{x}\).

Evaluate \(\int \tan{x} \sec^3{x} \,dx\text{.}\)
Solution.
Here, the exponent of secant is 3 which is odd, so we can’t use the previous technique. This is because if we separate off \(\sec^2{x}\text{,}\) then,
\begin{align*} \amp= \int \tan{x} \sec{x} \cdot \sec^2{x} \,dx \end{align*}
We’ll have only 1 factor of secant left, which we can’t convert to tangent using the Pythagorean identity.
However, it turns out we can use the derivative of \(\sec{x}\) instead, which is \(\sec{x} \tan{x}\text{.}\) Separate off \(\sec{x} \tan{x}\) to prepare for the substitution \(u = \sec{x}\text{,}\)
\begin{align*} \amp= \int \sec^2{x} \cdot \sec{x} \tan{x} \,dx \end{align*}
Then,
\begin{align*} u = \sec{x} \quad \longrightarrow \quad du \amp= \sec{x} \tan{x} \,dx \end{align*}
Then,
\begin{align*} \amp= \int u^2 \,du\\ \amp= \frac{1}{3} u^3 + C\\ \amp= \frac{1}{3} \sec^3{x} + C \end{align*}

Example 6.5.20. Integral of \(\tan^3{x} \sec^3{x}\).

Evaluate \(\int \tan^3{x} \sec^3{x} \,dx\text{.}\)
Solution.
The exponent of secant is 3 which is odd, so like the previous example, we can separate off \(\sec{x} \tan{x}\text{,}\)
\begin{align*} \amp= \int \tan^2{x} \sec^2{x} \cdot \sec{x} \tan{x} \,dx \end{align*}
Then, convert the remaining \(\tan^2{x}\) to secant, using the identity \(\tan^2{x} = \sec^2{x} - 1\text{,}\)
\begin{align*} \amp= \int (\sec^2{x} - 1) \sec^2{x} \cdot \sec{x} \tan{x} \,dx \end{align*}
Then,
\begin{align*} u = \sec{x} \quad \longrightarrow \quad du \amp= \sec{x} \tan{x} \,dx \end{align*}
Then,
\begin{align*} \amp= \int (u^2 - 1) u^2 \,du\\ \amp= \int (u^4 - u^2) \,du\\ \amp= \frac{1}{5} u^5 - \frac{1}{3} u^3 + C\\ \amp= \frac{1}{5} \sec^5{x} - \frac{1}{3} \sec^3{x} + C \end{align*}
In general, this technique of separating out \(\sec{x} \tan{x}\) will work when the exponent of secant is odd, and the exponent of tangent is also odd.

Checkpoint 6.5.21. Integral of \(\tan^5{x} \sec^5{x}\).

\(\int \tan^5{x} \sec^5{x} \,dx\)
Hint.
Split off \(\sec{x} \tan{x}\text{,}\) and convert the rest to secant using \(\tan^2{x} = \sec^2{x} - 1\text{.}\)
Answer.
\(\frac{1}{9} \sec^9{x} - \frac{2}{7} \sec^7{x} + \frac{1}{5} \sec^5{x} + C\)
Lastly, the final situation is if the power of secant is odd, and the power of tangent is even. In this case, the integral is more complicated, and there isn’t a simple one-step substitution. You may not ever encounter an integral like this.
In summary,

Exercise Group 6.5.2. Evaluate Each Integral.

Evaluate each integral.
(a)
\(\int \tan^4{x} \sec^4{x} \,dx\)
Hint.
Split off \(\sec^2{x}\text{,}\) and let \(u = \tan{x}\text{.}\)
Answer.
\(\frac{1}{5} \tan^5{x} + \frac{1}{7} \tan^7{x} + C\)
(b)
\(\int \tan^3{x} \sec^5{x} \,dx\)
Hint.
Split off \(\sec{x} \tan{x}\text{,}\) and let \(u = \sec{x}\text{.}\)
Answer.
\(\frac{1}{7} \sec^7{x} - \frac{1}{5} \sec^5{x} + C\)
(c)
\(\int \tan^4{x} \sec^6{x} \,dx\)
Hint.
Split off \(\sec^2{x}\text{,}\) and expand \((1 + u^2)^2\text{.}\)
Answer.
\(\frac{1}{5} \tan^5{x} + \frac{2}{7} \tan^7{x} + \frac{1}{9} \tan^9{x} + C\)
(d)
\(\int \sec^4{x} \,dx\)
Hint.
Split off \(\sec^2{x}\text{,}\) and let \(u = \tan{x}\text{.}\)
Answer.
\(\tan{x} + \frac{1}{3} \tan^3{x} + C\)
(e)
\(\int \tan^5{x} \sec^9{x} \,dx\)
Hint.
Split off \(\sec{x} \tan{x}\text{,}\) and convert the rest to secant using \(\tan^2{x} = \sec^2{x} - 1\text{.}\)
Answer.
\(\frac{1}{13} \sec^{13}{x} - \frac{2}{11} \sec^{11}{x} + \frac{1}{9} \sec^9{x} + C\)
(f)
\(\int \tan^6{x} \sec^4{x} \,dx\)
Hint.
Split off \(\sec^2{x}\text{,}\) and let \(u = \tan{x}\text{.}\)
Answer.
\(\frac{1}{7} \tan^7{x} + \frac{1}{9} \tan^9{x} + C\)
(g)
\(\int \tan^2{\brac{\frac{x}{4}}} \sec^2{\brac{\frac{x}{4}}} \,dx\)
Hint.
Let \(u = \tan{\brac{\frac{x}{4}}}\text{,}\) so \(du = \frac{1}{4} \sec^2{\brac{\frac{x}{4}}} \,dx\text{.}\)
Answer.
\(\frac{4}{3} \tan^3{\brac{\frac{x}{4}}} + C\)

Subsection 6.5.5 Examples

Exercise Group 6.5.3. ★ Evaluate Each Integral.

Evaluate each integral.
(b)
\(\int \sin^5 x \,dx\)
Hint.
Separate off \(\sin{x}\text{,}\) let \(u=\cos{x}\text{.}\)
Answer.
\(-\cos x+\frac{2}{3}\cos^3 x-\frac{1}{5}\cos^5 x+C\)
(c)
\(\int \sin^4(2x)\cos(2x) \,dx\)
Hint.
\(u=\sin{(2x)}\)
Answer.
\(\frac{1}{10}\sin^5(2x)+C\)
(d)
\(\int \cos^3(20x) \,dx\)
Hint.
Separate off \(\cos{(20x)}\text{,}\) let \(u=\sin{(20x)}\text{.}\)
Answer.
\(\frac{1}{20}\sin(20x)-\frac{1}{60}\sin^3(20x)+C\)
(e)
\(\int \sin^2 x\cos^5 x \,dx\)
Hint.
Separate off \(\cos{x}\text{,}\) let \(u=\sin{x}\text{.}\)
Answer.
\(\frac{1}{3}\sin^3 x-\frac{2}{5}\sin^5 x+\frac{1}{7}\sin^7 x+C\)
(f)
\(\int \cos^3 x\sqrt{\sin x}\,dx\)
Hint.
Separate off \(\cos{x}\text{,}\) let \(u=\sin{x}\text{.}\)
Answer.
\(\frac{2}{3}(\sin x)^{\frac{3}{2}}-\frac{2}{7}(\sin x)^{\frac{7}{2}}+C\)
(h)
\(\int 7\cos^7 x \,dx\)
Hint.
Separate off \(\cos{x}\text{,}\) let \(u=\sin{x}\text{.}\)
Answer.
\(7\sin x-7\sin^3 x+\frac{21}{5}\sin^5 x-\sin^7 x+C\)
(i)
\(\int \cos^3(4x) \,dx\)
Hint.
Separate off \(\cos{(4x)}\text{,}\) let \(u=\sin{(4x)}\text{.}\)
Answer.
\(\frac{1}{4}\sin(4x)-\frac{1}{12}\sin^3(4x)+C\)
(k)
\(\int \frac{\sec x\tan x}{\sqrt{\sec x}} \,dx\)
Hint.
\(u=\sec{x}\)
Answer.
\(2\sqrt{\sec x}+C\)
(l)
\(\int \sec^2 x\tan^{\frac{1}{2}}x \,dx\)
Hint.
\(u=\tan{x}\)
Answer.
\(\frac{2}{3}(\tan x)^{\frac{3}{2}}+C\)
(m)
\(\int \sqrt{\cot x}\csc^2 x \,dx\)
Hint.
\(u=\cot{x}\)
Answer.
\(-\frac{2}{3}(\cot x)^{3/2}+C\)

Exercise Group 6.5.4. ★ Definite Integrals.

Evaluate each definite integral.
(a)
\(\int_0^{\pi/4}\frac{\sin x}{\cos^2 x} \,dx\)
Hint.
\(u=\cos{x}\)
Answer.
\(\sqrt{2}-1\)
(b)
\(\int_{\pi/4}^{\pi/2}\frac{\cos x}{\sin^2 x} \,dx\)
Hint.
\(u=\sin{x}\)
Answer.
\(\sqrt{2}-1\)
(c)
\(\int_0^{\sqrt{\frac{\pi}{2}}}x\sin^3(x^2) \,dx\)
Answer.
\(\frac{1}{3}\)
(d)
\(\int_0^{\frac{\pi}{2}}\sin^2(2x)\cos^3(2x) \,dx\)
Answer.
\(0\)
(e)
\(\int_0^{\frac{\pi}{2}}\cos^3 x\sqrt{\sin^3 x}\,dx\)
Answer.
\(\frac{8}{45}\)
(f)
\(\int_0^{\frac{\pi}{2}}\sin^7 x \,dx\)
Hint.
Separate off \(\sin{x}\text{,}\) let \(u=\cos{x}\text{.}\)
Answer.
\(\frac{16}{35}\)
(g)
\(\int_0^\pi \sin^5\brac{\frac{x}{2}} \,dx\)
Hint.
Separate off \(\sin{\brac{\frac{x}{2}}}\text{,}\) let \(u=\cos{\brac{\frac{x}{2}}}\text{.}\)
Answer.
\(\frac{16}{15}\)

Exercise Group 6.5.5. ★★ Evaluate Each Integral.

Evaluate each integral.
(a)
\(\int \sin^5\brac{\frac{x}{3}}\cos\brac{\frac{x}{3}} \,dx\)
Answer.
\(\frac{1}{2}\sin^6\brac{\frac{x}{3}}+C\)
(b)
\(\int \sin^3 x \cos^{-2}x \,dx\)
Answer.
\(\sec x+\cos x+C\)
(c)
\(\int \cos^4(2x)\,dx\)
Answer.
\(\frac{3}{8}x+\frac{1}{8}\sin(4x)+\frac{1}{64}\sin(8x)+C\)
(d)
\(\int \sin^3 x\cos^5 x \,dx\)
Answer.
\(\frac{1}{8}\cos^8 x-\frac{1}{6}\cos^6 x+C\)
(e)
\(\int \sin^{-\frac{3}{2}}x\cos^3 x \,dx\)
Answer.
\(-\frac{2}{\sqrt{\sin x}}-\frac{2}{3}(\sin x)^{\frac{3}{2}}+C\)
(f)
\(\int \sin^3 x\cos^{\frac{3}{2}}x \,dx\)
Answer.
\(\frac{2}{9}(\cos x)^{\frac{9}{2}}-\frac{2}{5}(\cos x)^{\frac{5}{2}}+C\)
(g)
\(\int 8\cos^4(2\pi x) \,dx\)
Answer.
\(3x+\frac{1}{\pi}\sin(4\pi x)+\frac{1}{8\pi}\sin(8\pi x)+C\)
(h)
\(\int \sin^3(mx) \,dx\)
Answer.
\(\frac{1}{3m}\cos^3(mx)-\frac{1}{m}\cos(mx)+C\)
(i)
\(\int 16\sin^2 x\cos^2 x \,dx\)
Answer.
\(2x-\frac{1}{2}\sin(4x)+C\)
(j)
\(\int \sqrt{\cos x}\sin^3 x \,dx\)
Answer.
\(\frac{2}{7}(\cos x)^{\frac{7}{2}}-\frac{2}{3}(\cos x)^{\frac{3}{2}}+C\)
(k)
\(\int \frac{\sin^2\brac{\frac{1}{x}}}{x^2} \,dx\)
Hint.
\(u=\frac{1}{x}\)
Answer.
\(\frac{1}{4}\sin\brac{\frac{2}{x}}-\frac{1}{2x}+C\)
(l)
\(\int \cos^3(2x)\sin^5(2x) \,dx\)
Answer.
\(\frac{1}{12}\sin^6(2x)-\frac{1}{16}\sin^8(2x)+C\)
(m)
\(\int \frac{1}{x^2}\cos^2\brac{\frac{1}{x}} \,dx\)
Hint.
\(u=\frac{1}{x}\)
Answer.
\(-\frac{1}{2x}-\frac{1}{4}\sin\brac{\frac{2}{x}}+C\)
(n)
\(\int \frac{\sin^3 x}{\cos^4 x}\,dx\)
Hint.
Rewrite as \(\tan x\brac{\sec^3 x-\sec x}\text{,}\) then use \(u=\sec x\text{.}\)
Answer.
\(\frac{1}{3}\sec^3 x-\sec x+C\)

Exercise Group 6.5.6. ★★ Powers and Products of Sine and Cosine (Definite Integrals).

Evaluate each integral.
(a)
\(\int_0^{\frac{\pi}{2}}\cos^5 x \,dx\)
Answer.
\(\frac{8}{15}\)
(b)
\(\int_{\frac{\pi}{2}}^{\frac{\pi}{4}}\sin^5 x\cos^3 x \,dx\)
Answer.
\(-\frac{11}{384}\)
(c)
\(\int_0^{\frac{\pi}{2}}\sin^2 x\cos^2 x \,dx\)
Answer.
\(\frac{\pi}{16}\)
(d)
\(\int_0^{\frac{\pi}{3}}\sin^5 x\cos^{-2}x \,dx\)
Answer.
\(\frac{7}{24}\)
(f)
\(\int_{\frac{\pi}{4}}^{\frac{\pi}{2}}\sin^2(2x)\cos^3(2x)\,dx\)
Answer.
\(-\frac{1}{15}\)
(g)
\(\int_0^\pi 8\sin^4 x\cos^2 x \,dx\)
Answer.
\(\frac{\pi}{2}\)
(h)
\(\int_0^{\frac{\pi}{6}} 3\cos^5(3x) \,dx\)
Answer.
\(\frac{8}{15}\)

Exercise Group 6.5.7. ★★ Powers and Products of Tangent and Secant.

Evaluate each integral.
(a)
\(\int \sec^2 x\tan^2 x \,dx\)
Answer.
\(\frac{1}{3}\tan^3 x+C\)
(c)
\(\int \tan^9 x\sec^4 x \,dx\)
Answer.
\(\frac{1}{10}\tan^{10}x+\frac{1}{12}\tan^{12}x+C\)
(d)
\(\int \tan^5 x\sec^4 x \,dx\)
Answer.
\(\frac{1}{6}\tan^6 x+\frac{1}{8}\tan^8 x+C\)
(f)
\(\int \sec^6 x \,dx\)
Answer.
\(\tan x+\frac{2}{3}\tan^3 x+\frac{1}{5}\tan^5 x+C\)
(g)
\(\int \sec^4 x\tan^2 x \,dx\)
Answer.
\(\frac{1}{3}\tan^3 x+\frac{1}{5}\tan^5 x+C\)
(h)
\(\int \tan^3 x\sec x \,dx\)
Answer.
\(\frac{1}{3}\sec^3 x-\sec x+C\)
(i)
\(\int \tan^7\brac{\frac{x}{2}}\sec^2\brac{\frac{x}{2}} \,dx\)
Answer.
\(\frac{1}{4}\tan^8\brac{\frac{x}{2}}+C\)
(j)
\(\int \tan^5 x\sec^3 x \,dx\)
Answer.
\(\frac{1}{7}\sec^7 x-\frac{2}{5}\sec^5 x+\frac{1}{3}\sec^3 x+C\)
(k)
\(\int \tan(4x)\sec^{\frac{3}{2}}(4x)\,dx\)
Answer.
\(\frac{1}{6}(\sec(4x))^{\frac{3}{2}}+C\)
(l)
\(\int \frac{\sec^2 x}{\tan^5 x} \,dx\)
Answer.
\(-\frac{1}{4\tan^4 x}+C\)
(m)
\(\int \sqrt{\tan x}\sec^4 x \,dx\)
Answer.
\(\frac{2}{3}(\tan x)^{\frac{3}{2}}+\frac{2}{7}(\tan x)^{\frac{7}{2}}+C\)
(n)
\(\int \sec^{-2}x\tan^3 x \,dx\)
Answer.
\(\frac{1}{2}\cos^2 x-\ln|\cos x|+C\)
(o)
\(\int \tan^3(4x) \,dx\)
Answer.
\(\frac{1}{8}\tan^2(4x)-\frac{1}{4}\ln|\sec(4x)|+C\)
(p)
\(\int \tan^5 x \,dx\)
Answer.
\(\frac{1}{4}\sec^4 x-\sec^2 x+\ln|\sec x|+C\)
(q)
\(\int 4\tan^3 x \,dx\)
Answer.
\(2\tan^2 x+4\ln|\cos x|+C\)
(r)
\(\int 20\tan^6 x \,dx\)
Answer.
\(4\tan^5 x-\frac{20}{3}\tan^3 x+20\tan x-20x+C\)
(s)
\(\int \frac{\sec^4(\ln x)}{x} \,dx\)
Answer.
\(\tan(\ln x)+\frac{1}{3}\tan^3(\ln x)+C\)

Exercise Group 6.5.8. ★★ Powers and Products of Cotangent and Cosecant.

Evaluate each integral.
(a)
\(\int \cot^3{x} \,dx\)
Hint.
Use \(\cot^2{x} = \csc^2{x} - 1\) to convert the even power of cotangent to cosecant, and then use \(u = \csc{x}\text{.}\)
(b)
\(\int \cot^4 x \,dx\)
Answer.
\(x+\cot x-\frac{1}{3}\cot^3 x+C\)
(c)
\(\int \csc^{10}x\cot x \,dx\)
Answer.
\(-\frac{1}{10}\csc^{10}x+C\)
(d)
\(\int \cot^5(3x)\,dx\)
Answer.
\(-\frac{1}{12}\cot^4(3x)+\frac{1}{6}\cot^2(3x)+\frac{1}{3}\ln|\sin(3x)|+C\)
(e)
\(\int \cot^6(2x) \,dx\)
Answer.
\(-\frac{1}{2}\cot(2x)+\frac{1}{6}\cot^3(2x)-\frac{1}{10}\cot^5(2x)-x+C\)
(f)
\(\int 8\cot^4 x \,dx\)
Answer.
\(8x+8\cot x-\frac{8}{3}\cot^3 x+C\)
(g)
\(\int \cot^3 x\csc^4 x \,dx\)
Answer.
\(-\frac{1}{4}\cot^4 x-\frac{1}{6}\cot^6 x+C\)
(h)
\(\int \csc^{10}x\cot^3 x \,dx\)
Answer.
\(-\frac{1}{12}\csc^{12}x+\frac{1}{10}\csc^{10}x+C\)
(i)
\(\int (\csc^2 x+\csc^4 x) \,dx\)
Answer.
\(-2\cot x-\frac{1}{3}\cot^3 x+C\)

Exercise Group 6.5.9. ★★ Tangent, Secant, Cotangent, and Cosecant (Definite Integrals).

Evaluate each integral.
(a)
\(\int_0^{\frac{\pi}{4}}\tan^2 x\sec^4 x\,dx\)
Hint.
Separate off \(\sec^2{x}\text{,}\) let \(u=\tan x\text{.}\)
Answer.
\(\frac{8}{15}\)
(b)
\(\int_0^{\frac{\pi}{4}}\tan^3 x\sec^2 x \,dx\)
Hint.
\(u=\tan{x}\)
Answer.
\(\frac{1}{4}\)
(c)
\(\int_0^{\frac{\pi}{6}}\tan^5(2x)\sec(2x)\,dx\)
Hint.
Separate off \(\tan{(2x)} \sec{(2x)}\text{,}\) let \(u=\sec{(2x)}\text{.}\)
Answer.
\(\frac{19}{15}\)
(d)
\(\int_0^{\frac{\pi}{4}}\sec^4 x\,dx\)
Hint.
Separate off \(\sec^2{x}\text{,}\) let \(u=\tan{x}\text{.}\)
Answer.
\(\frac{4}{3}\)
(e)
\(\int_0^{\frac{\pi}{4}}\sec^7 x\sin x\,dx\)
Hint.
Rewrite \(\sec^7 x\sin x=\tan x\sec^6 x\) (tricky!), then use \(u=\sec x\text{,}\) so \(du=\sec x\tan x\,dx\text{.}\)
Answer.
\(\frac{7}{6}\)
(f)
\(\int_{\frac{\pi}{20}}^{\frac{\pi}{10}}\csc^2(5x)\cot^4(5x)\,dx\)
Hint.
\(u=\cot(5x)\)
Answer.
\(\frac{1}{25}\)
(g)
\(\int_0^{\frac{\pi}{8}}(\tan(2x)+\tan^3(2x))\,dx\)
Hint.
Split the integral as \(\int \tan{(2x)} \,dx + \int \tan^3{(2x)} \,dx\text{,}\) or factor to get \(\tan(2x)\brac{1+\tan^2(2x)}=\tan(2x)\sec^2(2x)\text{,}\) then use \(u=\tan(2x)\text{.}\)
Answer.
\(\frac{1}{4}\)
(h)
\(\int_{\frac{\pi}{6}}^{\frac{\pi}{3}}\cot^3 x\,dx\)
Hint.
Write \(\cot^3 x=\cot x(\csc^2 x-1)\text{,}\) then split into \(\int \cot x\csc^2 x\,dx-\int \cot x\,dx\text{.}\)
Answer.
\(\frac{4}{3}-\frac{1}{2}\ln 3\)
(i)
\(\int_{\frac{\pi}{4}}^{\frac{\pi}{2}}\csc^4 x\,dx\)
Hint.
Write \(\csc^4 x=\csc^2 x(1+\cot^2 x)\text{,}\) then use \(u=\cot x\text{.}\)
Answer.
\(\frac{4}{3}\)
(j)
\(\int_{-\frac{\pi}{4}}^{\frac{\pi}{4}}6\tan^4 x\,dx\)
Hint.
The integrand is even, so can use \(2\int_0^{\frac{\pi}{4}}6\tan^4 x\,dx\text{,}\) and write \(\tan^4 x=\brac{\sec^2 x-1}^2\text{.}\)
Answer.
\(3\pi-8\)
(k)
\(\int_{\frac{\pi}{4}}^{\frac{\pi}{3}}\tan^5 x\sec^4 x\,dx\)
Hint.
Use \(u=\tan x\text{,}\) so \(du=\sec^2 x\,dx\text{,}\) and rewrite \(\tan^5 x\sec^4 x\) as \(\tan^5 x\sec^2 x\brac{\sec^2 x\,dx}=\tan^5 x(1+\tan^2 x)\brac{\sec^2 x\,dx}\text{.}\)
Answer.
\(\frac{43}{3}\)

Exercise Group 6.5.10. ★★★ Mixed and Challenging Integrals.

Evaluate each integral.
(a)
\(\int \sqrt{x}\sin^2(x^{3/2}-1) \,dx\)
Hint.
\(u=x^{3/2}-1\text{,}\) leads to \(\int \sin^2{u} \,du\text{.}\)
Answer.
\(\frac{1}{3}(x^{3/2}-1)-\frac{1}{6}\sin\brac{2(x^{3/2}-1)}+C\)
(b)
\(\int \sin(2x) \cos^4{x} \,dx\)
Hint.
Use \(\sin(2x) = 2\sin{x} \cos{x}\text{,}\) leads to \(\int 2\sin{x} \cos^5{x} \,dx\text{.}\)
Answer.
\(-\frac{1}{3} \cos^6{x} + C\)
(c)
\(\int x\csc(x^2)\cot(x^2)\,dx\)
Hint.
Use \(u=x^2\text{,}\) leads to \(\int \csc{u}\cot{u} \,du\text{.}\)
Answer.
\(-\frac{1}{2}\csc(x^2)+C\)
(d)
\(\int \frac{\csc^4 x}{\cot^2 x}\,dx\)
Hint.
Rewrite in terms of sine and cosine, leads to \(\int \brac{\sec^2 x+\csc^2 x} \,dx\text{.}\)
Answer.
\(\tan x-\cot x+C\)
(e)
\(\int \frac{\csc^2 x}{\cot^3 x}\,dx\)
Hint.
Rewrite in terms of sine and cosine, leads to \(\int \tan x\sec^2 x \,dx\text{,}\) then use \(u=\tan x\text{.}\)
Answer.
\(\frac{1}{2}\tan^2 x+C\)
(f)
\(\int \frac{dx}{\cos^2 x\sqrt{1+\tan x}}\)
Hint.
Rewrite as \(\int \frac{\sec^2 x}{\sqrt{1+\tan x}}\,dx\text{,}\) then use \(u=1+\tan x\text{.}\)
Answer.
\(2\sqrt{1+\tan x}+C\)
(g)
\(\int \frac{\sin(2x)}{1+\cos^2 x}\,dx\)
Hint.
Use \(\sin(2x)=2\sin x\cos x\text{,}\) then let \(u=1+\cos^2 x\text{,}\) leads to \(\int \frac{1}{u} \,du\text{.}\)
Answer.
\(-\ln(1+\cos^2 x)+C\)
(h)
\(\int \csc^2(2x)\cot(2x)\,dx\) using two methods:
  1. Using \(u=\cot(2x)\text{.}\)
  2. Using \(u=\csc(2x)\text{.}\)
Hint.
(a) \(du=-2\csc^2(2x)\,dx\text{.}\) (b) \(du=-2\csc(2x)\cot(2x)\,dx\text{,}\) so write the integrand as \(\csc(2x)\brac{\csc(2x)\cot(2x)\,dx}\text{.}\)
Answer.
(a) \(-\frac{1}{4}\cot^2(2x)+C\text{.}\) (b) \(-\frac{1}{4}\csc^2(2x)+C\text{.}\)
(i)
\(\int \frac{\cos(\sqrt{x})}{\sqrt{x}\sin^2(\sqrt{x})}\,dx\)
Hint.
Use \(u=\sin(\sqrt{x})\text{,}\) so \(du=\frac{\cos(\sqrt{x})}{2\sqrt{x}}\,dx\text{.}\)
Answer.
\(-\frac{2}{\sin(\sqrt{x})}+C\)
(j)
\(\int \frac{\tan^2 x}{\csc x}\,dx\)
Hint.
Rewrite in terms of sine and cosine, leads to \(\frac{\sin^3 x}{\cos^2 x}=\frac{\sin x(1-\cos^2 x)}{\cos^2 x}\text{,}\) then use \(u=\cos x\text{.}\)
Answer.
\(\sec x+\cos x+C\)
(k)
\(\int \frac{\cot x}{\cos^2 x}\,dx\)
Hint.
Rewrite as \(\frac{\sec^2 x}{\tan x}\text{,}\) then let \(u=\tan x\text{.}\)
Answer.
\(\ln|\tan x|+C\)
(l)
\(\int \frac{\sec^3 x}{\tan x}\,dx\)
Hint.
Rewrite in terms of sine and cosine, leads to \(\frac{1}{\sin x\cos^2 x}=\sec x\tan x+\csc x\text{.}\)
Answer.
\(\sec x+\ln\abs{\tan\brac{\frac{x}{2}}}+C\)
(m)
\(\int \frac{\cos x+\sin^3 x}{\sec x}\,dx\)
Hint.
Split the fraction, leads to \(\int \cos^2 x\,dx+\int \sin^3 x\cos x\,dx\text{,}\) then use the power-reducing formula for \(\cos^2 x\text{,}\) and use \(u=\sin x\) for the 2nd integral.
Answer.
\(\frac{1}{2}x+\frac{1}{4}\sin(2x)+\frac{1}{4}\sin^4 x+C\)
(n)
\(\int \frac{\tan^3(\ln x)}{x}\,dx\)
Hint.
Use \(u=\ln x\text{,}\) then write \(\tan^3 u=\tan u(\sec^2 u-1)\text{.}\)
Answer.
\(\frac{1}{2}\tan^2(\ln x)+\ln\abs{\cos(\ln x)}+C\)

Exercise Group 6.5.11. ★★★★ Advanced (Multiple Techniques Required).

Evaluate each integral.
(a)
\(\int_{-\frac{\pi}{3}}^0 2\sec^3 x\,dx\)
Hint.
Use the formula \(\int \sec^3 x\,dx=\frac{1}{2}\sec x\tan x+\frac{1}{2}\ln|\sec x+\tan x|+C\text{,}\) then evaluate from \(-\frac{\pi}{3}\) to \(0\text{.}\)
Answer.
\(2\sqrt{3}+\ln(2+\sqrt{3})\)
(b)
\(\int e^x\sec^3(e^x)\,dx\)
Hint.
Use \(u=e^x\text{,}\) so \(du=e^x\,dx\text{,}\) then apply the formula for \(\int \sec^3 u\,du\text{.}\)
Answer.
\(\frac{1}{2}\sec(e^x)\tan(e^x)+\frac{1}{2}\ln|\sec(e^x)+\tan(e^x)|+C\)
(c)
\(\int x\sin^2 x\,dx\)
Hint.
Use \(\sin^2 x=\frac{1-\cos(2x)}{2}\text{,}\) then integrate \(\int \frac{x}{2}\,dx-\frac{1}{2}\int x\cos(2x)\,dx\text{,}\) using integration by parts on the second integral.
Answer.
\(\frac{1}{4}x^2-\frac{1}{4}x\sin(2x)-\frac{1}{8}\cos(2x)+C\)
(d)
\(\int x\cos^3 x\,dx\)
Hint.
First rewrite \(\cos^3 x=\cos x(1-\sin^2 x)\) and integrate \(\cos^3 x\) using \(u=\sin x\text{,}\) then use integration by parts with \(u=x\) and \(dv=\cos^3 x\,dx\text{.}\)
Answer.
\(x\sin x-\frac{1}{3}x\sin^3 x+\frac{2}{3}\cos x+\frac{1}{9}\cos^3 x+C\)

Subsection 6.5.6 More Complicated Tangent and Secant Integrals

For an integral of tangent and secant, the integral is more complicated if the exponent of secant is odd, and the exponent of tangent is even. In this case, there isn’t a straightforward technique, and we have to be creative.

Example 6.5.23. Secant 3rd Power.

Evaluate \(\int \sec^3{x} \,dx\text{.}\)
Solution.
This is more tricky. It turns out that one way is to use integration by parts, by splitting the integral as,
\begin{align*} \amp= \int \sec{x} \cdot \sec^2{x}\,dx \end{align*}
Then,
\(u = \sec{x}\) \(v = \tan{x}\)
\(\downarrow\) \(\uparrow\)
\(du = \sec{x} \tan{x} \,dx\) \(dv = \sec^2{x} \,dx\)
Then,
\begin{align*} \amp= \sec{x} \tan{x} - \int \tan{x} \cdot \sec{x} \tan{x} \,dx\\ \amp= \sec{x} \tan{x} - \int \brac{\sec^2{x} - 1} \sec{x} \,dx\\ \amp= \sec{x} \tan{x} - \int \sec^3{x} \,dx + \int \sec{x} \,dx \end{align*}
The original integral \(\int \sec^3{x} \,dx\) appears on the right-hand side. Then, combining them together,
\begin{align*} 2 \int \sec^3{x} \,dx \amp= \sec{x} \tan{x} + \int \sec{x} \,dx \end{align*}
For \(\int \sec{x} \,dx\text{,}\) recall that \(\int \sec{x} \,dx = \ln{\abs{\sec{x} + \tan{x}}} + C\text{.}\) Putting it all together,
\begin{align*} \int \sec^3{x} \,dx \amp= \frac{1}{2} \sec{x} \tan{x} + \frac{1}{2} \ln{\abs{\sec{x} + \tan{x}}} + C \end{align*}
A very interesting pattern is that on the right-hand side, there is \(\sec{x} \tan{x}\) which is the derivative of \(\sec{x}\text{,}\) and \(\ln{\abs{\sec{x} + \tan{x}}}\) which is the integral of \(\sec{x}\text{.}\) In other words, the integral of secant cubed is the average of the derivative and integral of secant.

Example 6.5.24. Integral of \(\tan^2{x} \sec{x}\).

Evaluate \(\int \tan^2{x} \sec{x} \,dx\text{.}\)
Solution.
Here, the exponent of secant is 1 which is odd, and the exponent of tangent is 2 which is even, so this is the case where there isn’t a straightforward technique. It turns out, the trick is to use the identity \(\tan^2{x} = \sec^2{x} - 1\text{,}\)
\begin{align*} \amp= \int (\sec^2{x} - 1) \sec{x} \,dx\\ \amp= \int (\sec^3{x} - \sec{x}) \,dx\\ \amp= \int \sec^3{x} \,dx - \int \sec{x} \,dx \end{align*}
These are 2 integrals which we have seen before,
  • For \(\int \sec^3{x} \,dx\text{,}\) we can use integration by parts, by splitting the integral as \(\int \sec{x} \cdot \sec^2{x}\,dx\text{.}\)
  • For \(\int \sec{x} \,dx\text{,}\) this is a standard integral, and recall that \(\int \sec{x} \,dx = \ln{\abs{\sec{x} + \tan{x}}} + C\text{.}\)
\begin{align*} \amp= \frac{1}{2} \sec{x} \tan{x} + \frac{1}{2} \ln{\abs{\sec{x} + \tan{x}}} - \ln{\abs{\sec{x} + \tan{x}}} + C\\ \amp= \frac{1}{2} \sec{x} \tan{x} - \frac{1}{2} \ln{\abs{\sec{x} + \tan{x}}} + C \end{align*}

Exercise Group 6.5.12. Evaluate Each Integral.

Evaluate each integral.
(a)
\(\int \tan^2{x} \sec^3{x} \,dx\)
Hint.
Use \(\tan^2{x} = \sec^2{x} - 1\text{,}\) and split the integral as \(\int \sec^5{x} \,dx - \int \sec^3{x} \,dx\text{.}\) Use integration by parts on \(\int \sec^5{x} \,dx\text{,}\) which will result in the same integral appearing \(\int \tan^2{x} \sec^3{x} \,dx\text{.}\) Solve for the integral.
Answer.
\(\frac{1}{4} \sec^3{x} \tan{x} - \frac{1}{8} \sec{x} \tan{x} - \frac{1}{8} \ln{\abs{\sec{x} + \tan{x}}} + C\)
(b)
\(\int \tan^4 x\sec^3 x\,dx\)
Hint.
Use \(\tan^4 x=(\sec^2 x-1)^2\text{,}\) expand, and integrate \(\int \sec^7 x\,dx-2\int \sec^5 x\,dx+\int \sec^3 x\,dx\) using the reduction formulas for odd powers of secant.
Answer.
\(\frac{1}{6}\sec^5 x\tan x-\frac{7}{24}\sec^3 x\tan x+\frac{1}{16}\sec x\tan x+\frac{1}{16}\ln|\sec x+\tan x|+C\)