I want to calculate the integral defined as
$$
P(s)=\iint \mathrm dx \, \mathrm dy\ \ \delta\left(\frac{(x+y)^2+4x^2y^2}{(x+y)^2+(x+y)^4}-s \right).
$$
The integration is taken within the rectangle $-a\le x,y\le a$. All I know is that $P(0)=0$. Is it possible to explicitly carry out this integral?



Integral of the $\delta$ function
Let's see how far we can get with the original problem. First, note that, since $x^2 y^2= \frac{1}{16} [(x+y)^4 + (x-y)^4 -2 (x+y)^2 (x-y)^2]$, the integrand is symmetric under reflections with respect to the $y=x$ axis and the $y=-x$ axis. Therefore, we can restrict the integration to the region $x+y \geq 0$, $x-y \leq 0$ (the remaining edge being the one at $y=a$), and just multiply the result by 4. Now, use the substitution suggested by @Guoqing,
$$
p=x+y\ , \hspace{2cm} q=\left( \frac{1}{x} +\frac{1}{y} \right)^{-1}
$$
which inverts to
$$
x=\frac{p}{2} - \sqrt{\frac{p^2 }{4} -pq} \, \hspace{2cm}
y=\frac{p}{2} + \sqrt{\frac{p^2 }{4} -pq}
$$
(note our choice of integration region, $x\leq y$, makes the signs of the roots unique). Under this transformation, in the argument of the $\delta $-function,
$$
\frac{(x+y)^2 +4x^2 y^2 }{(x+y)^2+ (x+y)^4 } = \frac{1+4q^2 }{1+p^2 }
$$
and the Jacobian is
$$
\left| \frac{\partial (x,y)}{\partial (p,q)} \right| = \frac{p}{2}
\frac{1}{\sqrt{\frac{p^2 }{4} -pq} }
$$
We elect to perform the integration over $q$ first. At any given, fixed $p=x+y$, the $q$-integration extends from the edge at $y=a$, from $x=p-a$, to the $x=y$ axis, at $x=y=\frac{p}{2} $. In terms of $q$, that is from $q=a-\frac{a^2 }{p} $ to $q=\frac{p}{4} $. The subsequent integration over $p$ extends from $p=0$ to $p=2a$.


The $\delta $-function yields contributions when
$$
\frac{1+4q^2 }{1+p^2 } = s \ \ \ \Longrightarrow \ \ \ q=\pm \frac{1}{2}
\sqrt{s(1+p^2 ) -1}
$$
In particular, therefore, there are no contributions unless $s(1+p^2) \geq 1$.
Thus, the $\delta $-function can be expressed as
\begin{eqnarray}
\delta \left( \frac{1+4q^2 }{1+p^2 } -s \right) &=& \theta \left(s(1+p^2 ) -1\right) \ \frac{1+p^2}{8} \frac{1}{\frac{1}{2} \sqrt{s(1+p^2 ) -1} } \cdot \\
& & \left( \delta \left( q+\frac{1}{2} \sqrt{s(1+p^2 ) -1} \right) +
\delta \left( q-\frac{1}{2} \sqrt{s(1+p^2 ) -1} \right) \right)
\end{eqnarray}
Carrying out the integration over $q$, extending over $a-\frac{a^2 }{p} \leq q \leq \frac{p}{4} $, we thus obtain
\begin{eqnarray}
P(s) &=& 4\int\_{0}^{2a} dp\ \ \theta \! \left(s(1+p^2 ) -1\right) \ 
\frac{(1+p^2)p}{8\sqrt{s(1+p^2 ) -1} } \cdot \\
& & \left[ \frac{1}{\sqrt{\frac{p^2}{4} + \frac{p}{2} \sqrt{s(1+p^2 ) -1} } }
\theta \left( -\frac{1}{2} \sqrt{s(1+p^2 ) -1} -a +\frac{a^2 }{p} \right) \right. \\
& & \left. + \frac{1}{\sqrt{\frac{p^2}{4} - \frac{p}{2} \sqrt{s(1+p^2 ) -1} } }
\theta \left( \frac{1}{2} \sqrt{s(1+p^2 ) -1} -a +\frac{a^2 }{p} \right)
\theta \left( \frac{p}{4} -\frac{1}{2} \sqrt{s(1+p^2 ) -1} \right)
\right]
\end{eqnarray}
A closed form for the $p$-integral does not seem immediately apparent, but a numerical integration offers itself.


Certainly, this result confirms the statement $P(0)=0$. In fact, $P(s)$ remains zero at least until $s=\frac{1}{1+4a^2 } $, when the upper limit of the $p$-integration comes within the range compatible with the condition $s(1+p^2 ) \geq 1$. The additional step functions in the final expression extend the range in which $P(s)$ remains zero even somewhat beyond the aforementioned bound.


