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}$$
-
1Use 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
-
1You'll have an answer as fast as I can type it. Hang on... – David C. Ullrich Jun 23 '15 at 22:38
-
1See Wallis' integrals. – Lucian Jun 24 '15 at 01:21
-
@Dr.MV your answer was good, I accepted another answer because it had two methods for solving the problem, and I thought that would be more helpful to anyone who looks this up in the future. – JacksonFitzsimmons Jun 24 '15 at 23:07
5 Answers
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} $$
- 345,667
-
-
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.
- 175,478
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}=4\frac{2(n+1)-1}{2(n+1)}\binom{2n}{n}$$
- 177,126
-
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
-
1If 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
-
-
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
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).
- 89,985
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!
- 179,405
-
-
1Why 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
-
-
@ThomasAndrews All of the other terms are purely imaginary and cancel by symmetry. – Mark Viola Jun 23 '15 at 22:45
-
-
-
But it is still not true that the integral is $\delta_{n,k}$. Rather, you have to combine terms $k=i$ and $k=n-i$ to get the cancellation. @Dr.MV – Thomas Andrews Jun 23 '15 at 22:47
-
@Thomas oops, you're right. Look at my version of the answer instead... – David C. Ullrich Jun 23 '15 at 22:49
-
@Jackson Look at all the answers. One of them explains you should show that final expression equals yours by induction. – David C. Ullrich Jun 23 '15 at 22:49
-
OK thank you, I scared about a function I saw here few days ago and I though it was it ^^ – ParaH2 Jun 23 '15 at 22:50
-
@DavidC.Ullrich Why would I look at your answer when I posted my answer first? :) – Thomas Andrews Jun 23 '15 at 22:51
-
@Thomas Sorry. Lemme rephrase that. In my version every term has integral $0$ except one. That's the best excuse I can come up with for assuming that the same was true of your version, hence making stupid comments about why it was so. – David C. Ullrich Jun 23 '15 at 22:56
-
Yes, that is exactly my answer, @DavidC.Ullrich, I just beat you to it by about 3 minutes. :) – Thomas Andrews Jun 23 '15 at 22:56
-
I'm complaining here because this @Dr.MV answer implies that $\int_{0}^{\pi/2}e^{2i(k-n)x},dx = \frac{\pi}{2}\delta_{nk}$, which is not true. – Thomas Andrews Jun 23 '15 at 22:58
-
@Thomas Indeed yours is the same as mine, and earlier. And yes, it seems to me that Dr. MV slipped. I explained why what he said was right, but no, the problem is that $2(n-k)$ may not be divisible by $4$. – David C. Ullrich Jun 23 '15 at 23:01
-
@Thomas Oh, I see where I got confused. You explained how to fix his version. I assumed you were referring to your version. I quit... – David C. Ullrich Jun 23 '15 at 23:03
-
@ThomasAndrews I added the extra term with vanishes by symmetry. It also must be zero since it is purely imaginary. – Mark Viola Jun 23 '15 at 23:04
-
Which is why I wrote "implies." No reason to be so defensive. You left out a fairly big step, and it made your answer read as if you were implying an equality which wasn't true. @Dr.MV – Thomas Andrews Jun 23 '15 at 23:39
-
@thomasandrews On the contrary. I value your opinion. Thank you for the suggestion. +1 for the comment! – Mark Viola Jun 23 '15 at 23:42
-
Well, you slipped because you wrote $\sum_{k=0}^n f(k)=\sum_{k=0}^n g(k)$ without saying why, implying that $f(k)=g(k)$. Again, a proof is a communication, and you slipped in your communication. Again, you are obsessed with not being wrong. But your answer was unclear, and anybody reading would read it the wrong way, so it was wrong. You might have known what you meant, I sure didn't - when I saw your answer, I thought: "Did I not need to find that trick of changing the domain?" – Thomas Andrews Jun 23 '15 at 23:55