Let $\omega_n=e^{\mathrm{i} \pi (2n+1)/N}$, for n=0,...,N-1, be the N-th roots of (-1). So that the sum for a suitable analytic functions $f(z)$ can be turned into a contour integral
$S=\frac{1}{N} \sum_{n=0}^{N-1} f(\omega_n)=\frac{1}{2\pi \mathrm{i}} \oint_C \frac{\mathrm{d}z}{z} \frac{z^N}{z^N+1} f(z),$
where C consists of a pair of oppositely oriented concentric circles. The annulus formed by the circles should include all the roots of (-1), but exclude all singularities of $f$. Now how to use this result to show that, for N even,
$S=\frac1{N} \sum_{n=0}^{N-1} \frac{\sinh E}{\sinh^2 E+\sin^2 \frac{(2n+1)\pi}{N}}=\frac1{\cosh E} \tanh \frac{NE}{2}$
And also how to show that if we take $N\to\infty$ while scaling $E\to 0$ in some suitable manner, the above equation turns into
$\sum_{-\infty}^{\infty} \frac{a}{a^2+[(2n+1)\pi]^2}=\frac12\tanh\frac{a}{2}$