Sum of Squares of Binomial Coefficients Using Residue Theorem

binomial-coefficientscomplex-analysisintegrationresidue-calculus

I ran across this interesting question recently that I have an idea for, but am unable to complete. Basically, we use the residue formula to find $$ \sum\limits_{k=0}^n {n\choose k}^2$$
We define $f$ as\begin{align*}
f(z)&= \frac{1}{z}(1+z)^n(1+\frac{1}{z})^n\\ &= \frac{1}{z}\left({n\choose 0} + {n\choose 1}z + \cdots + {n\choose n} z^n \right)\left({n\choose 0} + {n\choose 1}\frac{1}{z} + \cdots + {n\choose n} \frac{1}{z}^n \right)\\
\end{align*}
We see that the $\frac{1}{z}$ term will have the coefficient $\sum\limits_{k=0}^n {n\choose k}^2$. This would imply that $$res_{z=0} f(z) = \sum\limits_{k=0}^n{n\choose k}^2$$
Here's where things start falling apart for me. I choose to integrate $f$ over the unit disc $D$, which contains the pole $z=0$ and according to the residue theorem, I should get that $$ \int\limits_D f(z)dz = 2\pi i \sum\limits_{k=0}^n{n\choose k}^2$$

But calculating the integral, I get that \begin{align*}
\int\limits_D f(z)dz &= \int\limits_0^{2\pi} \frac{ie^{i\theta}}{e^{i\theta}}(1+e^{i\theta})^n(1+e^{-i\theta})^nd\theta\\
&= i \int\limits_0^{2\pi} (1+e^{i\theta})^n (1+e^{-i\theta})^nd\theta
\end{align*}
However, Wolfram Alpha has that this integral goes to $0$ but we don't have that $\sum\limits_{k=0}^n {n\choose k}^2 = 0$. Would someone mind pointing out where I messed up in my proof or perhaps point me in a better direction?

Best Answer

Using the reduction formula $$\int_0^\pi\cos^{2n}\phi\,d\phi =\frac{2n-1}{2n}\int_0^\pi\cos^{2n-2}\phi\,d\phi\ ,$$ your sum is $$\eqalign{S &=\frac1{2\pi}\int_0^{2\pi} (1+e^{i\theta})^n(1+e^{-i\theta})^n\,d\theta\cr &=\frac1{2\pi}\int_0^{2\pi}(2+2\cos\theta)^n\,d\theta\cr &=\frac1{2\pi}\int_0^{2\pi} 2^{2n}\cos^{2n}\frac\theta2\,d\theta\cr &=\frac1\pi\int_0^\pi2^{2n}\cos^{2n}\phi\,d\phi\cr &=\frac1\pi 2^{2n}\frac{2n-1}{2n}\frac{2n-3}{2n-2}\cdots\frac12\pi\cr &=\frac{(2n)!}{(n!)^2}\cr &=\binom{2n}n\ .\cr}$$

Related Question