(Lecture 26 of Mathematical Methods II.)
To remind us some of the key results of the last lectures, after the Easter break, we will study an application of Residue theory into the problem of computing series of numbers, such as
\begin{equation} \tag{1} 1+\frac{1}{4}+\frac{1}{9}+\frac{1}{16}+\cdots=\frac{\pi^2}{6}\,. \end{equation}
The generic formulas to do so are:
\begin{align} \tag{2} &\sum_{n=-\infty}^\infty f(n)=-\sum_{z_0\in Z(f)}\mathrm{Res}_{z=z_0}\pi\cot(\pi z)f(z)\,,\\ &\sum_{n=-\infty}^\infty(-1)^nf(n)=-\sum_{z_0\in Z(f)}\mathrm{Res}_{z=z_0}\pi\csc(\pi z)f(z)\,,\\ &\sum_{n=-\infty}^\infty f\left(\frac{2n+1}{2}\right)=-\sum_{z_0\in Z(f)}\mathrm{Res}_{z=z_0}\pi\tan(\pi z)f(z)\,,\\ &\sum_{n=-\infty}^\infty(-1)^nf\left(\frac{2n+1}{2}\right)=-\sum_{z_0\in Z(f)}\mathrm{Res}_{z=z_0}\pi\sec(\pi z)f(z)\,, \end{align}
where $Z(f)$ is the set of poles of $f$, assumed to have simple poles only, that do not make the series diverge, and which is such that:
\begin{equation} \tag{3} |f(z)|\le\frac{M}{|z|^k}\,. \end{equation}
We will prove the first one, assuming first that $f$ has a finite number of poles (the case of infinite poles is obtained by taking the limit of the reasoning we are going to give). We can then encircle them in a square $\mathcal{C}$ with vertices $(N+\frac{1}{2})(\pm 1\pm i)$. From the residue theorem, we know that:
\begin{equation} \tag{4} \oint_\mathcal{C}\pi\cot(\pi z)f(z)\,dz=2i\pi\sum_{z_0\in Z\big(\cot(\pi z)f(z)\big)}\mathrm{Res}_{z=z_0}[\pi\cot(\pi z)f(z)] \end{equation}
The cotangent $\cot=\cos/\sin$ has poles where $\sin$ has zeros, i.e., $Z(\cot(\pi z))=\mathbf{Z}$. We have required that $f$ has no poles here (otherwise the series would diverge). So
\begin{equation} Z\big(\cot(\pi z)f(z)\big)=Z(\cot(\pi z))\bigcup Z(f)\,, \end{equation}
and
\begin{multline} \tag{5} \oint_\mathcal{C}\pi\cot(\pi z)f(z)\,dz\\=2i\pi\sum_{n=-\infty}^\infty\mathrm{Res}_{z=z_0}[\pi\cot(\pi z)f(z)]+2i\pi\sum_{z_0\in Z(f)}\mathrm{Res}_{z=z_0}[\pi\cot(\pi z)f(z)]\,. \end{multline}
We now have to prove that the lhs of Eq. (5) vanishes when $N\rightarrow\infty$ and that the residues on the poles of the cotangent are $f(n)$.
We start with the later. Since the pole is simple, we can use the formula:
\begin{align} \tag{6} \mathrm{Res}_{z=n}\pi\cot(\pi z)f(z)&=\lim_{z\rightarrow n}(z-n)\pi\cot(\pi z)f(z)\\ &=\lim_{z\rightarrow n}\frac{\pi(z-n)}{\sin(\pi z)}\cos(\pi z)f(z)\,. \end{align}
We can compute the limit of each term, which all exist (therefore the limit of the product is the product of the limits). The cardinal sine limit is more easily obtained with L'H\^opital's rule, we find:
\begin{equation} \tag{7} \lim_{z\rightarrow n}\frac{\pi(z-n)}{\sin(\pi z)}=(-1)^n\,, \end{equation}
so that, finally:
\begin{equation} \tag{8} \mathrm{Res}_{z=n}\pi\cot(\pi z)f(z)=f(n)\,. \end{equation}
It remains to compute the lhs on Eq. (5). We first show that $|\cot|$ is bounded on $\mathcal{C}$ by $\coth(\pi/2)$, independently of $N$ (the trajectory was chosen for this purpose).
\begin{align} |\cot(\pi z)|&=\left|\frac{e^{i\pi z}+e^{-i\pi z}}{e^{i\pi z}-e^{-i\pi z}}\right|\\ &=\left|\frac{e^{i\pi x-\pi y}+e^{-i\pi x+\pi y}}{e^{i\pi x-\pi y}-e^{-i\pi x+\pi y}}\right|\\ &\le\frac{|e^{i\pi x-\pi y}|+|e^{-i\pi x+\pi y}|}{\big||e^{i\pi x-\pi y}|-|e^{-i\pi x+\pi y}|\big|}\\ &\le\frac{e^{-\pi y}+e^{\pi y}}{|e^{-\pi y}-e^{\pi y}|}\,, \end{align}
at which stage, we can see that if $y\ge 1/2$, $|\cot(\pi z)|$ is bounded on $\mathcal{C}$ by $(1+e^{-\pi})/(1-e^{-\pi})$, this independently of the value of $x$. The same is true if $y\le-1/2$.
For $|y|\le 1/2$, the function may diverge for some values of $x$, so we must take the specificity of $\mathcal{C}$ into account for $z=N+\frac{1}{2}+iy$:
\begin{align} |\cot(\pi z)|&=|\cot(\pi N+\pi/2+i\pi y)|\\ &=|\cot(\pi/2+i\pi y)|\\ &=|-\tan(i\pi y)|\\ &=|-i\tanh(\pi y)|\\ &\le|\tanh(\pi/2)|\,, \end{align}
and since $\tanh(\pi/2)\le\coth(\pi/2)$, the function as a whole is bounded by the latter. We use this bound in the ML inequality for contour integrals:
\begin{equation} \tag{9} \oint_\mathcal{C}\pi\cot(\pi z)f(z)\,dz\le\pi\coth(\pi/2)\frac{M}{|2(N+\frac12)|^k}\times 8(N+\frac{1}{2})\,, \end{equation}
which, as $N\rightarrow\infty$, goes to zero. This completes the proof.
We provide an example of this method:
\begin{equation} \tag{10} \sum_{n=1}^\infty\frac{1}{n^2+a^2}=\frac{\pi}{2a}\coth(\pi a-\frac{1}{2a^2})\,. \end{equation}
Indeed, with $f(z)=1/(z^2+a^2)=1/[(z-ia)(z+ia)]$, the related series $\sum_{-\infty}^\infty$ is minus the sum of the residues of $\pi\cot(\pi z)/(z^2+a^2)$ at the poles $\pm ia$. We find:
\begin{equation} \tag{11} \mathrm{Res}_{z=ia}\frac{\pi\cot(\pi z)}{z^2+a^2}=\lim_{z\rightarrow ia}\frac{\pi\cot(\pi z)}{z+ia} =\frac{\pi\cot(i\pi a)}{2ia}=-\frac{\pi\coth(\pi a)}{2a} \end{equation}
which is the same for the other pole. From this follows straightforwardly Eq. (10).
Mittag-Leffler theorem: The Mittag-Leffler theorem provides a meromorphic function with prescribed poles (it is the counterpart of Weierstrass factorization theorem that does the same for holomorphic functions with prescribed zeros). Given the poles $a_i$, $1\le i\le N$, with residues $b_i$, the Mittag-Leffler theorem provides the Series expansion:
\begin{equation} \tag{12} f(z)=f(0)+\sum_{n=1}^\infty b_n\left[\frac{1}{z-a_n}+\frac{1}{a_n}\right]\,. \end{equation}