How can I prove this double sum equation? I'm trying to prove that:
$$\sum_{n=1}^\infty\sum_{m=1}^\infty\frac{n^2x^2-m^2}{(m^2+n^2x^2)^2}=-\frac{\pi}{2x}-\frac{1}{x^2}\sum_{n=1}^\infty\sum_{m=1}^\infty\frac{n^2x^2-m^2}{\left(m^2+n^2/x^2\right)^2}$$
I'm missing $-\frac{\pi}{2x}$ in my process, just by swapping $n\to m,\, m\to n$ in sum above on LHS as follows:
$$\begin{align*}\sum_{n=1}^\infty\sum_{m=1}^\infty\frac{n^2x^2-m^2}{(m^2+n^2x^2)^2}&=\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2x^2-n^2}{(n^2+m^2x^2)^2}\\
&=-\frac1{x^2}\sum_{n=1}^\infty\sum_{m=1}^\infty\frac{n^2/x^2-m^2}{(m^2+n^2~/x^2)^2}\end{align*}$$
Here I see that the exchange of summation operators probably cannot be applied, but I can't see that. Any help will be welcome!
 A: The sum doesn't converge absolutely, so you can't simply rearrange it.
The equality itself holds for $x>0$, and is the particular case (at $z=ix$) of the following fact (known as a property of the so-called non-holomorphic Eisenstein series $G_2$):

For $z\in\mathbb{C}$ with $\Im z>0$, and for $m,n\in\mathbb{Z}$, define $$f_{m,n}(z)=\begin{cases}\hfill 0,\hfill&(m,n)=(0,0)\\(m+nz)^{-2},&\hfill\text{otherwise}\hfill\end{cases},\\F(z)=\sum_{n\in\mathbb{Z}}\sum_{m\in\mathbb{Z}}f_{m,n}(z),\qquad\overline{F}(z)=\sum_{m\in\mathbb{Z}}\sum_{n\in\mathbb{Z}}f_{m,n}(z).$$ Then $F(z)-\overline{F}(z)=2\pi i/z$.

Here is the most elementary proof I know. Define, a similar way, $$g_{m,n}(z)=\begin{cases}\hfill 0,\hfill&(m,n)\in\big\{(0,0),(1,0)\big\}\\(m-1+nz)^{-1}-(m+nz)^{-1},&\hfill\text{otherwise}\hfill\end{cases},\\G(z)=\sum_{n\in\mathbb{Z}}\sum_{m\in\mathbb{Z}}g_{m,n}(z),\qquad\overline{G}(z)=\sum_{m\in\mathbb{Z}}\sum_{n\in\mathbb{Z}}g_{m,n}(z).$$
Then $F(z)-G(z)=\overline{F}(z)-\overline{G}(z)$ since this time we have absolute convergence.
Further, it's easy to see that $G(z)=2$ identically; indeed $\sum_{m\in\mathbb{Z}}g_{m,n}(z)$ is a telescoping sum, which vanishes if $n\neq 0$, and equals $2$ if $n=0$.
The sum $\overline{G}(z)$ is also a telescoping one, but a bit harder (for me). Using the known $$\sum_{n=1}^\infty\left(\frac1{z+n}+\frac1{z-n}\right)=\pi\cot\pi z-\frac1z\qquad(z\in\mathbb{C}\setminus\mathbb{Z})$$ we find $$\sum_{n\in\mathbb{Z}}g_{m,n}(z)=\begin{cases}\hfill 1-\frac{\pi}{z}\cot\frac{\pi}{z},\hfill&m\in\{0,1\}\\\frac{\pi}{z}\left(\cot\pi\frac{m-1}{z}-\cot\pi\frac{m}{z}\right),&\hfill\text{otherwise}\hfill\end{cases}.$$
Since $\Im z>0$, we have $\lim\limits_{m\to\pm\infty}\cot(\pi m/z)=\pm i$. Thus, summing the above over $m\in\mathbb{Z}$, $$\overline{G}(z)=\frac{\pi}z\left(-i-\cot\frac{-\pi}z\right)+2\left(1-\frac{\pi}z\cot\frac{\pi}z\right)+\frac{\pi}z\left(\cot\frac{\pi}z-i\right)=2-\frac{2\pi i}z,$$ and the desired result follows.
