Cotangent partial-fraction expansion (source code)

= Cotangent partial-fraction expansion
{title2=$\pi\cot\pi z=z^{-1}+\sum_{n\ge1}2z/(z^2-n^2)$}

Away from integer <poles>,
$$
\pi\cot\pi z=\frac1z+\sum_{n=1}^{\infty}\frac{2z}{z^2-n^2}.
$$
The series is locally uniformly convergent. Integrate $\pi\cot(\pi\zeta)/(\zeta^2-z^2)$ around the square with sides $\operatorname{Re}\zeta,\operatorname{Im}\zeta=\pm(N+1/2)$. The <cotangent> is uniformly bounded there, so the integral tends to zero. The <residue theorem> then gives $\pi\cot(\pi z)/z+\sum_{n\in\mathbb Z}(n^2-z^2)^{-1}=0$, which is the expansion. Differentiation generates higher integer-lattice <pole> sums. Setting $w=e^{2\pi iz}$ gives $\pi\cot\pi z=\pi i(w+1)/(w-1)$. On $0<|z|<1$, expansion of each paired summand gives $\pi\cot\pi z=z^{-1}-2\sum_{m\ge0}\zeta(2m+2)z^{2m+1}$, relating this <trigonometric function> to the <Riemann zeta function>.