Line Integral and Residue Theorem 
I know applying the residue theorem to some integral gives that when you differentiate $(1+z)^{2n} $ n times and evaluate at 0 you get 2n choose n but I don't understand how the highlighted step is taken as automatic~

HINT:
Apply the binomial theorem to $\left(\frac{z+z^{-1}}{2}\right)^n$ and exploit
$$\oint_{|z|=1}z^m\,dz=\begin{cases}0&,m \ne -1\\\\2\pi i&,m=-1\end{cases}$$
