Using Residue theorem to evaluate $ \int_0^\pi \sin^{2n}\theta\, d\theta $ can you please guide me on evaluating this integral using residue theorem and binomial theorem
$$
\int_0^\pi \sin^{2n}\theta\, d\theta
$$
for $n = 1,2,3$
Honestly, I do not even know where to start, since it has no singularity.
And what is also the correct contour for this one?
Thanks in advance and more power.
 A: Although this doesn't use contour integration, we can use $\sin(x)=\frac{e^{ix}-e^{-ix}}{2i}$ and the binomial theorem to get
$$
\begin{align}
\int_0^\pi\sin^{2n}(x)\,\mathrm{d}x
&=\frac12\int_0^{2\pi}\sin^{2n}(x)\,\mathrm{d}x\\
&=\frac12\left(-\frac14\right)^n\int_0^{2\pi}\left(e^{ix}-e^{-ix}\right)^{2n}\,\mathrm{d}x\\
&=\frac12\left(-\frac14\right)^n\int_0^{2\pi}\sum_{k=0}^{2n}\binom{2n}{k}(-1)^ke^{2i(2n-k)x}e^{-ikx}\,\mathrm{d}x\\
&=\frac12\left(-\frac14\right)^n\binom{2n}{n}(-1)^n2\pi\\
&=\frac\pi{4^n}\binom{2n}{n}
\end{align}
$$
A: We can use this answer, with $a=2n$ and $b=0$, to get
$$
\begin{align}
\int_0^{\pi}\sin^{2n}(x)\,\mathrm{d}x
&=2\int_0^{\pi/2}\sin^{2n}(x)\,\mathrm{d}x\\
&=2\int_0^{\pi/2}\cos^{2n}(x)\,\mathrm{d}x\\
&=2\cdot\frac{\pi2^{-2n-1}\Gamma(2n+1)}{\Gamma(n+1)\Gamma(n+1)}\\
&=\frac\pi{4^n}\binom{2n}{n}
\end{align}
$$
A: Let $z=e^{i \theta}$, then $d\theta=dz/(i z)$ and $\sin{\theta} = (z-1/z)/(2 i)$.  Then the integral becomes
$$\frac12\frac{-i}{(2 i)^{2 n}} \oint_{|z|=1} \frac{dz}{z} \left( z-z^{-1}\right)^{2 n}  =\frac12 \frac{-i}{(2 i)^{2 n}} \oint_{|z|=1} dz \frac{(z^2-1)^{2 n}}{z^{2 n+1}}$$
As you can see, you have a pole of order $2 n+1$ in the integrand.  To apply the residue Theorem, you need to evaluate $i 2 \pi$ times the residue at the pole at $z=0$, which is
$$\frac{\pi}{(2 i)^{2 n}} \frac{1}{(2 n)!} \left[\frac{d^{2 n}}{dz^{2 n}}\left ( z^2-1\right)^{2 n}\right]_{z=0}$$
Now, by Rodrigues' formula for Legendre polynomials, the latter expression is
$$\left[\frac{d^{2 n}}{dz^{2 n}}\left ( z^2-1\right)^{2 n}\right]_{z=0} = 2^{2 n} (2n)! P_n(0)$$
ADDENDUM
We can also use the binomial theorem to extract an explicit expression for the residue.  Note that
$$\left ( z^2-1\right)^{2 n} = \sum_{k=0}^{2 n} \binom{2 n}{k} z^{2 k} (-1)^k$$
Taking the $2 n$th derivative and setting $z=0$ leaves only the $n$th term in the sum, so we get
$$\left[\frac{d^{2 n}}{dz^{2 n}}\left ( z^2-1\right)^{2 n}\right]_{z=0} = (-1)^n \frac{(2 n)!^2}{(n!)^2}$$
Therefore, the integral is
$$\frac{\pi}{2^{2 n}} \binom{2 n}{n}$$
