<s>[INST] Show $\sum_{n=0}^\infty\frac{1}{a^2+n^2}=\frac{1+a\pi\coth a\pi}{2a^2}$ How to show the following equality?
$$\sum_{n=0}^\infty\frac{1}{a^2+n^2}=\frac{1+a\pi\coth a\pi}{2a^2}$$
 [/INST] It is well known that
$$\sum_{n=-\infty}^\infty f(n)= -\sum_{j=1}^k \operatorname*{Res}_{z=j}\pi \cot (\pi z)f(z) $$
Assume $a \neq 0$. 
To find the residues of $g(z) := \pi \cot (\pi z)\frac{1}{a^2+n^2}$, we see
$$\frac{1}{a^2+n^2} = \frac{1}{(n+ia)(n-ia)}$$
so $g$ has poles at $z_1 = ia$ and $z_2 = -ia$.  Their respective residues, $b_1$ and $b_2$ can be found:
$$b_1 = \operatorname*{Res}_{z=ia}\,g(z) = \lim_{z \to ia} \pi \cot (\pi z)\frac{(z-ia)}{(z+ia)(z-ia)} = \pi \cot (\pi i a)\frac{1}{2ia} = -\frac{\pi \coth (\pi a)}{2a}$$
$$b_2 = \operatorname*{Res}_{z=-ia}\,g(z) = \lim_{z \to -ia} \pi \cot (\pi z)\frac{(z+ia)}{(z+ia)(z-ia)} = -\pi \cot (-\pi i a)\frac{1}{2ia} = -\frac{\pi \coth (\pi a)}{2a}$$
And finally:
$$\sum_{k=-\infty}^\infty \frac{1}{a^2+k^2} = -(b_1+b_2)=\frac{\pi \coth (\pi a)}{a}$$
To change the starting number from $-\infty$ to $0$, we divide the series, as it is symmetrical (i.e. $g(n)=g(-n)$):
$$
\sum_{k=-\infty}^\infty \frac{1}{a^2+k^2}=
\frac{\pi \coth (\pi a)}{a}=\\
\sum_{k=-\infty}^{-1} \frac{1}{a^2+k^2}+\frac{1}{a^2}+\sum_{k=1}^\infty \frac{1}{a^2+k^2}=\\
\frac{1}{a^2}+2\sum_{k=1}^\infty \frac{1}{a^2+k^2}=\\
\frac{1}{a^2}+2\left(\sum_{k=0}^\infty \frac{1}{a^2+k^2}-\frac{1}{a^2}\right)=\\
2\sum_{k=0}^\infty \frac{1}{a^2+k^2}-\frac{1}{a^2}
$$
Thus
$$\sum_{k=0}^\infty \frac{1}{a^2+k^2} = \frac{\pi \coth (\pi a)}{2a}+\frac{1}{2a^2} = \frac{\pi a\coth (\pi a)+1}{2a^2}$$
</s>