Compute $\sum\limits_{n=0}^\infty \frac{1}{a+(2n+1)^2},$, $a>0$ using residue theorem I need to compute the series $$\sum_{n=0}^\infty \frac{1}{a+(2n+1)^2},$$ where $a>0$ is constant. I know that this can be done using the residue theorem, but I don't really understand how this method works? Which function $f$ should I apply the residue theorem on?
 A: Replacing $a$ by $a^2$, From here Where Residue Theorem is used,  We have, $$\begin{align}\frac{\pi}{a} \coth(\pi a) =\sum_{-\infty}^{\infty} \frac{1}{n^{2}+a^{2}}
 &=  \sum_{-\infty}^\infty \frac{1}{a^2+(2n)^2} +\sum_{-\infty}^\infty \frac{1}{a^2+(2n+1)^2} \\
&= \color{blue}{\frac{1}{4}}\sum_{-\infty}^\infty \frac{1}{\color{blue}{\left(\frac{a}{2}\right)^2}+n^2} +\color{blue}{2}\sum_{n=0}^\infty \frac{1}{a^2+(2n+1)^2} \\
&= \color{blue}{\frac{\pi}{2a}\coth(\frac{\pi a}{2})} +\color{blue}{2}\sum_{n=0}^\infty \frac{1}{a^2+(2n+1)^2}\end{align}$$

It is worth noticing that,$$\sum_{-\infty}^\infty \frac{1}{a^2+(2n+1)^2}=\sum_{n=0}^\infty \frac{1}{a^2+(2n+1)^2}+\sum_{n=1}^\infty \frac{1}{a^2+(2n-1)^2} \\=2\sum_{n=0}^\infty \frac{1}{a^2+(2n+1)^2}$$ 
We deduce from the previous step that:
$$\color{red}{ \sum_{n=0}^\infty \frac{1}{a^{\color{blue}2}+(2n+1)^2}  =\frac{\pi}{4a}\left( 2\coth(\pi a)- \coth(\frac{\pi a}{2})\right)}$$
or 
$$\color{blue}{ \sum_{n=0}^\infty \frac{1}{a +(2n+1)^2}  =\frac{\pi}{4\sqrt{a}}\left( 2\coth(\pi \sqrt{a})- \coth(\frac{\pi \sqrt{a}}{2})\right)}$$
