How to compute this double integral I'm trying to show that $\int_0^1\int_0^1\frac{x^2-y^2}{(x^2+y^2)^2}dxdy \neq \int_0^1\int_0^1\frac{x^2-y^2}{(x^2+y^2)^2}dydx$ by computing these integrals directly. 
I tried using polar coordinates with no success as the bounds of integration caused problems. 
I also tried the substitution $x=ytan\theta$ but ended up getting something of the form $\infty-\infty$. 
Can anyone offer a hint as to how I can compute these directly please??? 
Thanks in advance!
 A: Put $$f(x,y) = \arctan\left( \tfrac x y \right), \,\,\,\,\,\, (x,y) \in (0,1).$$ We see $$\frac{\partial f}{\partial y} = \frac{1}{1+\left(\tfrac x y \right)^2}\left( - \frac x {y^2} \right) = -\frac{x}{x^2 + y^2}.$$ Then $$\frac{\partial }{\partial x}\frac{\partial f}{\partial y} = - \frac{1}{x^2 + y^2} + \frac{x}{(x^2 + y^2)^2}(2x) = \frac{x^2 - y^2}{(x^2+y^2)^2}.$$ Next put $$g(x,y) = -\arctan\left( \tfrac y x \right), \,\,\,\,\,\, (x,y) \in (0,1).$$ Then $$\frac{\partial g}{\partial x} = \frac{1}{1+ \left(-\tfrac{y}{x}\right)^2} \left(\frac{y}{x^2} \right) = \frac{y}{x^2 + y^2}$$ so $$\frac{\partial}{\partial y}\frac{\partial g}{\partial x} = \frac{1}{x^2+y^2} - \frac{y}{(x^2+y^2)^2}(2y) = \frac{x^2 - y^2}{(x^2+y^2)^2}.$$ Then \begin{align*} \int^1_0 \int^1_0 \frac{x^2 - y^2}{(x^2+y^2)^2} dx dy &= \int^1_0 \int^1_0 \frac{\partial }{\partial x}\frac{\partial f}{\partial y} dx dy \\ 
&= \int^1_0 \frac{\partial f}{ \partial y}(1,y) - \frac{\partial f}{ \partial y}(0,y) dy \\
&=- \int^1_0 \frac{1}{1+y^2} dy = - \arctan(1) = - \frac \pi 4
\end{align*} and \begin{align*} \int^1_0 \int^1_0 \frac{x^2 - y^2}{(x^2+y^2)^2} dy dx &= \int^1_0 \int^1_0 \frac{\partial }{\partial y}\frac{\partial g}{\partial x} dy dx \\ 
&= \int^1_0 \frac{\partial g}{ \partial x}(x,1) - \frac{\partial g}{ \partial x}(x,0) dy \\
&= \int^1_0 \frac{1}{1+x^2} dx =  \arctan(1) =  \frac \pi 4.
\end{align*}
A: The integral is not absolutely convergent, so we cannot change the order of integration, or the coordinates used, and expect to get the same answer.

Polar Coordinates
If we try to convert to polar coordinates,
$$
\begin{align}
\int_0^1\int_0^1\frac{x^2-y^2}{\left(x^2+y^2\right)^2}\,\mathrm{d}x\,\mathrm{d}y
&=\int_0^1\int_0^{\pi/2}\left(\cos^2(\theta)-\sin^2(\theta)\right)\frac1r\,\mathrm{d}\theta\,\mathrm{d}r\\
&+\int_1^{\sqrt2}\int_{\cos^{-1}\left(\frac1r\right)}^{\sin^{-1}\left(\frac1r\right)}\left(\cos^2(\theta)-\sin^2(\theta)\right)\frac1r\,\mathrm{d}\theta\,\mathrm{d}r\\
&=\int_0^1\int_0^{\pi/2}\left(\cos^2(\theta)-\sin^2(\theta)\right)\frac1r\,\mathrm{d}\theta\,\mathrm{d}r\\
&=\int_0^10\cdot\frac1r\,\mathrm{d}r\\[6pt]
&=0
\end{align}
$$
The integral for $1\le r\le\sqrt2$ converges absolutely and is equal to its negative under the substitution $\theta\mapsto\frac\pi2-\theta$. Therefore, the integral for $1\le r\le\sqrt2$ is $0$.
The integral for $0\le r\le1$ is equal to $0$ for each $r$, so the integral is $0$ if integrated in $\theta$ first.
Of course, the integral does not converge when integrated in $r$ first since $\int_0^1\frac1r\,\mathrm{d}r$ diverges.

Rectangular Coordinates
$$
\begin{align}
\int_0^1\int_0^1\frac{x^2-y^2}{\left(x^2+y^2\right)^2}\,\mathrm{d}x\,\mathrm{d}y
&=\int_0^1\frac1y\int_0^{1/y}\frac{x^2-1}{\left(x^2+1\right)^2}\,\mathrm{d}x\,\mathrm{d}y\\
&=\int_0^1\frac1y\int_0^{\tan^{-1}(1/y)}\left(\sin^2(u)-\cos^2(u)\right)\,\mathrm{d}u\,\mathrm{d}y\\
&=-\int_0^1\frac1y\left[\sin(u)\cos(u)\vphantom{\frac1y}\right]_0^{\tan^{-1}(1/y)}\,\mathrm{d}y\\
&=-\int_0^1\frac1{y^2+1}\,\mathrm{d}y\\[6pt]
&=-\frac\pi4
\end{align}
$$
Similarly, we get
$$
\begin{align}
\int_0^1\int_0^1\frac{x^2-y^2}{\left(x^2+y^2\right)^2}\,\mathrm{d}y\,\mathrm{d}x
&=\int_0^1\int_0^1\frac{y^2-x^2}{\left(x^2+y^2\right)^2}\,\mathrm{d}x\,\mathrm{d}y\\[6pt]
&=\frac\pi4
\end{align}
$$

