On the series $\sum \limits_{n=-\infty}^{\infty} \frac{\cos n}{n^2+1}$.

Hint: try to integrate $$f(z)=\frac{{\pi {e^{iz}}}}{{({z^2} + 1)({e^{2\pi iz}} - 1)}}$$ around the rectangular contour with vertices $\pm R \pm Ri$, with $R$ a half integer. You might want to check carefully that the integral indeed tends to $0$.

The sum of residues at $z=\pm i$ is $\frac{i}{2}\frac{{\pi \cosh (\pi - 1)}}{{\sinh \pi }}$, giving $$ - \frac{i}{2}\sum\limits_{n = - \infty }^\infty {\frac{{{e^{in}}}}{{{n^2} + 1}}} + \frac{i}{2}\frac{{\pi \cosh (\pi - 1)}}{{\sinh \pi }} = 0$$


$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$ With the Poisson's Sumation Formula: \begin{align} &\bbox[10px,#ffd]{\sum_{n = -\infty}^{\infty}{\cos\pars{n} \over n^{2} + 1}} = \sum_{n = -\infty}^{\infty}\int_{-\infty}^{\infty}{\cos\pars{t} \over t^{2} + 1}\expo{-2\pi\ic nt}\,\dd t \\[5mm] & = {1 \over 2}\sum_{n = -\infty}^{\infty}\bracks{\int_{-\infty}^{\infty} {\expo{\pars{1 - 2n\pi}\ic t} \over t^{2} + 1}\,\dd t + \int_{-\infty}^{\infty} {\expo{\pars{-1 - 2n\pi}\ic t} \over t^{2} + 1}\,\dd t} \end{align}


However, $\ds{\left.\int_{-\infty}^{\infty} {\expo{\ic kt} \over t^{2} + 1}\,\dd t\,\right\vert_{\ k\ \in\ \mathbb{R}} = \pi\expo{-\verts{k}}}$.
Then, \begin{align} &\bbox[10px,#ffd]{\sum_{n = -\infty}^{\infty}{\cos\pars{n} \over n^{2} + 1}} = {1 \over 2}\,\pi\sum_{n = -\infty}^{\infty}\bracks{% \expo{-\verts{2n\pi - 1}} + \expo{-\verts{2n\pi + 1}}} \\[5mm] & = \bbx{\pi\cosh\pars{\pi - 1} \over \sinh\pars{\pi}} \approx 1.1739 \\ & \end{align}