TITLE: Evaluating $\sum_{n=1}^{\infty} \frac{1}{n^2+1}$
QUESTION [14 upvotes]: While I know that $$\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^{2}}{6}$$
But trying to evaluate this has left me stumped
$$\sum_{n=1}^{\infty} \frac{1}{n^2+1}$$
I evaluated it through wolfram alpha, it gave me $\frac{1}{2}(\pi\coth(\pi)-1)$.
What would be a good way to start evaluating this series?

REPLY [3 votes]: The simplest way is using contour integration. With some experience you can do the entire computation completely in your head. I'll write down the solution doing all the computations as I write along. For a counterclockwise contour $C$ that doesn't contain any poles of a meromorphic function $g(z)$, we have for an analytic function $f(z)$:
$$\oint_C \frac{f'(z}{f(z)}g(z) dz = 2\pi i\sum_n g(\alpha_n) $$
where the $\alpha_n$ are the zeros of $f(z)$ inside the contour $C$.
If the contour does contains poles of $g(z)$ you just add the residues at these points to the summation. To calculate the summation, we can take $f(z) = \sin(\pi z)$ as this function has its zeros at the integers. The summation can thus be obtained by taking $g(z) = \frac{1}{1+z^2}$ and integrating along a contour that encircles the positive real axis, such that the poles of $g(z)$ at $z = \pm i$ are left outside.
Consider the contour integral that starts just below the point $z = 1$, moves to a point just below $z = R$, crosses the real axis to just above $z = R$ and then moves just to the left of $z = 1$, crosses the real axis there and then we complete the contour. In the limit of $R\to\infty$ this will yield the desired summation. The integrand being an even function, we can also consider a similar contour that encircles the negative real axis, from just below $z=-R$ to just below $z = -1$, crossing the real axis to the right of $z = -1$ to just above the real axis and then we move just above the real axis to just above $z = -R$ and then we move back to the starting point. The sum of the two contour integrals is thus twice the desired summation.
Then consider cutting open the two contours near $z = \pm R$ and connecting the two parts of the two contours above the real axis and do the same below the real axis. In the limit of $R\to\infty$ the integrals along the parts of the contours joining the two parts can be made arbitrarily small as the modulus of the integrand goes to zero far enough for $z\to \infty$.
The resulting contour is now a clockwise contour that only contains the poles at $z = 0$ and at $z = \pm i$. The residue at the pole at $z = 0$ is $g(1) = 1$. The residue at $z = \pm i$ is:
$$\lim_{z\to\pm i} (z-\pm i)\frac{\pi\cot(\pi z)}{z^2+1} = -\frac{\pi}{2} \coth(\pi)$$
So, the sum of the two contour integrals is equal to twice the summation we want to evaluate times $2\pi i$, but this is also equal to minus $2\pi i$ times $-\pi\coth(\pi)$ plus 1, therefore the desired summation is:
$$\sum_{n=1}^{\infty} \frac{1}{1+n^2} = \frac{1}{2}\left[\pi\coth(\pi) - 1\right]$$
So, the only computations to get to the answer were just trivial applications of L'Hopital's rule, simple enough to do in your head.