Show the function defined on $[0,1] \times [0,1]$ via $\frac{x^2-y^2}{(x^2+y^2)^2}$ if $(x,y) \neq 0$ and $0$ otherwise is not integrable. Let $f: [0,1] \times [0,1] \rightarrow \Bbb{R}$ be defined via
$$f(x,y)=
\begin{cases}
\frac{x^2-y^2}{(x^2+y^2)^2} &(x,y) \neq (0,0) \\
(0,0) & \text{otherwise}
\end{cases}$$
So I know if I integrate with respect to $x$ I get
$$\frac{-x}{x^2+y^2}$$
and if I integrate this with respect to $y$ I get
$$-\tan^{-1}(\frac{y}{x})$$
which is bounded. How is this function non-integrable? also when integrating w.r.t. $x$ was I supposed to plug in end points $0$ and $1$ before moving onto integrating $y$?
 A: The iterated integrals exist but are not equal (the sign changes depending upon the order of integration).  That is a clue that the function is not absolutely integrable either in the sense of Lebesgue integration or improper Riemann integration. Otherwise Fubini's theorem would imply that the iterated integrals are equal.
For improper Riemann integration over $[0,1]^2$ with $S_{\epsilon} = \{(x,y)\in [0,1]^2: \epsilon^2 \leqslant x^2+y^2 \leqslant 1\}$, we get after changing to polar coordinates
$$\int_{[0,1]^2}\left|\frac{x^2- y^2}{(x^2+y^2)^2}\right| \, d(x,y)\geqslant \lim_{\epsilon \to 0}\int_{S_{\epsilon}} \left|\frac{x^2- y^2}{(x^2+y^2)^2}\right| \, d(x,y) = \lim_{\epsilon \to 0}\int_0^{\pi/2}\int_\epsilon^1 \frac{r^2|\cos^2 \theta- \sin^2 \theta|}{r^4}r \, dr \, d\theta \\ = \lim_{\epsilon \to 0}\int_\epsilon^1 \frac{dr}{r}\underbrace{\int_0^{\pi/2}|\cos^2 \theta- \sin^2 \theta| d\theta}_{= 1}= \lim_{\epsilon \to 0} (-\log \epsilon)= +\infty$$

Note that the step
$$\int_{S_{\epsilon}} \left|\frac{x^2- y^2}{(x^2+y^2)^2}\right| \, d(x,y) = \int_0^{\pi/2}\int_\epsilon^1 \frac{r^2|\cos^2 \theta- \sin^2 \theta|}{r^4}r \, dr \, d\theta,$$
equating a double integral to an iterated integral is justified because the integrand is Riemann integrable over the region $S_\epsilon$ which avoids the singularity at $(0,0)$.
A: I claim that
$$\int_0^1 \int_0^1 f(x,y) dx dy \neq \int_0^1 \int_0^1 f(x,y) dy dx.$$
We compute the LHS:
\begin{align*}
    \int_0^1 \int_0^1 f(x,y) dx dy &= \int_0^1 \int_0^1 \frac{x^2-y^2}{(x^2+y^2)^2} dx dy\\
    &= \int_0^1 -\frac{x}{x^2+y^2} \bigg\vert_0^1 dy\\
    &=-\int_0^1 \frac{1}{1+y^2}dy\\
    &=- \tan^{-1}(y) \bigg \vert_0^1\\
    &= -\frac{\pi}{4}
\end{align*}
Now we compute the RHS:
\begin{align*}
    \int_0^t \int_0^1 f(x,y) dydx &= \int_0^1 \int_0^1 \frac{x^2-y^2}{(x^2+y^2)^2} dy dx\\
    &=\int_0^1 \frac{y}{x^2+y^2} \bigg \vert_0^1 dx\\
    &= \int_0^1 \frac{1}{x^2+1} dx\\
    &= \tan^{-1}(x) \bigg \vert_0^1 \\
    &= \frac{\pi}{4}
\end{align*}
thus $f(x,y)$ is not integrable.
