11.5 Integration of trigonometric functions

11.5.1 Integral of cos2(x)\cos^{2}(x)

Example 11.5.1

Find the value of

cos2(x)𝑑x\int\cos^{2}(x)dx

Solution: We can’t integrate cos2(x)\cos^{2}(x) directly, so we need to rewrite it first. Of the trigonometric identities, the one which looks most useful is the double-angle formula 33 3 i.e. cos(2x)=cos2(x)sin2(x)cos(2x)=2cos2(x)1cos2(x)=cos(2x)+12\cos(2x)=\cos^{2}(x)-\sin^{2}(x)\implies\cos(2x)=2\cos^{2}(x)-1\implies\cos^{2% }(x)=\frac{\cos(2x)+1}{2}). After rearranging this (see the footnote for details), we can the write that

cos2(x)𝑑x\displaystyle\int\cos^{2}(x)dx =cos(2x)+12𝑑x\displaystyle=\int\frac{\cos(2x)+1}{2}\hskip 2.0ptdx (11.13)
=12cos(2x)+1dx\displaystyle=\frac{1}{2}\int\cos(2x)+1\hskip 2.0ptdx (11.14)
=12[12sin(2x)+x]+c\displaystyle=\frac{1}{2}\left[\frac{1}{2}\sin(2x)+x\right]+c (11.15)
=14sin(x)+12x\displaystyle=\frac{1}{4}\sin(x)+\frac{1}{2}x (11.16)

11.5.2 Integral of sin(x)cos(x)+cos3(x)\frac{\sin(x)}{\cos(x)+\cos^{3}(x)}

Example 11.5.2

Find the value of44 4 This question came from https://madasmaths.com

sin(x)cos(x)+cos3(x)𝑑x\int\frac{\sin(x)}{\cos(x)+\cos^{3}(x)}dx

Solution: We substitute u=sin(x)u=\sin(x). If this seems like a strange thing to do, there are a bunch of good reasons:

  • We know that the derivative of cos(x)\cos(x) is sin(x)-\sin(x), so we can replace sin(x)\sin(x) by dudx-\frac{du}{dx}, which we then integrate w.r.t xx, so the overall integral is integrated w.r.t uu.

  • As we can replace cos(x)\cos(x) with uu and cos(x)\cos(x) with u3u^{3}, this simplifies the expression considerably.

Proceeding,

sin(x)cos(x)+cos3(x)𝑑x\displaystyle\int\frac{\sin(x)}{\cos(x)+\cos^{3}(x)}dx =dudxu+u3𝑑x\displaystyle=\int\frac{-\frac{du}{dx}}{u+u^{3}}dx
=1u+u3𝑑u\displaystyle=-\int\frac{1}{u+u^{3}}du
=1u(1+u2)𝑑u\displaystyle=-\int\frac{1}{u(1+u^{2})}du

Which we can split into partial fractions:

1u(1+u2)=Au+Bu+C1+u2\displaystyle\frac{1}{u(1+u^{2})}=\frac{A}{u}+\frac{Bu+C}{1+u^{2}}
1=A(1+u2)+(Bu+C)u\displaystyle\implies 1=A(1+u^{2})+(Bu+C)u
0=A+Au2+Bu2+Cu1\displaystyle\implies 0=A+Au^{2}+Bu^{2}+Cu-1
0=(A+B)u2+Cu+(A1)\displaystyle\implies 0=(A+B)u^{2}+Cu+(A-1)

From where we can come up with some simultaneous equations

{A+B=0C=0A1=0\begin{cases}A+B=0\\ C=0\\ A-1=0\end{cases}

From this we can deduce that A=1A=1, B=1B=-1 and C=0C=0. Overall, then, we have

1uu1+u2du\displaystyle-\int\frac{1}{u}-\frac{u}{1+u^{2}}du =u1+u21udu\displaystyle=\int\frac{u}{1+u^{2}}-\frac{1}{u}du
=12ln(1+u2)ln(u)+c\displaystyle=\frac{1}{2}\ln(1+u^{2})-\ln(u)+c
=ln(1+u2u)+c\displaystyle=\ln\left(\frac{\sqrt{1+u^{2}}}{u}\right)+c
=ln(1+u2u2)+c\displaystyle=\ln\left(\sqrt{\frac{1+u^{2}}{u^{2}}}\right)+c
=12ln(1+u2u2)+c\displaystyle=\frac{1}{2}\ln\left(\frac{1+u^{2}}{u^{2}}\right)+c

Note that another way to do the last four steps is

12ln(1+u2)ln(u)\displaystyle\frac{1}{2}\ln(1+u^{2})-\ln(u) =12[ln(1+u2)2ln(u)]\displaystyle=\frac{1}{2}\left[\ln(1+u^{2})-2\ln(u)\right]
=12[ln(1+u2u2)]\displaystyle=\frac{1}{2}\left[\ln\left(\frac{1+u^{2}}{u^{2}}\right)\right]

which is possibly nicer.

11.5.3 Integral of 1cos(x)1+cos(x)\frac{1-\cos(x)}{1+\cos(x)}

Example 11.5.3

Find the value of

1cos(x)1+cos(x)𝑑x\int\frac{1-\cos(x)}{1+\cos(x)}dx

Solution: Anything which looks like 1+cos(x)1+\cos(x) can be turned into 1cos2(x)1-\cos^{2}(x) which is also known55 5 By the Pythagorean identity. as sin2(x)\sin^{2}(x). This is by multiplying by 1cos(x)1-\cos(x) (because (x+y)(xy)=x2y2(x+y)(x-y)=x^{2}-y^{2}, also known as the difference of two squares). We can proceed by multiplying by one.

1cos(x)1+cos(x)𝑑x\displaystyle\int\frac{1-\cos(x)}{1+\cos(x)}dx =1cos(x)1+cos(x)1cos(x)1cos(x)𝑑x\displaystyle=\int\frac{1-\cos(x)}{1+\cos(x)}\cdot\frac{1-\cos(x)}{1-\cos(x)}dx
=12cos(x)+cos2(x)sin2(x)𝑑x\displaystyle=\int\frac{1-2\cos(x)+\cos^{2}(x)}{\sin^{2}(x)}dx
=csc2(x)2cot(x)csc(x)+cot2(x)dx\displaystyle=\int\csc^{2}(x)-2\cot(x)\csc(x)+\cot^{2}(x)dx

Note that while a lot of these integrals are in the formula sheet 66 6 At least, in the OCR A formula booklet, it is given that ddx[cot(x)]=csc2(x)\frac{d}{dx}\left[\cot(x)\right]=-\csc^{2}(x) and ddx[csc(x)]=csc(x)cot(x)\frac{d}{dx}\left[\csc(x)\right]=-\csc(x)\cot(x) some of them are not (i.e. we have no idea what the integral of cot2(x)\cot^{2}(x) is at present). To get around this, we can use the Pythagorean identity to reduce this problem (the answer to which we don’t know) to a problem which we do know the answer to! Take cos2(x)+sin2(x)=1\cos^{2}(x)+\sin^{2}(x)=1, divide through by sin2(x)\sin^{2}(x) and obtain that cot2(x)+1=csc2(x)cot2(x)=csc2(x)1\cot^{2}(x)+1=\csc^{2}(x)\implies\cot^{2}(x)=\csc^{2}(x)-1.

Then,

csc2(x)2cot(x)csc(x)+cot2(x)dx\displaystyle\int\csc^{2}(x)-2\cot(x)\csc(x)+\cot^{2}(x)dx =2csc2(x)2cot(x)csc(x)1\displaystyle=\int 2\csc^{2}(x)-2\cot(x)\csc(x)-1
=2cot2(x)+2csc(x)x+c\displaystyle=-2\cot^{2}(x)+2\csc(x)-x+c

11.5.4 Integral of 1cos(x)\sqrt{1-\cos(x)}

Example 11.5.4

Find the value of

1cos(x)𝑑x\int\sqrt{1-\cos(x)}dx (11.17)

Solution: As it is, we can’t integrate this, therefore the only possible option is to rewrite it somehow, into a form we can integrate.

A way to think about this which isn’t particularly elegant, but is usually quite effective, is to think about all the possible identities which could work, and try each one.

e.g. thinking about identities which involve cos(x)\cos(x), we have 77 7 These are discussed in the trigonometry section of this document.

  • cos2(x)+sin2(x)1\cos^{2}(x)+\sin^{2}(x)\equiv 1, which doesn’t help here because there’s no cos2(x)\cos^{2}(x) anywhere.

  • cos(a+b)cos(a)cos(b)sin(a)sin(b)\cos(a+b)\equiv\cos(a)\cos(b)-\sin(a)\sin(b) - also no help

  • cos(2x)[cos(x)]2[sin(x)]2\cos(2x)\equiv\left[\cos(x)\right]^{2}-\left[\sin(x)\right]^{2}, and its two other forms (rearranging using the first bullet point), cos(2x)12[sin(x)]2\cos(2x)\equiv 1-2\left[\sin(x)\right]^{2} and cos(2x)2[cos(x)]21\cos(2x)\equiv 2\left[\cos(x)\right]^{2}-1.

The last identity looks quite useful, because we have a cos(2x)\cos(2x), and a 11, and we can rewrite it in the form

1cos(2x)2[sin(x)]21-\cos(2x)\equiv 2\left[sin(x)\right]^{2} (11.18)

The 1cos(2x)1-\cos(2x) looks quite a lot, but not exactly, like our integral, but we can fix that by simply replacing 88 8 This is fine, because when we derived the double-angle formula from the addition formula we set a=xa=x and b=xb=x in the equation cos(a+b)cos(a)cos(b)sin(a)sin(b)\cos(a+b)\equiv\cos(a)\cos(b)-\sin(a)\sin(b), but we could have just as well have set a=x2a=\frac{x}{2} and b=x2b=\frac{x}{2}, which would give cos(x)[cos(x2)]2[sin(x2)]2\cos(x)\equiv\left[\cos\left(\frac{x}{2}\right)\right]^{2}-\left[\sin\left(% \frac{x}{2}\right)\right]^{2} which we can then rearrange to give the result we need. xx with x2\frac{x}{2}, giving

1cos(x)2[sin(x2)]21-\cos(x)\equiv 2\left[\sin\left(\frac{x}{2}\right)\right]^{2} (11.19)

Applying this to our integral, we have

1cos(x)𝑑x\displaystyle\int\sqrt{1-\cos(x)}dx =2[sin(x2)]2𝑑x\displaystyle=\int\sqrt{2\left[\sin\left(\frac{x}{2}\right)\right]^{2}}dx (11.20)
=2sin(x2)𝑑x\displaystyle=\int\sqrt{2}\sin\left(\frac{x}{2}\right)dx (11.21)

The last part we can do by inspection (as the derivative of cos(x)-\cos(x) is equal to sin(x)\sin(x), by the chain rule, the derivative of cos(x2)-\cos\left(\frac{x}{2}\right) is equal to 12cos(x2)-\frac{1}{2}\cos(\frac{x}{2}), and therefore the integral of sin(x2)\sin\left(\frac{x}{2}\right) with respect to xx is just 2cos(x2)-2\cos\left(\frac{x}{2}\right)).

Therefore, we have

1cos(x)𝑑x\displaystyle\int\sqrt{1-\cos(x)}dx =2sin(x2)𝑑x\displaystyle=\sqrt{2}\int\sin\left(\frac{x}{2}\right)dx (11.22)
=22cos(x2)+c\displaystyle=-2\sqrt{2}\cos\left(\frac{x}{2}\right)+c (11.23)