<s>[INST] 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.
 [/INST] 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)$$
</s>