I would like to know how to sum up to following series (from the Gradshteyn-Ryzhik tables):
$$\sum_{n=-\infty}^\infty\frac{e^{in\alpha}}{(n-\beta)^2+\gamma^2}=\frac{\pi}{\gamma}\frac{e^{i\beta(\alpha-2\pi)}\sinh(\gamma\alpha)+e^{i\beta\alpha}\sinh[\gamma(2\pi-\alpha)]}{\cosh(2\pi\gamma)-\cos(2\pi\beta)}$$
with $0\leq\alpha\leq2\pi$. In the special case of $\alpha=0$, we have $$\sum_{n=-\infty}^\infty\frac1{(n-\beta)^2+\gamma^2}=\frac{\pi}{\gamma}\frac{\sinh[ 2\pi\gamma]}{\cosh(2\pi\gamma)-\cos(2\pi\beta)}$$ and I now that I can use the function $$ \frac{\cot(\pi z)}{(z-\beta)^2+\gamma^2}$$ to sum up this series via the residue theorem. In more detail, the singularities are $\beta\pm {\rm i}\gamma$ and $z_n=n$, $n\in\mathbb{N}$. If I sum the corresponding residues, I get what the above result (for $\alpha=0$).
I am not sure, however:
1) How to choose the contour in order to have a correct argumentation?
2) What to do with the general case $\alpha\neq 0$?
Let $$f(a) = \sum_{n=-\infty}^{\infty} \dfrac{e^{i(n-b)a}}{(n-b)^2+c^2}$$ We then have $$f''(a) = \sum_{n=-\infty}^{\infty} \dfrac{-(n-b)^2e^{i(n-b)a}}{(n-b)^2+c^2}$$ Hence, $$f''(a) - c^2f(a) = -\sum_{n=-\infty}^{\infty}e^{i(n-b)a} = -e^{-iba}\sum_{n=-\infty}^{\infty} e^{ina} = -e^{-iba}\pi \delta(a) + \dfrac12e^{-iba}$$ This gives us $$f(a) = c_1\sinh\left(c(2\pi-a)\right) + c_2e^{-i2ab}\sinh\left(ca\right)$$ To obtain $c_1$ and $c_2$, we have $f(0) = f(2\pi) = e^{-iba}\dfrac{\pi}c \dfrac{\sinh(2\pi c)}{\cosh(2\pi c)-\cosh(2\pi b)}$