Integral of functions of several variables The function is defined from $[-1,1]\times[-1,1]$ to $\Bbb R$, given by $f(x,y)=\frac{x^2-y^2}{(x^2+y^2)^2}$ when $(x,y)≠0$ and $f(0,0)=0$.
I could find that the function is not continuous at origin, so not differentiable  and also partial derivatives does not exist at origin.
But how do we evaluate the integral of the function over the given domain. Being function of several variable how do we deal with the point of discontinuity? Can we convert it to polar coordinates and apply residue theorem? Do we have any other methods?
Any help would be appreciated. Thanks in advance.
 A: There are a number of ways to interpret this integral.
(1) The function is not Riemann integrable on $[-1,1]\times [-1,1]$ because it is unbounded.
(2)  It is not Lebesgue integrable since
$$\int_{[-1,1]^2}|f| \geqslant \int_0^{2\pi}\int_\delta ^1 \frac{|r^2 \cos^2\theta - r^2\sin^2\theta|}{r^4}\, r\, dr\, d\theta \underset{\delta \to 0+}\longrightarrow + \infty$$
(3) The iterated integrals exist but are unequal (the conditions of Fubini's theorem are violated).
Note that
$$\int_{-1}^1 \left(\int_{-1}^1\frac{x^2- y^2}{(x^2+y^2)^2}\, dy \right)\, dx = \int_{-1}^1 \left(\int_{-1}^1\frac{\partial}{\partial y}\frac{y}{x^2+y^2}\, dy \right)\, dx = \int_{-1}^1 \frac{2}{1+x^2}\, dx = \pi,$$
and by antisymmetry
$$\int_{-1}^1 \left(\int_{-1}^1\frac{x^2- y^2}{(x^2+y^2)^2}\, dx \right)\, dy = -\int_{-1}^1 \left(\int_{-1}^1\frac{x^2- y^2}{(x^2+y^2)^2}\, dy \right)\, dx = -\pi $$
(4) An improper (or extended) Riemann integral over a set $A$ in $\mathbb{R}^2$ is defined as
$$\tag{*} \lim_{n \to \infty} \int_{A_n}f(x,y) \,d(x,y),$$
where $(A_n)$ is a sequence of compact rectifiable sets such that $A_n \subset A_{n+1}$ and $\bigcup_{n=1}^\infty A_n = A$.
This will converge to a unique value independent of the choice for $(A_n)$ only if the function is absolutely integrable, and in this case it was shown in (2) that this does not hold.  It is possible to construct sequences $(A_n)$ where the limit (*) is $0$ or $+\infty$, for example.
A: The improper integral $$\int_{-1}^1 \int_{-1}^1 \frac{x^2-y^2}{(x^2+y^2)^2} \, dy \, dx$$ diverges. To see why, consider the region $\mathcal{R}$ contained in $[-1,1]\times [-1,1]$ defined in polar coordinates by$$\mathcal{R}=\Big\{(r,\theta)\Big| 0<r<1, 0<\theta<\pi/8\Big\}$$ Then $$\int \int _{\mathcal{R}}\frac{x^2-y^2}{(x^2+y^2)^2} \, dy \, dx=\int_{0}^{\pi/8} \int_0^1\frac{\cos(2\theta)}{r} \, dr \, d\theta=+\infty$$
A: This is a (somewhat?) standard example of how rearranging an iterated integral makes it converge conditionally to either of two different numbers.
\begin{align}
& \int_0^1 \left( \int_0^1 \frac{x^2-y^2}{(x^2+y^2)^2} \, dy \right) \, dx = +\frac \pi 4. \\[10pt]
& \int_0^1 \left( \int_0^1 \frac{x^2-y^2}{(x^2+y^2)^2} \, dx \right) \, dy = -\frac \pi 4. \\[10pt]
& \iint\limits_{0\,<\,y\,<\,x\,<\,1} \frac{x^2-y^2}{(x^2+y^2)^2} \, d(x,y) = +\infty. \\[10pt]
& \iint\limits_{0\,<\,x\,<\,y\,<\,1} \frac{x^2-y^2}{(x^2+y^2)^2} \, d(x,y) = -\infty. \\[10pt]
& \iint\limits_{\varepsilon\,<\,x\,<\,1 \\ \varepsilon\,<\,y\,<\,1} \frac{x^2-y^2}{(x^2+y^2)^2} \, d(x,y) = 0.
\end{align}
Only when the integrals of the positive and negative parts are both infinite can the values of the two iterated integrals differ.
Let $y = x\tan \theta$, so that $dy = x\sec^2\theta\,d\theta$ and
$x^2 + y^2= x^2\sec^2\theta$, and as $y$ goes from $0$ to $1$
then $\theta$ goes from $0$ to $\arctan(1/x)$. Then
\begin{align*}
\int_0^1 \frac{x^2-y^2}{(x^2+y^2)^2} \, dy
= {} & \int_0^{\arctan(1/x)}
\frac{x^2 - x^2 \tan^2\theta}{(x^2 + x^2\tan^2\theta)^2} \big( x\sec^2\theta\,d\theta\big) \\[10pt]
= {} & \frac 1 x \int_0^{\arctan(1/x)} \frac{1-\tan^2 \theta}{\sec^2 \theta} \, d\theta \\[10pt]
= {} & \frac 1 x \int_0^{\arctan(1/x)} (\cos^2\theta-\sin^2\theta) \, d\theta \\[10pt]
= {} & \frac 1 x \int_0^{\arctan(1/x)} \cos(2\theta) \, d\theta \\[10pt]
= {} & \frac 1 {2x} \sin\left(2\arctan \frac 1 x\right) \\[10pt]
= {} & \frac 1 x \sin\left(\arctan \frac 1 x \right) \cos\left( \arctan \frac 1 x \right) \\[10pt]
= {} & \frac 1 x \cdot \frac 1 {\sqrt{1+x^2}} \cdot \frac x {\sqrt{1+x^2}} = \frac 1 {1+x^2}. \\[10pt]
\text{And then}
& \int_0^1 \frac{dx}{1+x^2} = \frac \pi 4.
\end{align*}
