I am trying to evaluate the following integral $$\iint \limits_{[0,1]^2} {\rm d}x{\rm d}y\;f(x,y) \delta(g(x,y))$$ where $$g(x,y) = a_0 + a_1 x + a_2 y + a_3 xy $$ and $\delta(\cdot)$ is the Dirac delta distribution.
I am not sure about how to deal with the function $g$ inside $\delta$. I am familiar with the equality $$\int\limits_{-\infty}^\infty {\rm d}x\; f(x) \delta(g(x)) = \sum\limits_i \frac{f(x_i)}{\left| g\prime(x_i)\right|} \tag{1}\label{eq1}$$ in one dimension where the sum runs over the zeros of $g(x)$ and which holds if all the zeros are simple and isolated and if $g\prime (x_i) \neq 0 \forall x_i$. I also found $$ \int\limits_{\mathbb{R}^n}{\rm d}{\bf x} \; f({\bf x}) \delta(g({\bf x})) = \int\limits_{g^{-1}(0)} \frac{f({\bf x})}{\left| \nabla g({\bf x})\right|} {\rm d}\sigma({\bf x}) \tag{2}\label{eq2}$$ on Wikipedia for a function $g:\mathbb{R}^n\rightarrow \mathbb{R}$ where $g^{-1}(0)$ is the $(n-1)$ dimensional surface (line in our case) defined by $g({\bf x})=0$. Last but not least, I also read the discussion in this thread and took a look to the references given by the user Poor Soul there.
Now, my problem is that $g$ has infinite zeros which are not isolated and $\nabla g$ can become zero, so the assumptions made in Eqs. $\eqref{eq1}$ and $\eqref{eq2}$ do not hold. However, we know that $g$ is linear in one variable when we fix the other and thus is can only have one zero in one of the cartesian directions. Maybe we can make use of this in Eq. $\eqref{eq1}$. Moreover, on Wikipedia it is said that $\nabla g \neq 0 \forall {\bf x}\in\mathbb{R}^n$ is required in Eq. $\eqref{eq2}$. However, I am wondering why $\nabla g \neq 0 \forall {\bf x}\in g^{-1}(0)$ is not enough. The second issue is how to handle the integration domain which is not the entire $\mathbb{R}^2$ but only the unit square.
Thank you very much for your help!
P.S.: For those that are interested: The final goal is to compute the density of states (DOS) in solid state physics from an energy obtained by bilinear (and later trilinear) interpolation.