Differentials and integrals: Integration techniques
Integrating trigonometric expressions
If you want to integrate mathematical expressions with trigonometric functions, it will come as no surprise that trigonometric identities play an important role. The main players are: \[\begin{aligned} \cos^2(x)+\sin^2(x)&=1\\[0.25cm] \sin(2x)&=2\sin(x)\cos(x)\\[0.25cm] \cos(2x)&=\cos^2(x)-\sin^2(x)\\ &=2\cos^2(x)-1\\ &=1-2\sin^2(x)\end{aligned}\] The final doubling formula teaches you how to rewrite squares of sine and cosine: \[\begin{aligned}\cos^2(x)&=\tfrac{1}{2}\bigl(\cos(2x)+1\bigr)\\[0.25cm] \sin^2(x)&=\tfrac{1}{2}\bigl(\cos(2x)-1\bigr)\end{aligned}\] This leads to the examples below.
Example 1 Calculate the following integral \[\int\sin(x)^2\,\dd x\]
Solution \[\begin{aligned} \int\sin(x)^2\,\dd x &= \frac{1}{2}\int \bigl(\cos(2x)-1\bigr)\,\dd x\\&\phantom{abcxyz}\blue{\text{because }\sin^2(x)=\tfrac{1}{2}\bigl(\cos(2x)-1\bigr)}\\[0.25cm] &=\frac{1}{4}\sin(2x)-\frac{1}{2}x+c\end{aligned}\]
Example 2 Calculate the following integral \[\int\cos(x)^4\,\dd x\]
Solution \[\begin{aligned} \int\cos^4(x)\,\dd x &= \frac{1}{4}\int \bigl(\cos(2x)+1\bigr)^2\,\dd x\\&\phantom{abcxyz}\blue{\text{because }\cos^2(x)=\tfrac{1}{2}\bigl(\cos(2x)+1\bigr)}\\[0.25cm] &=\frac{1}{4}\int\left(\cos^2(2x)+2\cos(2x)+1\right)\,\dd x\\&\phantom{abcxyz}\blue{\text{because }(a+b)^2=a^2+2ab+b^2}\\[0.25cm]&=\frac{1}{8}\int\left(\cos(4x)+1\right)\,\dd x+\frac{1}{4}\sin(2x)+\frac{1}{4}x\\&\phantom{abcxyz}\blue{\text{because }\cos^2(2x)=\tfrac{1}{2}\bigl(\cos(4x)+1\bigr)}\\[0.25cm]&= \frac{1}{32}\sin(4x)+\frac{1}{8}x+\frac{1}{4}\sin(2x)+\frac{1}{4}x+c\\[0.25cm]&=\frac{1}{32}\sin(4x)+\frac{1}{4}\sin(2x)+\frac{3}{8}x+c \end{aligned}\]
What also works for trigonometric functions is the substitution \(t=\tan(\tfrac{1}{2}x)\), or equivalently \(x=2\arctan(x)\). This becomes \[\sin(x)=\frac{2t}{1+t^2},\quad \cos(x)=\frac{1-t^2}{1+t^2},\quad\text{and}\quad \dd x =\frac{2}{1+t^2}\,\dd t.\] From rational functions of \(\sin(x)\) and \(\cos(t)\) we get rational functions of \(t\). This method sometimes leads to a lot of calculation work and the substitution \(s=\tan(x)\) is often also useful: this makes \[\sin^2(x)=\frac{s^2}{1+s^2},\quad\cos^2(x)=\frac{1}{1+s^2},\quad \text{and}\quad \dd x = \frac{1}{1+s^2}\,\dd s.\] Two examples:
Example 3 Calculate the following integral \[\int\frac{1}{\cos(x)}\,\dd x\]
Solution \[\begin{aligned} \int\frac{1}{\cos(x)}\,\dd x &= \int \frac{1+t^2}{1-t^2}\cdot \frac{2}{1+t^2}\,\dd t\\[0.25cm]&\phantom{abcxyz}\blue{\tan(\tfrac{1}{2}x)\text{ substitution}}\\[0.25cm] &=\int\frac{2}{1-t^2}\,\dd t\\&\phantom{abcxyz}\blue{\text{simplification}}\\[0.25cm] &=\int\left(\frac{1}{1+t}+\frac{1}{1-t}\right)\,\dd t\\&\phantom{abcxyz}\blue{\text{partial fraction decomposition}}\\[0.25cm] &=\ln|1+t|-\ln|1-t|+c\\[0.25cm] &= \ln\left|\frac{1+t}{1-t}\right|+c\\[0.25cm] &= \ln\left|\frac{1+\tan(\tfrac{1}{2}x)}{1-\tan(\tfrac{1}{2}x)}\right|+c\\[0.25cm]&= \ln\left|\frac{\cos(\tfrac{1}{2}x+\sin(\tfrac{1}{2}x)}{\cos(\tfrac{1}{2}x)-\sin(\tfrac{1}{2}x)}\right|+c\\[0.25cm]&= \ln\left|\tan(x)+\frac{1}{\cos(x)}\right|+c\\[0.25cm]&\phantom{abcxyz}\blue{\text{because }\frac{\cos(u)+\sin(u)}{\cos(u)-\sin(u)} =\tan(2u)+\frac{1}{\cos(2u)}}\\ &\phantom{abcxyz}\blue{\text{according to trigonometric identities}}\\[0.25cm] &=\ln\bigl|\tan(x)+\sec(x)\bigr|+c\\ &\phantom{abcxyz}\blue{\text{where }\sec(x)=\frac{1}{\cos(x)}}\end{aligned}\]
Example 4 Calculate the following integral \[\int\frac{1}{1+\sin(x)}\,\dd x\]
Solution \[\begin{aligned} \int\frac{1}{1+\sin(x)}\,\dd x &= \int \frac{1}{1+\dfrac{2t}{1+t^2}}\cdot \frac{2}{1+t^2}\,\dd t\\[0.25cm]&\phantom{abcxyz}\blue{\tan(\tfrac{1}{2}x)\text{ substitution}}\\[0.25cm] &=\int\frac{2}{t^2+2t+1}\,\dd t\\&\phantom{abcxyz}\blue{\text{simplification}}\\[0.25cm] &=\int\frac{2}{(1+t)^2}\,\dd t\\&\phantom{abcxyz}\blue{\text{factorisation}}\\[0.25cm] &=-\frac{2}{1+t}+c\\[0.25cm] &= -\frac{2}{1+\tan(\tfrac{1}{2}x)}+c\end{aligned}\]