A trigonometric integral identity How can we prove the following identity?
$$
\int_{0}^{2\pi}\cos^{n}\left(\,\theta\,\right)
\sin\left(\,\left[\,n + 1\,\right]\theta\,\right)\sin\left(\,\theta\,\right)
\,{\rm d}\theta
={\pi \over 2^{n}}
$$
This came up in some representation theory computations, but I'd be interested in seeing a proof that actually uses calculus.
 A: Here's a solution without complex analysis.
The key identity is $$\frac{d}{dx} \sin(nx)\cos^n(x) = n[\cos^n(x)\cos(nx) - \cos^{n-1}(x)\sin(nx)\sin(x)] \tag{*}$$
from which it follows that 
$$\int_0^{2\pi} \cos^{n-1}(x)\sin(nx)\sin(x)\,dx = \int_0^{2\pi} \cos^n(x)\cos(nx)\,dx.$$
Let's call the latter integral $J_n$.
Using the formula $\cos(\alpha)\cos(\beta) = \frac{1}{2}(\cos(\alpha+\beta) + \cos(\alpha-\beta))$, 
we can rewrite the integrand as 
$$\cos^{n-1}(x)\cos(x)\cos(nx) = \frac{1}{2}\cos^{n-1}(x)[\cos((n-1)x) + \cos((n+1)x)]$$
so that 
$$J_n = \frac{1}{2}J_{n-1} + \frac{1}{2}\int_0^{2\pi}\cos^{n-1}(x)\cos((n+1)x)\,dx.$$
Look back at (*). Factoring out $\cos^{n-1}(x)$ and using the angle addition formula for cosines on $(n+1)x = nx + x$, we see that (*) is equal to $n \cos^{n-1}(x)\cos((n+1)x)$, so the above integral is zero.  Thus, your integral is $$J_{n+1} = \frac{1}{2}J_n = \frac{1}{4}J_{n-1} = \dotsb = \frac{1}{2^{n+1}}J_0 = \frac{1}{2^{n+1}}\int_0^{2\pi} dx = \frac{\pi}{2^n}.$$
A: Noting that $\int_0^{2 \pi} e^{ik\theta} d \theta = 2 \pi 1_{\{0\}}(k) $
and using the binomial theorem, we have:
\begin{eqnarray}
I &=& {1 \over 2^{n}(2 i) (2 i) } \int_0^{2 \pi} \sum_{k=0}^n \binom{n}{k} e^{i (n-2k)\theta} (e^{i (n+1)\theta}-e^{-i (n+1)\theta}) (e^{i \theta}-e^{-i \theta}) d \theta \\
&=& -{1 \over 2^{n+2} }  \int_0^{2 \pi} \sum_{k=0}^n  \binom{n}{k} e^{i (n-2k)\theta} (e^{i (n+2)\theta}-e^{i n\theta}-e^{-i n\theta}+e^{-i (n+2)\theta}) d \theta \\
&=& -{1 \over 2^{n+2} }  \int_0^{2 \pi}  \sum_{k=0}^n \binom{n}{k} (e^{i 2(n+1-k)\theta}-e^{i 2(n-k)\theta}-e^{-i 2k\theta}+e^{-i 2(k+1)\theta}) d \theta \\
&=& -{1 \over 2^{n+2} }  (0 -2 \pi - 2 \pi +0) \\
&=& {\pi \over 2^n}
\end{eqnarray}
(Where we have used the fact that $\binom{n}{0} = \binom{n}{n} = 1$.)
A: I feel like the way to go here is using complex exponentials:
$$\int_0^{2\pi} \cos^n\theta \sin((n+1)\theta)\sin\theta\,d\theta = \int_0^{2\pi}\left(\frac{e^{i\theta}+e^{-i\theta}}{2}\right)^n\frac{e^{i(n+1)\theta}-e^{-i(n+1)\theta}}{2i}\frac{e^{i\theta}-e^{-i\theta}}{2i}\,d\theta.$$
Equivalently,
$$\int_0^{2\pi}\left(\frac{e^{i\theta}+e^{-i\theta}}{2}\right)^n\frac{(e^{i\theta})^{n+1}-(e^{-i\theta})^{n+1}}{2i}\frac{e^{i\theta}-e^{-i\theta}}{2i}\,d\theta.$$
Letting $z=e^{i\theta}$, we have that $dz = ie^{i\theta}d\theta$ so that $d\theta = -iz^{-1}\,dz$ and our integral becomes a contour integral over the unit circle:
$$\int_C\left(\frac{z+z^{-1}}{2}\right)^n\frac{z^{n+1}-z^{-n-1}}{2i}\frac{z-z^{-1}}{2i}(-iz^{-1})\,dz.$$
Expanding the power, we get
$$\sum_{k=0}^n\binom{n}{k}\frac{i}{2^{n+1}}\int_Cz^{n-2k-1}(z^{n+1}-z^{-n-1})(z-z^{-1})\,dz.$$
Expanding this again, we get
$$\sum_{k=0}^n\binom{n}{k}\frac{i}{2^{n+1}}\int_C z^{n-2k-1}(z^{n+2}-z^n-z^{-n}+z^{-n-2})\,dz.$$
From here, you need only to consider a couple of terms (since almost all of them go to zero since the only power of $z$ with nonzero closed contour is $z^{-1}$). Hopefully I haven't made any serious algebraic mistakes. If anyone sees any, please edit my post accordingly.
Of course, you don't need to use contour integration for this, I just think it's slightly cleaner in appearance. The observation that only the terms corresponding to $z^{-1}$ have nonzero integral is exactly the same as the observation that the integral of a periodic function (here: $e^{in\theta}$) over its period (or an integer multiple of its period) is zero.
A: We may use Cauchy's integral theorem.  For example, let $z=e^{i \theta}$ and the integral becomes
$$\frac14 \frac{i}{2^n} \oint_{|z|=1} \frac{dz}{z} \left (z+\frac1{z}\right)^n \left (z^{n+1}-\frac1{z^{n+1}} \right ) \left (z-\frac1{z} \right )$$
This looks like a mess, but the only piece of the integral that is nonzero is that which is proportional to $1/z$.  The last two terms in the integrand are $z^{n+2} - z^n - z^{-n} + z^{-(n+2)}$.  Clearly, when combined with the first term, the $z^{n+2}$ and $z^{-(n+2)}$ will contribute nothing to the integral.  The $z^n$ term and $z^{-n}$ term each contribute $-i 2 \pi$ to the integral.  Thus, the integral is
$$\frac14 \frac{i}{2^n} (-i 4 \pi) = \frac{\pi}{2^n} $$
