Prove the identity \[ \int_0^{2\pi}\cos^{2n}\theta\,d\theta =2\pi\frac{1\cdot3\cdot5\cdots(2n-1)}{2\cdot4\cdot6\cdots(2n)} \] by applying the residue theorem to \[ \int_{S^1}(z+1/z)^{2n}\,\frac{dz}{z}. \]
Solution
Let \[ I_n=\int_0^{2\pi}\cos^{2n}\theta\,d\theta. \] Then \[ \boxed{ I_n =2\pi\frac{1\cdot3\cdot5\cdots(2n-1)} {2\cdot4\cdot6\cdots(2n)}.} \]
1. On the unit circle,\[ \int_{S^1}(z+1/z)^{2n}\frac{dz}{z} =i4^n I_n. \]
Write \(z=e^{i\theta}\) with \(0\le\theta\le2\pi\). Then \[ z+\frac1z=e^{i\theta}+e^{-i\theta}=2\cos\theta \] and \[ \frac{dz}{z}=i\,d\theta. \] Therefore \[ \begin{aligned} \int_{S^1}(z+1/z)^{2n}\frac{dz}{z} &=i\int_0^{2\pi}(2\cos\theta)^{2n}\,d\theta\\ &=i4^n I_n. \end{aligned} \]
2. The integrand has only one pole inside \(S^1\), at \(z=0\), and itsresidue there is\[ \binom{2n}{n}. \]
We have \[ (z+1/z)^{2n}\frac1z =z^{-2n-1}(1+z^2)^{2n}. \] The residue is the coefficient of \(z^{-1}\), hence the coefficient of \(z^{2n}\) in \((1+z^2)^{2n}\). By the binomial theorem this coefficient is \[ \binom{2n}{n}. \]
3. Hence\[ I_n=\frac{2\pi}{4^n}\binom{2n}{n}. \]
By the residue theorem and 2, \[ \int_{S^1}(z+1/z)^{2n}\frac{dz}{z} =2\pi i\binom{2n}{n}. \] Comparing with 1 and cancelling \(i\) gives \[ 4^n I_n=2\pi\binom{2n}{n}, \] which is the claimed formula.
4. Finally,\[ \frac1{4^n}\binom{2n}{n} =\frac{1\cdot3\cdot5\cdots(2n-1)} {2\cdot4\cdot6\cdots(2n)}. \]
Indeed, \[ \frac1{4^n}\binom{2n}{n} =\frac{(2n)!}{4^n(n!)^2} =\frac{(1\cdot3\cdots(2n-1))(2\cdot4\cdots2n)} {(2\cdot4\cdots2n)^2}, \] because \(2\cdot4\cdots2n=2^n n!\). Cancelling one even product gives the desired ratio. Combining this with 3 proves the identity.