Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I ran across an identity I had not saw before, and am wondering how it can be derived.

$\displaystyle \int_{0}^{\frac{\pi}{2}}\cos^{m}(x)\cos(nx)dx=\frac{\pi\Gamma(m+1)}{2^{m+1}\Gamma(\frac{m+n}{2}+1)\Gamma(\frac{m-n}{2}+1)}$.

For the case, $m=n$, then the result is $\frac{\pi}{2^{m+1}}$.

I can easily use parts, but I do not know how to connect it to Gamma. It would appear the

method must lie in generalizing somehow. It looks like the classic Beta/trig integral may

be in there somewhere.

I used parts and got:


$\displaystyle \left(1+\frac{m}{n}\right)I_{m,n}=\frac{m}{n}I_{m-1,n-1}$

and so on. Now, perhaps let $n=n-1, \;\ m=m-1$, then sub in and generalize?.

I still do not see how to tie it to Gamma unless it comes from the product of the m and n terms

Thanks to anyone who has a clever idea.

share|cite|improve this question
Determine whether the formula is true when $m=0$, whether it is true when $n=0$ and apply induction using your result $\displaystyle \left(1+\frac{m}{n}\right)I_{m,n}=\frac{m}{n}I_{m-1,n-1}$. – GEdgar Dec 7 '12 at 22:37
Thank you very much. I managed to work it out. – Cody Dec 8 '12 at 10:02

First, we note that:


$$\cos x=\frac{e^{ix}+e^{-ix}}{2}=\frac{z+\frac{1}{z}}{2}$$

$$dx=\frac{dz}{iz}$$ Based on the above, we consider an integral:

$$I_1=\frac{1}{i2^m}\int_{0}^{i}(1+z^2)^mz^{n-m-1}dz$$ The original integral $I$ is the real part of $I_1$ because that $$z^n=\cos nx +i\sin nx$$

Next step is the change of variable: $z^2=-y$


where $B(x,y)$ is the beta function.

From complex algebra we get:


Remembering that we need a real part of $I_1$ we finally have:

$$I=\mathfrak{Re}(I_1)= \frac{\sin\left(\pi\frac{n-m}{2}\right)}{2^{m+1}}B\left(m+1,\frac{n-m}{2}\right)$$

To get the result in terms of gamma function as desired we use the common relations:


$$\Gamma(x)\Gamma(1-x)=\frac{\pi}{\sin\pi x}$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.