# Definite integral of even powers of Cosine.

I'm looking for a step-by-step solution to the following integral, in terms of n$$\int_0^{\frac{\pi}{2}} \cos^{2n}(x) \ {dx}$$I actually KNOW that the solution is$${\frac{\pi}{2}} \prod_{k=1}^n \frac{2k-1}{2k}$$ But I would like to know how to get there. This is not homework, this is to further my own understanding. My own efforts to solve this consisted of expanding $\cos(x)$ in terms of $e^{ix}$ but this proved to be fruitless, leading me only to the following integral, where $u=e^{ix}$ $$-i\int_1^i \left({\frac{1+u^2}{2u}}\right)^{2n} \ {du}$$

• Use the binomial expansion of the integrand. You can easily obtain an answer in terms of a finite summation. – Mark Viola Jun 23 '15 at 22:33
• And in that summation all but one term has integral $0$. At least after the right initial step... – David C. Ullrich Jun 23 '15 at 22:35
• @Dr.MV, you are referring to the second integral in terms of u, correct? – JacksonFitzsimmons Jun 23 '15 at 22:36
• You'll have an answer as fast as I can type it. Hang on... – David C. Ullrich Jun 23 '15 at 22:38
• – Lucian Jun 24 '15 at 1:21

There are several approaches. One, that has been given in previous answers, uses the fact that $\cos(\theta)=\frac12(e^{i\theta}+e^{i\theta})$ and that $\int_0^{2\pi}e^{in\theta}\,\mathrm{d}\theta=2\pi$ if $n=0$, and vanishes otherwise, to get \begin{align} \int_0^{\pi/2}\cos^{2n}(\theta)\,\mathrm{d}\theta &=\frac14\int_0^{2\pi}\cos^{2n}(\theta)\,\mathrm{d}\theta\\ &=\frac1{4^{n+1}}\int_0^{2\pi}\left(e^{i\theta}+e^{i\theta}\right)^{2n}\,\mathrm{d}\theta\\ &=\frac{2\pi}{4^{n+1}}\binom{2n}{n} \end{align}

Another approach is to integrate by parts \begin{align} \int_0^{\pi/2}\cos^{2n}(\theta)\,\mathrm{d}\theta &=\int_0^{\pi/2}\cos^{2n-1}(\theta)\,\mathrm{d}\sin(\theta)\\ &=(2n-1)\int_0^{\pi/2}\sin^2(\theta)\cos^{2n-2}(\theta)\,\mathrm{d}\theta\\ &=(2n-1)\int_0^{\pi/2}\left(\cos^{2n-2}(\theta)-\cos^{2n}(\theta)\right)\,\mathrm{d}\theta\\ &=\frac{2n-1}{2n}\int_0^{\pi/2}\cos^{2n-2}(\theta)\,\mathrm{d}\theta\\ \end{align} and use induction to get $$\int_0^{\pi/2}\cos^{2n}(\theta)\,\mathrm{d}\theta =\frac\pi2\prod_{k=1}^n\frac{2k-1}{2k}$$

Note that \begin{align} \frac\pi2\prod_{k=1}^n\frac{2k-1}{2k} &=\frac\pi2\frac{(2n)!}{(2^nn!)^2}\\ &=\frac{\pi}{2^{2n+1}}\binom{2n}{n} \end{align}

• Thank you for giving me multiple methods. – JacksonFitzsimmons Jun 23 '15 at 23:23
• You're welcome. I started writing my answer before Bernard posted his answer, which also uses integration by parts. – robjohn Jun 23 '15 at 23:30

Integrate by parts, setting $$u=\cos^{2n-1}x,\enspace \operatorname{d}\mkern-2mu v=\cos x\operatorname{d}\mkern-2mu x,\enspace\text{whence}\quad \operatorname{d}\mkern-2mu u=-(2n-1)\cos^{2n-2}x \operatorname{d}\mkern-2mux,\enspace v= \sin x$$ Let's call $I_{2n}$ the integral. One obtains: $$I_{2n}=\Bigl[\sin x\mkern1mu\cos^{2n-1}x\Bigr]_0^{\tfrac\pi2}+(2n-1)(I_{2n-2}-I_{2n})=(2n-1)(I_{2n-2}-I_{2n})$$ whence the recurrence relation: $$I_{2n}=\frac{2n-1}{2n}I_{2n-2}.$$ Now write all these relations down to $n=1$, multiply the equalities thus obtained and simplify.

First, note that $\int_0^{\pi/2}=\frac14\int_0^{2\pi}$ by various symmetries.

Now say $\cos(t)=\frac12(e^{it}+e^{-it})$ and apply the binomial theorem. You get terms consisting of various powers of $e^{it}$. All those terms have integral $0$ except the middle one: $(e^{it})^n(e^{-it})^n=1$. So you get $$\frac14\int_0^{2\pi}\cos^{2n}(t)\,dt=\frac142^{-2n}(2\pi)C(2n,n),$$where $C()$ is a binomial coefficient.

The answer you want must now follow by induction (unless I dropped a factor, in which case it follows by induction from the corrected version of the above).

• It's nice to see you again. It's been a while. – robjohn Jun 23 '15 at 23:30
• Nice to be seen... – David C. Ullrich Jun 23 '15 at 23:34

First, note that it is:

$$\frac{1}{4}\int_{0}^{2\pi} \cos^{2n}x\,dx$$

Now $$\cos^{2n}(x)=\frac{1}{2^{2n}}\left(e^{ix}+e^{-ix}\right)^{2n}$$. And for integer $m\neq 0$, $\int_{0}^{2\pi}e^{imx}\,dx = 0$.

So you only care about the constant term of $(e^{ix}+e^{-ix})^{2n}$, which is $\binom{2n}{n}$.

So the integral is:

$$\frac{1}{4}\cdot 2\pi \cdot \frac{1}{2^{2n}} \binom{2n}{n}=\frac{\pi}{2}\frac{1}{2^{2n}}\binom{2n}{n}$$

Then prove that $$\frac{\binom{2n}{n}}{2^{2n}} = \prod_{k=1}^n \frac{2k-1}{2k}$$

You can prove this last by induction:

$$\binom{2(n+1)}{n+1} = \frac{(2n+1)(2n+2)}{(n+1)(n+1)}\binom{2n}{n}=2\frac{2(n+1)-1}{2(n+1)}\binom{2n}{n}$$

• Hum constant term of $\left(e^{ix}+e^{-ix}\right)^{2n}$ is $\binom{2n}{n}$, can you explain me ? ^^ – ParaH2 Jun 23 '15 at 22:48
• If you expand $(a+a^{-1})^{2n}$ via the binomial theorem, then the constant terms is $\binom{2n}{n}$. All the other terms are of the form $Ca^k$ for $k\neq 0$. Not sure how to make that more clear. – Thomas Andrews Jun 23 '15 at 22:49
• Ok, and why are you seeking constants terms ? – ParaH2 Jun 23 '15 at 22:51
• Because the integrals of all the other terms are zero, as I noted. So the only term that contributes a non-zero value to the integral is the constant term. @Shadock – Thomas Andrews Jun 23 '15 at 22:52
• OK thank you, I'm a chemist, I have some knowlegde in maths because i love them, I'm ridiculous here haha ^^ – ParaH2 Jun 23 '15 at 22:55

You were on the right track using Euler's Identity and writing $\cos x=\frac12(e^{ix}+e^{-ix})$. Proceeding accordingly we have,

\begin{align} \int_0^{\pi/2}\cos^{2n}x\,dx&=\int_0^{\pi/2}\left(\frac{e^{ix}+e^{-ix}}{2}\right)^{2n}dx\\\\ &=\frac{1}{4^n}\int_0^{\pi/2}\sum_{k=0}^{2n}\binom{2n}{k}e^{ikx}e^{-ix(2n-k)}dx\\\\ &=\frac{1}{4^n}\sum_{k=0}^{2n}\binom{2n}{k}\int_0^{\pi/2}e^{ix2(k-n)}dx\\\\ &=\frac{1}{4^n}\sum_{k=0}^{2n}\binom{2n}{k}\frac{\pi}{2}\delta_{nk}+\frac{1}{4^n}\sum_{k=0, k\ne n}^{2n}\binom{2n}{k}\frac{(-1)^{n-k}-1}{i2(k-n)} \tag 1\\\\ &=\frac{\pi}{2}\frac{1}{4^n}\binom{2n}{n}\\\\ &=\frac{\pi}{2}\frac{1}{4^n}\frac{(2n)!}{(n!)^2}\\\\ &=\frac{\pi}{2}\left(\frac{1}{2^n\,n!}\right)\left(\frac{(2n)!}{2^n\,n!}\right)\\\\ &=\frac{\pi}{2}\left(\frac{1}{(2n)!!}\right)\left((2n-1)!!\right)\\\\ &=\frac{\pi}{2}\frac{(2n-1)!!}{(2n)!!}\\\\ &=\frac{\pi}{2}\prod_{k=1}^{n}\frac{2k-1}{2k} \end{align}

as was to be shown!!

Note that the second sum in $(1)$ is purely imaginary and, thereby, must vanish. One can easily show it vanishes by exploiting symmetry. We now explicitly show this.

\begin{align} \sum_{k=0, k\ne n}^{2n}\binom{2n}{k}\frac{(-1)^{n-k}-1}{i2(k-n)} &=\sum_{k=0}^{n-1}\binom{2n}{k}\frac{(-1)^{n-k}-1}{i2(k-n)}+\sum_{k=n+1}^{n-1}\binom{2n}{k}\frac{(-1)^{n-k}-1}{i2(k-n)}\\\\ &=\sum_{k=0}^{n-1}\binom{2n}{k}\frac{(-1)^{n-k}-1}{i2(k-n)}+\sum_{m=0}^{n-1}\binom{2n}{2n-m}\frac{(-1)^{m-n}}{i2(n-m)} \text{substituting m=2n-k} \\\\ &=\sum_{k=0}^{n-1}\binom{2n}{k}\frac{(-1)^{n-k}-1}{i2(k-n)}-\sum_{k=0}^{n-1}\binom{2n}{2n-k}\frac{(-1)^{k-n}}{i2(k-n)} \\\\ &=\sum_{k=0}^{n-1}\binom{2n}{k}\frac{(-1)^{n-k}-1}{i2(k-n)}-\sum_{k=0}^{n-1}\binom{2n}{k}\frac{(-1)^{n-k}}{i2(k-n)} \text{Using}\,\, \binom{2n}{2n-k}= \binom{2n}{k} \\\\ &=0 \end{align}

as was to be shown!

• $\delta_{nk}$ ? – ParaH2 Jun 23 '15 at 22:43
• Why is the integral from $$\int_{0}^{\pi/2}e^{2(k-n)ix}\,dx=\frac{\pi}{2}\delta_{nk}?$$ It's true for $\int_{0}^{\pi}$ or $\int_0^{2\pi}$, but not sure if for $\int_0^{\pi/2}$. – Thomas Andrews Jun 23 '15 at 22:44
• The Kronecker Delta. It is $1$ when the indices are equal and $0$ otherwise. – Mark Viola Jun 23 '15 at 22:44
• $\delta_{nk}=\delta_{n,k}=1$ if $n=k$, $0$ otherwise. – David C. Ullrich Jun 23 '15 at 22:45
• @ThomasAndrews All of the other terms are purely imaginary and cancel by symmetry. – Mark Viola Jun 23 '15 at 22:45