How to establish the identity of the infinite sum How to prove the following identity?
$$\sum_{n=-\infty}^{\infty}\frac{1}{(z+n)^2 +a^2} = \frac{\pi}{a}\cdot\frac{\sinh 2\pi a}{\cosh 2\pi a - \cos 2\pi z}$$

The trick  here is  to use $$\frac{1}{(z+w)^2+a^2}  \times \pi\cot(\pi
w)$$       as       shown       at      the       following       MSE
link.  The sum  term
is also quadratric in $n$ so  the estimates of the integrals presented
there apply to the present case as well. 
We get for the residues at $w = -z \pm ia$ the closed form
$$\left.\frac{1}{2(z+w)} \pi\cot(\pi w)\right|_{w=-z\pm ia}.$$
Recall that
$$\cot(v) = i \frac{\exp(iv)+\exp(-iv)}{\exp(iv)-\exp(-iv)}.$$
Introducing $x=\exp(\pi i z)$ and $y=\exp(\pi a)$
we get for the two residues
$$\frac{\pi}{2a} \frac{1/x/y+xy}{1/x/y-xy}
- \frac{\pi}{2a} \frac{y/x+x/y}{y/x-x/y}
= \frac{\pi}{2a}
\left(\frac{1+x^2y^2}{1-x^2y^2} - \frac{y^2+x^2}{y^2-x^2}\right)
\\ = \frac{\pi}{2a}
\frac{y^2+x^2y^4-x^2-x^4y^2-y^2+x^2y^4-x^2+x^4y^2}
{(1-x^2y^2)(y^2-x^2)}
\\ = \frac{\pi}{2a}
\frac{2x^2y^4-2x^2}{(1-x^2y^2)(y^2-x^2)}
= \frac{\pi}{a}
\frac{y^2-1/y^2}{(y^2-x^2-x^2y^4+x^4y^2)/y^2/x^2}
\\ = \frac{\pi}{a}
\frac{y^2-1/y^2}{1/x^2 - 1/y^2 - y^2 + x^2}.$$
Flip the sign to get
$$\bbox[5px,border:2px solid #00A000]{
\frac{\pi}{a} \frac{\sinh(2\pi a)}{\cosh(2\pi a)-\cos(2\pi z)}.}$$
Observe that  when $z = q  \mp ia$ with  $q$ an integer we have
$$\cos(2\pi z) = \cos(2\pi q \mp 2\pi i a) = \cosh(2\pi a)$$
and the  formula becomes  singular. This is  correct however  since in
this case the  sum term $$\frac{1}{(z+n)^2+a^2}$$ is  singular as well
namely when $n = -q$ and the sum is undefined.
