Skip to main content

Section 3.2 Trigonometric Integrals

This section develops techniques for evaluating indefinite integrals involving trigonometric functions.

Subsection 3.2.1 Products of Trigonometric Functions

We first integrate functions of the form \(\sin(mx)\sin(nx)\text{,}\) \(\cos(mx)\cos(nx)\text{,}\) and \(\sin(mx)\cos(nx)\text{.}\) The key idea is to rewrite a product as a sum using identities from AppendixΒ A. Here is an alternate derivation using Euler’s formula.
\begin{gather} \cos(\theta) = \frac{e^{i\theta} + e^{-i\theta}}{2}, \qquad \sin(\theta) = \frac{e^{i\theta} - e^{-i\theta}}{2i}\tag{3.4} \end{gather}
For brevity, write \(e_A\) for \(e^{iA}\text{.}\) Then
\begin{equation*} e_Ae_B = e^{iA}e^{iB} = e^{i(A+B)} = e_{A+B}. \end{equation*}
Hence,
\begin{align*} \sin(A)\sin(B) & = \frac{e_A - e_{-A}}{2i}\frac{e_B-e_{-B}}{2i}\\ -4\sin(A)\sin(B) & = e_Ae_B - e_Ae_{-B} - e_{-A}e_B + e_{-A}e_{-B}\\ -4\sin(A)\sin(B) & = (e_{A+B} + e_{-(A+B)}) - (e_{A-B} + e_{-(A-B)})\\ 2\sin(A)\sin(B) & = \frac{e_{A-B}+e_{-(A-B)}}{2} - \frac{e_{A+B}-e_{-(A+B)}}{2}\\ \sin(A)\sin(B) & = \frac{1}{2}\left(\cos(A-B) - \cos(A+B)\right) \end{align*}
Other product-to-sum identities follow similarly.

Example 3.9.

Compute \(\int \sin(3x)\sin(4x) dx\text{.}\) From the identity above (with \(A=4x\text{,}\) \(B=3x\)),
\begin{equation*} \sin(3x)\sin(4x) = \frac{1}{2}\left(\cos(x) - \cos(7x)\right). \end{equation*}
\begin{align*} \int \sin(3x)\sin(4x) dx &= \frac{1}{2}\left(\int\cos(x)dx - \int\cos(7x)dx\right)\\ & = \frac{1}{2}\sin(x) - \frac{1}{14}\sin(7x) + C. \end{align*}

Checkpoint 3.10.

Compute \(\int \cos(3x)\cos(4x)dx.\)
Solution.
Apply the identity from (A.10).
\begin{align*} \int \cos(3x)\cos(4x)dx &= \frac{1}{2}\left(\int \cos(3x-4x)dx + \int \cos(3x+4x)dx \right)\\ &= \frac{1}{2}\sin(x) + \frac{1}{14}\sin(7x)+C. \end{align*}

Checkpoint 3.11.

Use a suitable identity to evaluate
\begin{equation*} \int \sin(mx)\cos(nx)dx. \end{equation*}
Hint.
Recall the identity in (A.9).
Solution.
\begin{align*} \int \sin(mx)\cos(nx)dx = \int\frac{1}{2}(\sin(m+n)(x) + \sin(m-n)(x))dx\\ &= \begin{cases} -\dfrac{1}{2(m+n)}\cos(m+n)(x) - \dfrac{1}{2(m-n)}\cos(m-n)(x) + C & m \neq n \\ -\dfrac{1}{4m}\cos(2mx) + C & m = n \end{cases} \end{align*}

Subsection 3.2.2 Powers of Trigonometric Functions

Consider integrals of the form
\begin{equation} \int \sin^m(x)\cos^n(x)dx \quad m,n \ge 0.\tag{3.5} \end{equation}
Using
\begin{equation*} \begin{cases} & \cos^2(x) + \sin^2(x) \equiv 1 \\ & d \cos(x) = -\sin(x) dx \\ & d \sin(x) = \cos(x) dx \end{cases} \end{equation*}
the strategy depends on the parity of \(m\) and \(n\text{.}\)
Table 3.12. Summary of strategies (\(*\) stands for an arbitrary non-negative integer.)
form to be integrated strategy
\(\sin^{\text{odd}}(x)\cos^{*}(x) dx\) \(u=\cos(x)\)
\(\sin^{*}(x)\cos^{\text{odd}}(x) dx\) \(u=\sin(x)\)
\(\sin^{\text{even}}(x)\cos^{\text{even}}(x)\) use (A.14)
If either \(m\) or \(n\) is odd, the suggested substitution reduces the integral to \(p(u)\,du\text{,}\) where \(p(u)\) is a polynomial. For example,
\begin{align*} \sin^{2k+1}(x)\cos^m(x)dx &= (\sin^{2}(x))^k\cos^m(x)\sin(x)dx\\ &=-(1-u^2)^k u^m du. \end{align*}
If both \(m\) and \(n\) are odd, either substitution works.
If both \(m\) and \(n\) are even, apply (A.14) to halve the powers. Repeat until an odd power appears, then use one of the cases above.

Example 3.13.

Compute \(\int \sin^5(x)\cos^2(x)dx\text{.}\) Let \(u=\cos(x)\text{.}\)
\begin{align*} \int -(1-u^2)^2 u^2 du &= \int -u^2 + 2u^4 - u^6 du\\ &= -\frac{1}{3}u^3+\frac{2}{5}u^5 - \frac{1}{7}u^7 + C\\ &= -\frac{1}{3}\cos^3 x + \frac{2}{5}\cos^5 x - \frac{1}{7}\cos^7 x + C. \end{align*}

Checkpoint 3.14.

Compute \(\int \sin^4(x)\cos^7(x)dx\text{.}\)
Solution.
Let \(u = \sin(x)\text{.}\)
\begin{align*} \int\sin^4(x)\cos^7(x)dx &= \int u^4(\cos^2(x))^3\cos(x)dx\\ &= \int u^4 (1-u^2)^3\ du\\ &= \frac{1}{5}u^5 - \frac{3}{7}u^7 + \frac{3}{9}u^9 - \frac{1}{11}u^{11} + C\\ & = \frac{1}{5}\sin^5 x - \frac{3}{7}\sin^7 x + \frac{1}{3}\sin^9 x - \frac{1}{11}\sin^{11} x + C. \end{align*}

Checkpoint 3.15.

Compute \(\int \sin^4(x)dx\text{.}\)
Solution.
\begin{align*} \sin^4(x) &= (\sin^2(x))^2 = \left(\frac{1-\cos(2x)}{2}\right)^2\\ &= \frac{1}{4}\left(1 - 2\cos(2x) + \cos^2(2x)\right)\\ &= \frac{1}{4}\left(1 - 2\cos(2x) + \frac{1+\cos(4x)}{2}\right)\\ &= \frac{3}{8} - \frac{\cos(2x)}{2} + \frac{\cos(4x)}{8} \end{align*}
Therefore,
\begin{align*} \int \sin^4(x)dx &= \int\frac{3}{8}dx - \int\frac{\cos(2x)}{2}dx + \int\frac{\cos(4x)}{8}dx\\ &= \frac{3x}{8} - \frac{1}{4}\sin(2x) + \frac{1}{32}\sin(4x) + C. \end{align*}

Checkpoint 3.16.

Compute \(\int \sin^2(3x)\cos^2(3x) dx\text{.}\)
Solution 1.
Let \(w = 3x\text{.}\)
\begin{equation*} \int \sin^2(3x)\cos^2(3x) dx = \frac{1}{3}\int\sin^2(w)\cos^2(w) dw. \end{equation*}
\begin{align*} \int \sin^2(w)\cos^2(w)dw &= \int\frac{1-\cos(2w)}{2}\frac{1+\cos(2w)}{2} dw\\ & = \frac{1}{4} \int 1-\cos^2(2w) \end{align*}
Apply (A.14) to \(\cos^2(2w)\text{:}\)
\begin{align*} \frac{1}{4} \int 1-\cos^2(2w) dw &= \frac{1}{4} \int 1- \frac{1+\cos(4w)}{2} dw\\ &= \frac{1}{8}\int 1 - \cos(4w) dw\\ & = \frac{1}{8}\left(w - \frac{1}{4}\sin(4w)\right) + C\\ & = \frac{3x}{8} - \frac{\sin(12x)}{32} + C \end{align*}
Putting this together,
\begin{align*} \int \sin^2(3x)\cos^2(3x) dx &= \frac{1}{3}\int\sin^2(w)\cos^2(w) dw\\ & = \frac{1}{3}\left(\frac{3x}{8} - \frac{\sin(12x)}{32}\right)+C\\ & = \frac{x}{8} - \frac{\sin(12x)}{96} + C \end{align*}
Solution 2.
We can also use Euler’s formula directly.
\begin{align*} \sin^2(3x)\cos^2(3x) &= \left(\frac{e_{3x}-e_{-3x}}{2i}\right)^2 \left(\frac{e_{3x}+e_{-3x}}{2}\right)^2\\ &=-\frac{1}{16}[(e_{3x}-e_{-3x})(e_{3x}+e_{-3x})]^2\\ & = -\frac{1}{16}(e_{6x} -e_{-6x})^2\\ & = \frac{1}{16}(2-(e_{12x}+e_{-12x}))\\ & = \frac{1}{8}\left(1 - \frac{e_{12x}+e_{-12x}}{2}\right) = \frac{1}{8}(1-\cos(12x)). \end{align*}
\begin{align*} \int \sin^2(3x)\cos^2(3x) dx &= \frac{1}{8} \int 1-\cos(12x) dx\\ & = \frac{x}{8} - \frac{\sin(12x)}{96} + C. \end{align*}
Next consider integrals of the form
\begin{equation} \int \tan^m(x)\sec^n(x) dx = \int \frac{\sin^{m}(x)}{\cos^{n+m}(x)} dx \quad m,n \ge 0\tag{3.6} \end{equation}
If \(m\) is odd, substitute \(u=\cos(x)\) to convert the integrand to negative powers of \(u\text{.}\)

Example 3.17.

Compute \(\displaystyle \int \tan^3(x) \sec^4(x) dx\text{.}\) Let \(u=\cos(x)\text{.}\)
\begin{align*} \int \frac{\sin^2(x) \sin(x)dx}{\cos^{7}(x)} &= \int \frac{-(1-u^2)du}{u^7}\\ &= \int u^{-5} - u^{-7} du\\ &= \frac{1}{6}u^{-6} - \frac{1}{4}u^{-4}+C\\ &= \frac{\sec^6(x)}{6} - \frac{\sec^4(x)}{4} +C \end{align*}
If \(m\) is even, rewrite the integrand in terms of powers of \(\sec(x)\) and use the reduction formula for secant (ItemΒ 3.5.3.d). This reduces the problem to integrating a single power of \(\sec(x)\text{,}\) which we handled earlier (see ExampleΒ 2.7 and half-angle substitutionΒ 3.2.3).

Example 3.18.

Compute \(\int\tan^2(x)\sec(x)dx\text{.}\)
\begin{align*} \int \tan^2(x) \sec(x) dx &= \int (\sec^2(x)-1)\sec(x) dx\\ &= \int \sec^3(x)- \int \sec(x) dx \end{align*}
Using the reduction formula,
\begin{equation*} \int \sec^3(x) dx = \frac{1}{2}\sec(x)\tan(x)+ \frac{1}{2} \int \sec(x) dx. \end{equation*}
\begin{align*} & \frac{1}{2}\sec(x) \tan(x) + \frac{1}{2}\int\sec(x) dx - \int \sec(x) dx\\ &= \frac{1}{2}\left(\sec(x)\tan(x) - \int \sec(x) dx \right)\\ &=\frac{1}{2}\left(\sec(x)\tan(x) - \ln|\sec(x) + \tan(x)|\right) + C. \end{align*}
The strategies above always work, but for high even powers of tangent, the substitution \(u=\tan(x)\) can be shorter.

Example 3.19.

Compute \(\int \tan^{10}(x)\sec^2(x) dx\text{.}\) Let \(u = \tan(x)\text{.}\)
\begin{gather*} \int u^{10} du = \frac{1}{11}u^{11} + C = \frac{1}{11}\tan^{11}(x) + C. \end{gather*}

Example 3.20.

Compute \(\int \tan^{8}(x)dx\text{.}\) Write \(\tan^{8}(x)=\tan^{6}(x)(\sec^2(x) -1)\text{.}\)
\begin{equation*} \tan^{6}(x)(\sec^2(x) -1) = \tan^{6}(x)\sec^2(x) - \tan^{6}(x). \end{equation*}
\begin{align*} \int \tan^{6}(x)\sec^{2}(x) dx - \int \tan^{6}(x) dx\\ & = \frac{1}{7}\tan^{7}(x) - \int \tan^{6}(x)dx. \end{align*}
Repeatedly apply the tangent reduction formula (ItemΒ 3.5.3.c) to obtain
\begin{gather*} \frac{1}{7}\tan^{7}(x) - \frac{1}{5}\tan^{5}(x) + \frac{1}{3}\tan^3(x) - \tan(x) + x + C. \end{gather*}

Checkpoint 3.21.

Compute \(\ds \int \tan^3(x)\sec^2(x) dx\text{.}\)
Hint.
Do it twice: (1) use \(u = \cos(x)\) and (2) use \(u=\tan(x)\text{.}\)
Answer.
The substitution \(u=\tan(x)\) gives \(\frac{\tan^4(x)}{4}+C\text{,}\) and the substitution \(u=\cos(x)\) gives \(\frac{\sec^4(x)}{4} - \frac{\sec^2(x)}{2}+C\text{.}\) These two antiderivatives differ by \(1/4\text{.}\)
Integrals of the form \(\cot^m(x)\csc^n(x) dx\) are handled similarly.

Example 3.22.

\begin{align*} \int \cot^3(x)\csc^3(x)dx &= \int \frac{\cos^3(x)}{\sin^6(x)} dx\\ &=\int \frac{1-\sin^2(x)}{\sin^6(x)} d\sin(x)\\ &=\int (1-u^2)u^{-6} du \qquad (u=\sin(x))\\ &=\int u^{-6} - u^{-4} du = -5u^{-5} + 3u^{-3} +C\\ &=-\frac{\csc(x)^5}{5} + \frac{\csc(x)^3}{3} + C. \end{align*}

Subsection 3.2.3 Half-Angle Substitution

This method converts integrals of rational functions of sine and cosine into rational functions of a single variable, using a parametrization of the unit circle.
Unit circle with a line passing through the point (-1,0) and the point cosine theta comma sine theta
Figure 3.23. Half-Angle Substitution
Intersect the line \(\ell\) with the unit circle to obtain
\begin{equation} \cos \theta = \frac{1-t^2}{1+t^2}, \qquad \sin \theta = \frac{2t}{1+t^2}\tag{3.7} \end{equation}
where \(t = \tan(\theta/2)\) is the slope of the line, hence the name half-angle substitution (also known as the Weierstrass substitution). Since
\begin{align*} dt &= d\tan\left(\frac{\theta}{2}\right) = \frac{1}{2}\sec^2\left(\frac{\theta}{2}\right) d\theta = \frac{1+t^2}{2} d\theta, \end{align*}
for a rational function \(R(x,y)\text{,}\)
\begin{equation*} R(\cos \theta, \sin \theta) d\theta = R\left(\frac{1-t^2}{1+t^2}, \frac{2t}{1+t^2}\right)\frac{2}{1+t^2} dt. \end{equation*}
The right-hand side is a rational function in \(t\text{,}\) which we study systematically in SectionΒ 3.4. For now, apply this to compute the integral of \(\sec(x)\text{.}\)

Example 3.24.

\begin{align*} \int \sec \theta d\theta &= \int \frac{1+t^2}{1-t^2}\frac{2}{1+t^2} dt = \int \frac{2}{1-t^2} dt\\ &= \int \frac{dt}{1-t} + \int \frac{dt}{1+t} = \ln\left|\frac{1+t}{1-t}\right| + C\\ &= \ln\left|\frac{1+\tan(\theta/2)}{1-\tan(\theta/2)}\right|+C. \end{align*}
This agrees with the earlier antiderivative since
\begin{align*} \ln\left|\frac{1+t}{1-t}\right| &= \ln\left|\frac{(1+t)^2}{1-t^2}\right|\\ &= \ln\left|\frac{1+t^2}{1-t^2} + \frac{2t}{1-t^2}\right|\\ &= \ln|\sec \theta + \tan \theta|. \end{align*}