<s>[INST] Solving multiple integrals I need to integrate $\displaystyle f(x,y)=\frac{x^2-y^2}{(x^2+y^2)^2}$ on $R=[0,1]\times [0,1]$
If I take $u=x^2+y^2,$ then $\int_0^1\int_{y^2}^{1+y^2}\frac{u-2y^2}{u^2}du$. I do not know how to proceed from here. Any help would be appreciated!
Thanks in advance!
 [/INST] We must have
$$
\int_0^1 \left( \int_0^1 \frac{x^2-y^2}{(x^2+y^2)^2} \,dx\right) \,dy = - \int_0^1 \left( \int_0^1 \frac{x^2-y^2}{(x^2+y^2)^2} \,dy\right) \,dx
$$
since the difference between the two expressions is really only a reversal in the order of subtraction.
Now to the inner integral:
\begin{align}
& \int_0^1 \frac{x^2-y^2}{(x^2+y^2)^2}\,dx = \int_0^{\arctan(1/y)} \frac{y^2\tan^2\theta - y^2}{(y^2\tan^2\theta + y^2)^2} (y\sec^2\theta\,d\theta) \\[10pt]
= {} & \int_0^{\arctan(1/y)} \frac{y^2\tan^2\theta - y^2}{(y^2\sec^2\theta)^2} (y\sec^2\theta\,d\theta) = \int_0^{\arctan(1/y)} \frac{\tan^2\theta - 1}{y\sec^2\theta} \,d\theta \\[10pt]
= {} & \frac 1 y \int_0^{\arctan(1/y)} (\sin^2\theta-\cos^2\theta) \, d\theta = \frac 1 y \int_0^{\arctan(1/y)} -\cos(2\theta)\,d\theta \\[10pt]
= {} & 
\frac 1 y \left[ \frac{-\sin(2\theta)} 2 \right]_0^{\arctan(1/y)} = \frac 1 y \left( -2\sin\left(\arctan\frac 1 y\right) \cos\left( \arctan \frac 1 y \right) \right) \\[10pt]
= {} & \frac 1 y \left( \frac {-1} {\sqrt{1+y^2}} \cdot \frac y {\sqrt{1+y^2}}  \right) = \frac {-1} {1+y^2}.
\end{align}
The outer integral is then
$$
\int_0^1 \frac{-dy}{1+y^2} = \frac {-\pi} 4.
$$
Hence when we integrate in the other order we get $+\pi/4$.
By Fubini's theorem, these two iterated integrals can differ in value only if we fail to have absolute convergence, i.e. the double integral (as opposed to the iterated integrals) of the absolute value is infinite:
$$
\iint_{[0,1]\times[0,1]} \left| \frac{x^2 -y^2}{(x^2+y^2)^2} \right| \, d(x,y) = \infty.
$$
Notice that we used these trigonometric identities:
$$
\sin \arctan \frac 1 y = \frac 1 {\sqrt{1+y^2}} \text{ and } \cos \arctan \frac 1 y = \frac y {\sqrt{1+y^2}}.
$$
These can be shown as follows:
$$
\text{If }\tan\theta = \frac{\text{opposite}}{\text{adjacent}} = \frac 1 y \text{ then } \sin\theta = \frac{\text{opposite}}{\text{hypotenuse}} = \frac 1 {\sqrt{1+y^2}},
$$
where the length of the hypotenuse is found via the Pythagorean theorem, and the identity for cosine is done similarly.
</s>