Proving $\sum_{n=1}^\infty \frac{1}{(n^2+a^2)^2}=\frac{\pi}{4a^3}\left[\coth(\pi a)+\frac{\pi a}{\sinh^2 \pi a}-\frac{2}{\pi a}\right]$ Use the function $$f(z)=\frac{\pi\text{cosec}(\pi z)}{z^2+a^2}$$
to show that
$$\sum_1^\infty \frac{1}{(n^2+a^2)^2}=\frac{\pi}{4a^3}\left[\coth(\pi a)+\frac{\pi a}{\sinh^2 \pi a}-\frac{2}{\pi a}\right]$$

I'm trying to use Mittag-Leffler decomposing
$$f(z)=f(0)+\sum_{j=1}^\infty \text{Res}_{z=z_j}\left(\frac{1}{z-z_j}+\frac{1}{z_j}\right)$$
Using this on our function, We have
$$\frac{\pi\text{cosec}(\pi z)}{z^2+a^2}=\frac{\pi \csc(\pi ai)}{2ai}\left(\frac{1}{z-ai}+\frac{1}{ai}\right)+\frac{\pi\text{cosec}(\pi z)}{z^2+a^2}+\frac{\pi \csc(\pi ai)}{2ai}\left(\frac{1}{z+ai}-\frac{1}{ai}\right)+\sum_{n=-\infty}^\infty \frac{\pi}{n^2+a^2}\left(\frac{1}{z-n}+\frac{1}{n}\right)$$
which can be simplified to
$$=\frac{\pi \csc(\pi ai)}{ai}\left(\frac{z}{z^2+a^2}\right)+\sum_{-\infty}^\infty \frac{\pi}{n^2+a^2}\left(\frac{z}{n(z-n)}\right)$$
I don't know how to proceed. Apart from this $f(z)$ has a singularity at origin so  how to compute $f(0)$. Please help me with this.
 A: Without the hint.
$$\frac{1}{(n^2+a^2)^2}=\frac{i}{4 a^3 (n+i a)}-\frac{i}{4 a^3 (n-i a)}-\frac{1}{4 a^2 (n+i
   a)^2}-\frac{1}{4 a^2 (n-i a)^2}$$ Computing the partial sums
$$\sum_{n=1}^p\frac{i}{4 a^3 (n+i a)}=-\frac{i (\psi ^{(0)}(i a+1)-\psi ^{(0)}(i a+p+1))}{4 a^3}$$
$$\sum_{n=1}^p\frac{i}{4 a^3 (n-i a)}=-\frac{i (\psi ^{(0)}(1-i a)-\psi ^{(0)}(-i a+p+1))}{4 a^3}$$
$$\sum_{n=1}^p \frac{1}{4 a^2 (n+i a)^2}=\frac{\psi ^{(1)}(i a+1)-\psi ^{(1)}(i a+p+1)}{4 a^2}$$
$$\sum_{n=1}^p \frac{1}{4 a^2 (n-i a)^2}=\frac{\psi ^{(1)}(1-i a)-\psi ^{(1)}(-i a+p+1)}{4 a^2}$$
Now, using asymptotics,
$$\sum_{n=1}^p \frac{1}{(n^2+a^2)^2}=\frac{\pi  a \left(\coth (\pi  a)+\pi  a \text{csch}^2(\pi  a)\right)-2}{4
   a^4}-\frac{1}{3 p^3}+\frac{1}{2 p^4}+O\left(\frac{1}{p^5}\right)$$
A: Not using complex Analysis but I have a relatively simple approach using mittag leffler expansion of $cot(πx)$.
Let,
$$S(a)=\sum_{n=1}^{\infty}\frac{1}{(n^{2}+a^{2})^{2}}$$
Multiply both sides of equation by $-2a$.
$$-2aS(a)=\sum_{n=1}^{\infty}\frac{-2a}{(n^{2}+a^{2})^{2}}$$
Indefinite integral on both sides wrt $a$ gives,
$$2\int_{}^{}aS(a)da=-\sum_{n=1}^{\infty}\frac{1}{n^{2}+a^{2}}$$
Bring that negative sign inside the summation and cleverly
make $-a^{2}=(ia)^{2}$. This step allows us to use mittag leffler expansion.
$$2\int_{}^{}aS(a)da=\sum_{n=1}^{\infty}\frac{1}{(ia)^{2}-n^{2}}$$
Mittag leffler expansion states that,
$$\pi cot(πz)= \frac{1}{z}+2\sum_{n=1}^{\infty}\frac{z}{z^{2}-n^{2}}$$
Solving for series in it and placing $z=ia$ gives
$$2\int_{}^{}aS(a)da=\frac{1}{2a^{2}}-\frac{i\pi cot(iπa)}{2a}$$
Now differentiate wrt $a$ on both sides of equation and divide by $a$ at last to arrive at the expression for $S(a)$.
