Integration of Trigonometric Functions
Integrals of the form \(\displaystyle \int \sin^m x\, \cos ^n x\,dx\)
The integrals of the form \(\displaystyle \int \sin^m x\, \cos ^n x\,dx\) are very easy to evaluate in the case when one (or both) of the numbers \(m\) and \(n\) is odd integer.
- If \(m\) is odd, assume that \(m=2k+1\). Then the integral can be rewritten as \[ \int \sin^m x\, \cos ^nx\,dx= \int \sin^{2k}x\, \cos^nx\cdot\sin x\,dx.\] The substitution \(u=\cos x\) has \(du=-\sin x\,dx\) and transforms the integral into
\[\int \sin^m x\, \cos ^nx\,dx= -\int (1-u^2)^k u^n\,du\] which is easy to evaluate. If \(k\geq 0\) then \((1-u^2)^k\) can be expanded and the integrand becomes a sum of the functions of the form \(u^{\alpha}\) (where \(\alpha\in\mathbb R\)). If \(k > 0\) and if \(n\) is an integer, then we are dealing with a rational function for which we have a method for integration.
- If \(n\) is odd, we may assume that \(n=2l+1\) for some integer \(l\). The integral can be rewritten as
\[\int \sin^mx\, \cos^nx\,dx=\int\sin^mx \, \cos^{2l}x \cdot\cos x\,dx.\] The substitution \(u=\sin x\) has \(du=\cos x\,dx\) and simplifies the integral in the following way:
\[\int \sin^mx\, \cos^nx\,dx=\int u^m(1-u^2)^l\,du.\] Similarly as in the above paragraph we can solve this integral in the case when \(l\geq 0\) and \(m\) is an arbitrary real number, or when \(l < 0\) and \(m\) is an integer.
Example 1
Evaluate the integral \(\displaystyle \int \sqrt[3]{\cos x}\cdot \sin^3x\,dx\).
We first rewrite the integral in the form: \[ \int \sqrt[3]{\cos x}\cdot \sin^3x\,dx=\int \left(\cos x\right)^{\frac13} \sin^2x \cdot \sin x\,dx.\]
We now use the substitution \(u=\cos x\). Then we have \(du=-\sin x\,dx\) and the integral becomes:
\begin{eqnarray*} \int \sqrt[3]{\cos x}\cdot \sin^3x\,dx&=&-\int u^{\frac13}\cdot (1-u^2)\,du=-\int u^{\frac13}\,du+\int u^{\frac73}\,du\\&=&-\frac34u^{\frac43}+\frac3{10}u^{\frac{10}3}+C\\&=&
-\frac34 \cos^{\frac43}x+\frac{3}{10}\cos^{\frac{10}3}x+C.
\end{eqnarray*}
Example 2
Evaluate the integral \(\displaystyle \int \sec x\,dx=\int\frac1{\cos x}\,dx\).
We first rewrite the integral in the form: \[ \int \frac1{\cos x}\,dx=\int \frac{\cos x}{\cos^2x}\,dx.\]
We now use the substitution \(u=\sin x\). Then we have \(du=\cos x\,dx\) and the integral becomes:
\begin{eqnarray*} \int \frac1{\cos x}\,dx&=& \int\frac{du}{1-u^2}=\int\frac1{(1-u)(1+u)}\,du\\
&=&\frac12\int \frac1{1-u}\,du+\frac12\int\frac1{1+u}\,du=-\frac12\ln\left|1-u\right|+\frac12\ln\left|1+u\right|+C\\
&=&\frac12\ln\left|\frac{1+u}{1-u}\right|+C=\frac12\ln\left|\frac{1+\sin x}{1-\sin x}\right|+C =\frac12\ln\left|\frac{1+\sin x}{1-\sin x}\cdot\frac{1+\sin x}{1+\sin x}\right|+C\\&=&
\frac12\ln\left|\frac{\left(1+\sin x\right)^2}{\cos^2x}\right|+C=\ln\left|\frac{1+\sin x}{\cos x}\right|+C\\
&=&\ln\left|\sec x+\tan x\right|+C.
\end{eqnarray*}
If both \(m\) and \(n\) are even, then use the formulas \(\cos^2\theta=\frac{1+\cos(2\theta)}2\) and \(\sin^2\theta=\frac{1-\cos(2\theta)}2\) to reduce them to the previous case.
Example 3
Evaluate the integral \(\displaystyle \int \cos^4x\,\sin^2 x\,dx\).
Using the formulas \(\cos^2\theta=\frac{1+\cos(2\theta)}2\) and \(\sin^2\theta=\frac{1-\cos(2\theta)}2\) we transform the integral in the equivalent form: \[ \int \cos^4x\,\sin^2 x\,dx= \int \left(\frac{1+\cos(2x)}2\right)^2\cdot\frac{1-\cos(2x)}2\,dx=\frac18\int \left(1+\cos(2x)\right)^2 \left(1-\cos(2x)\right)\,dx.\]
We now use the substitution \(u=2x\). Then \(dx=\frac12du\), hence
\begin{eqnarray*} \int \cos^4x\,\sin^2 x\,dx&=&\frac1{16}\int (1+\cos u)^2(1-\cos u)\,du=\frac1{16}\int\left(1+2\cos u+\cos^2 u\right)\left(1-\cos u\right)\,du\\
&=&\frac1{16}\left(\int 1\,du+\int \cos u\,du-\int \cos^2 u\,du -\int \cos^3 u\,du\right).
\end{eqnarray*}
The first two integrals are easy, and they are equal to \(u+C\) and \(\sin u+C\), respectively.
The last integral is of the form \(\displaystyle \int \sin^mx\,\cos^n x\,dx\) where \(m=0\) and \(n=3\), which due to the fact that \(n\) is odd can be solved using the substitution \(v=\sin u\):
\[\int \cos^3u\,du=\int \cos^2u\cdot \cos u\,du=\int (1-v^2)\,dv=v-\frac13v^3+C=\sin u-\frac13\sin^3u+C.\]
The third integral \(\int \cos^2u\,du\) is solved in the following way:
\[\int\cos^2u\,du=\int\frac{1+\cos(2u)}2\,du=\frac12u+\frac14\sin(2u).\]
Therefore, \begin{eqnarray*} \int \cos^4x\,\sin^2 x\,dx&=&
\frac1{16}\left(u+\sin u-\frac12u-\frac14\sin(2u)-\sin u+\frac13\sin^3u\right)+C\\
&=&\frac1{16}\left(x-\frac14\sin(4x)+\frac13\sin^3(2x)\right)+C
\end{eqnarray*}
Integrals of the form \(\displaystyle \int \frac{P(\tan x)}{Q(\tan x)}\,dx\)
If the integrand is a rational function of \(\tan x\) the substitution \(\tan x=t\) transforms the integral in a rational function because \(x=\tan^{-1}t\) and consequently \(dx=\frac1{1+t^2}\,dt\) which is rational function as well.
It is worth noting that many integrals that do not appear to be of this form can be re-written as rational functions of \(\tan\) by dividing both numerator and denominator by the appropriate factor.
Example 3
Evaluate the integral \(\displaystyle \int \frac{2\sin^3x+\sin^2x\cos x-4\sin x\cos^2x+3\cos^3x}{\left(\sin^2x-\sin x\cos x-2\cos^2x\right)\cos x}\,dx\).
We divide both numerator and denominator by \(\cos^3 x\). The integral becomes
\[ \int \frac{2\sin^3x+\sin^2x\cos x-4\sin x\cos^2x+3\cos^3x}{\left(\sin^2x-\sin x\cos x-2\cos^2x\right)\cos x}\,dx=\int\frac{2\tan^3x +\tan^2 x-4\tan x+3}{\tan^2x -\tan x-2}\,dx.\]
Using the substitution \(\tan x=t\) we have \(dx=\frac1{1+t^2}\,dt\) and the integral is further equal to:
\[\int \frac{2\sin^3x+\sin^2x\cos x-4\sin x\cos^2x+3\cos^3x}{\left(\sin^2x-\sin x\cos x-2\cos^2x\right)\cos x}\,dx=\int\frac{2t^3+t^2-4t+3}{(t-2)(t+1)(t^2+1)}\,dt.\]
Using the method of partial fractions we find the following representation of the integrand:
\[
\frac{2t^3+t^2-4t+3}{(t-2)(t+1)(t^2+1)}=\frac1{t-2}-\frac1{t+1}+\frac{2t}{t^2+1}.\]
Therefore we have:
\begin{eqnarray*} \int \frac{2\sin^3x+\sin^2x\cos x-4\sin x\cos^2x+3\cos^3x}{\left(\sin^2x-\sin x\cos x-2\cos^2x\right)\cos x}\,dx&=&
\int\frac1{t-2}\,dt-\int\frac{1}{t+1}\,dt+\int \frac{2t}{t^2+1}\,dt\\
&=&\ln\left|t-2\right|-\ln\left|t+1\right|+\ln\left|t^2+1\right|+C\\
&=&\ln\left|\tan x-2\right|-\ln\left|\tan x+1\right|+\ln\left|\frac1{\cos^2x}\right|+C\\
&=&\ln\left|\tan x-2\right|-\ln\left|\tan x+1\right|-2\ln\left|\cos x\right|+C.
\end{eqnarray*}
Integrals of the form \(\displaystyle \int\frac{P(\sin x, \cos x)}{Q(\sin x, \cos x)}\,dx\)
The magical substitution \(u=\tan\frac{x}2\) can bring the most general trigonometric integral to an integral of a rational function.
The the substitution owes its power to the fact that \(dx\), \(\sin x\), and \(\cos x\) can be expressed in terms of \(u\) in a relatively simple manner. First of all, \(x=2\tan^{-1}u\) and \(dx=\frac{2du}{u^2+1}\). We need to express \(\sin x\) and \(\cos x\) in terms of \(u\).
\begin{eqnarray*}\sin x&=&2\sin\frac{x}2\cos\frac{x}2=2\frac{\sin{x}2}{\cos\frac{x}2}\cdot\cos^2\frac{x}2=2\tan\frac{x}2\cdot \frac1{\frac1{\cos^2\frac{x}2}}=\frac{2u}{1+u^2}\\
\cos x&=&\cos^2\frac{x}2-\sin^2\frac{x}2=\cos^2\frac{x}2\left(1-\tan\frac{x}2\right)=\frac1{\frac1{\cos^2\frac{x}2}}\left(1-u^2\right)=\frac{1-u^2}{1+u^2}.\end{eqnarray*}
Let us summarize the substitution: \begin{eqnarray*}
u&=&\tan\frac{x}2\\
dx&=&\frac{2\,du}{u^2+1}\\
\sin x&=&\frac{2u}{u^2+1}\\
\cos x&=&\frac{1-u^2}{1+u^2}.\end{eqnarray*}
Example 4
Evaluate the integral \(\displaystyle \int\frac{1}{1+\sin x}\,dx\).
The substitution \(u=\tan\frac{x}2\) transforms the integral into:
\begin{eqnarray*} \int \frac1{1+\sin x}\,dx&=&\int\frac{\frac{2\,du}{1+u^2}}{1+\frac{2u}{1+u^2}}
=\int\frac{2\,du}{1+u^2+2u}\\
&=&\int\frac{2\,du}{(1+u)^2}=-\frac2{1+u}+C=-\frac2{ 1+\tan\frac{x}2}+C.
\end{eqnarray*}
In the beginning we learned how to use the substitutions \(u=\sin x\), \(u=\cos x\), and \(u=\tan x\). This paragraph showed that these substitutions are unnecessary, as the substitution \(u=\tan\frac{x}2\) is more powerful than any of the substitutions we covered. However, the integrals resulting from substituting \(u=\tan\frac{x}2\) may be very unpleasant. One should attempt to use \(u=\sin x\), \(u=\cos x\), or \(u=\tan x\) whenever possible.
Practice problems
Problem 1. Evaluate the integral \(\displaystyle \int \sin^{10}x\cos x \,dx\).
We will use the substitution \(\sin x=u\). Then we have \(du=\cos x\,dx\) and the integral becomes:
\[ \int \sin^{10}x\cos x \,dx=\int u^{10}\,du=\frac1{10+1}u^{10+1}+C=\frac{\sin^{10+1}x}{10+1}+C.\]
Problem 2. Evaluate the integral \(\displaystyle \int \sin^3 x\cos^{6}x\,dx\).
We will use the substitution \(u=\cos x\). Then \(du=-\sin x\,dx\). The integral is equivalent to:
\begin{eqnarray*}\int \sin^3 x\cos^{6}x\,dx&=&\int \left(1-\cos^2x\right)\cos^{6}x \cdot \sin x\,dx=-\int \left(1-u^2\right)u^{6}\,du
\\&=& -\frac{u^{6+1}}{6+1}+\frac{u^{6+3}}{6+3}+C=-\frac{\cos^9x}9+\frac{\cos^{11}x}{11}+C.
\end{eqnarray*}
Problem 3. Evaluate the integral \(\displaystyle \int_0^{\frac{\pi}4}\frac{ 3\sin x +2 \cos x}{ 4\sin x+ 3\cos x} \,dx\).
The original integral can be rewritten in the form:
\[\int_0^{\frac{\pi}4}\frac{ 3\sin x +2 \cos x}{ 4\sin x+ 3\cos x} \,dx=\int_0^{\frac{\pi}4}\frac{3\tan x +2}{4\tan x+3}\,dx.\]
We will use the substitution \(u=\tan x\). Then we have \(x=\tan^{-1}u\) and \(\displaystyle dx=\frac{1}{1+u^2}\,du\). The bounds for \(u\) are \(0\leq u\leq 1\) and the integral becomes
\[\int_0^{\frac{\pi}4}\frac{ 3\sin x +2 \cos x}{ 4\sin x+ 3\cos x} \,dx=\int_0^1\frac{ 3 u +2}{(4u+3)\left(u^2+1\right)}\,du.\]
The integral is reduced to the integral of a rational function. We need to find constants \(\alpha\), \(\beta\), and \(\gamma\) such that:
\[\frac{ 3 u +2}{(4u+3)\left(u^2+1\right)}=\frac{\alpha}{4u+3}+\frac{\beta u+\gamma}{4u+3}.\]
Using methods described in the section _link_i1|Integration of rational functions|676_link_ we find that \(\alpha=\frac{-4}{25}\), \(\beta=\frac{1}{25}\), and \(\gamma=\frac{18}{25}\). Thus the integral reduces to:
\begin{eqnarray*}\int_0^1\frac{ 3 u +2}{(4u+3)\left(u^2+1\right)}\,du&=&\frac{-4}{25}\cdot \int_0^1 \frac1{4u+3}\,du +\frac{1}{25}\cdot \int_0^1\frac{u\,du}{u^2+1} +\frac{18}{25}\cdot \int_0^1\frac{du}{u^2+1}\\
&=&\left.\frac{-4}{25}\cdot \frac1{4}\cdot \ln\left|4u+3\right|\right|_{u=0}^{u=1} +\frac{1}{25}\cdot\left.\frac12\cdot \ln\left|u^2+1\right|\right|_{u=0}^{u=1} +\frac{18}{25} \cdot \left. \tan^{-1}u\right|_{u=0}^{u=1}\\
&=&-\frac{1}{25}\ln\frac{7}{3\sqrt2}+\frac{9}{50}\pi.
\end{eqnarray*}
Problem 4. Evaluate the integral \(\displaystyle \int_0^{\frac{\pi}2}\frac1{6+10\cos x}\,dx\).
We will use the substitution \(u=\tan\frac{x}2\). Then we have:
\begin{eqnarray*}
u&=&\tan\frac{x}2\\
dx&=&\frac{2\,du}{u^2+1}\\
\sin x&=&\frac{2u}{u^2+1}\\
\cos x&=&\frac{1-u^2}{1+u^2}\\
0\leq &u&\leq 1.\end{eqnarray*}
The bounds for \(u\) have been obtained in the following way. The bounds for \(x\) were \(0\) and \(\frac{\pi}2\). The corresponding bounds for \(\frac{x}2\) are \(0\) and \(\frac{\pi}4\), hence the bounds for \(u\) are \(\tan 0=0\) and \(\tan\frac{\pi}4=1\).
The integral now becomes:
\begin{eqnarray*}
\int_0^{\frac{\pi}2}\frac1{6 +10\cos x}\,dx&=&\int_0^1\frac{\frac{2\,du}{1+u^2}}{6+10\frac{1-u^2}{1+u^2}}=\int_0^1\frac{2\,du}{(6+10)-(10 -6)u^2}=\int_0^1 \frac{2\,du}{16 -4u^2}\\
&=&\int_0^1\frac{2\,du}{(4+2u)(4-2u)}= \int_0^1\left(\frac1{4\left(4+2u\right)}+\frac1{4\left(4-2u\right)}\right)\,du\\
&=&\frac1{4}\int_0^1\frac1{4+2u}\,du+\frac1{4}\int_0^1\frac1{4-2u}\,du\\
&=&\left.\frac1{8}\ln\left|\frac{4+2u}{4-2u}\right|\right|_0^1=\frac1{8}\ln\left|\frac{4+2}{4-2}\right|\\
&=&\frac1{8}\ln3.
\end{eqnarray*}
Problem 5. Evaluate the integral \(\displaystyle \int_0^{\frac{\pi}2}\frac1{10-6\cos x}\,dx\).
We will use the substitution \(u=\tan\frac{x}2\). Then we have:
\begin{eqnarray*}
u&=&\tan\frac{x}2\\
dx&=&\frac{2\,du}{u^2+1}\\
\sin x&=&\frac{2u}{u^2+1}\\
\cos x&=&\frac{1-u^2}{1+u^2}\\
0\leq &u&\leq 1\end{eqnarray*}
The bounds for \(u\) have been obtained in the following way. The bounds for \(x\) were \(0\) and \(\frac{\pi}2\). The corresponding bounds for \(\frac{x}2\) are \(0\) and \(\frac{\pi}4\), hence the bounds for \(u\) are \(\tan 0=0\) and \(\tan\frac{\pi}4=1\).
The integral now becomes:
\begin{eqnarray*}
\int_0^{\frac{\pi}2}\frac1{10 -6\cos x}\,dx&=&\int_0^1\frac{\frac{2\,du}{1+u^2}}{10-6\frac{1-u^2}{1+u^2}}=\int_0^1\frac{2\,du}{(10-6)+(106)u^2}=\int_0^1 \frac{2\,du}{4 +16u^2}\\
&=&\frac1{16}\int_0^1\frac{2\,du}{\frac14+u^2}=\left.\frac2{8}\tan^{-1}\left(2u\right)\right|_0^1=\frac2{8}\tan^{-1}2.
\end{eqnarray*}
In the last line we used the formula \(\displaystyle \int\frac{1}{x^2+a^2}\,dx=\frac1a\tan^{-1}\frac{x}a+C\).