I'm considering the possibility of calculating an integral of the form $\int_{S_n} f(x_1,\dots,x_n) dx_1\dots dx_n$ via level sets, where $S_n$ is the domain of integration. In my problem everything is real valued, and $f:R^n\to R$. Also, consider $f$ smooth, with no holes, etc.
Now, consider $g$ a real number that solves the equation $g=f(x_1,\dots,x_n)$, i.e., a level set. Then, I think one can write the relation \begin{equation} \int_{S_n}f(x_1,\dots,x_n) dx_1\dots dx_n=\int g\rho(g)dg \end{equation} where $\rho(g)dg$ is the density distribution of $g$, or roughly speaking the number of solutions of the level set equation for $g$. A simple example: consider calculating the volume of a half sphere (radius $r$) centered at $(a,a,0)$. Then, the integral on the left hand of the identity is $\int dx \int dy \sqrt{r^2-(x-a)^2-(y-a)^2}$, and the right hand is $\int dz 2\pi\sqrt{r^2-z^2}z$ where $g=z$ and $\rho(g=z)=2\pi\sqrt{r^2-z^2}$.
First, is this statement roughly correct? I suspect it's related to the coarea formula, but am not entirely sure as this is not my area of expertise. Does this result have a particular name?
Also, it seems to me that $\rho(g)$ would relate to the Jacobian (modulus) in some way, although I don't think it's just equal. Any ideas?
Finally, even if all of this is correct, in a concrete case it seems to me that unless $f$ is a very simple example, it is going to be difficult to make concrete calculations in most cases. However, I should still whether there are some techniques out there to deal with this analytically. Or should one consider numerical techniques?
Thanks