Strange delta function I don't know what to do when I see a delta-function of the following sort appear in an integral (3d-spherical here):
$$\delta^3(r\sin \theta - r_0).$$
E.g. the argument is a function of two of the variables.
I'm familiar with the standard properties of delta-fns. Are there some tricks I should know about this?
 A: In this answer, it is shown that when composing the dirac delta with $g(x)$, we get
$$
\int_{\mathbb{R}^n} f(x)\,\delta(g(x))\,\mathrm{d}x=\int_{\mathcal{S}}\frac{f(x)}{|\nabla g(x)|}\,\mathrm{d}\sigma(x)
$$
where $\mathcal{S}$ is the surface on which $g(x)=0$ and $\mathrm{d}\sigma(x)$ is standard surface measure on $\mathcal{S}$.
In your question, $\mathcal{S}$ is the surface where $r\sin(\theta)-r_0=0$ and therefore,
$$
|\nabla g(r,\theta,\phi)|=\sqrt{1+\cos^2(\theta)\tan^2(\phi)}
$$
$$
\mathrm{d}\sigma(x)=\frac{r_0^2}{\sin^3(\theta)}\sqrt{1-\sin^2(\theta)\sin^2(\phi)}\,\mathrm{d}\theta\,\mathrm{d}\phi
$$ 
So
$$
\begin{align}
&\int_{\mathbb{R}^n}f(r,\theta,\phi)\,\delta(r\sin(\theta)-r_0)\,\mathrm{d}r\,\mathrm{d}\theta\,\mathrm{d}\phi\\
&=\int_{\mathcal{S}}f(r,\theta,\phi)\frac{r_0^2}{\sin^3(\theta)}\frac{\sqrt{1-\sin^2(\theta)\sin^2(\phi)}}{\sqrt{1+\cos^2(\theta)\tan^2(\phi)}}\,\mathrm{d}\theta\,\mathrm{d}\phi
\end{align}
$$

Computation of $|\nabla g|$
The Jacobian from $(r,\theta,\phi)$ to $(x,y,z)$ is
$$
\mathcal{J}=\left[
\begin{array}{ccc}
 \cos (\theta ) \cos (\phi ) & -r \cos (\phi ) \sin (\theta ) & -r \cos (\theta ) \sin
   (\phi ) \\
 \cos (\phi ) \sin (\theta ) & r \cos (\theta ) \cos (\phi ) & -r \sin (\theta ) \sin
   (\phi ) \\
 \sin (\phi ) & 0 & r \cos (\phi )
\end{array}
\right]
$$
and its inverse is
$$
\mathcal{J}^{-1}=\frac1r\left[
\begin{array}{ccc}
 r \cos (\theta ) \cos (\phi ) & r \cos (\phi ) \sin (\theta ) & r \sin (\phi ) \\
 -\sec (\phi ) \sin (\theta ) & \cos (\theta ) \sec (\phi ) & 0 \\
 -\cos (\theta ) \sin (\phi ) & -\sin (\theta ) \sin (\phi ) & \cos (\phi )
\end{array}
\right]
$$
Since
$$
\begin{align}
\mathrm{d}(r\cos(\theta)-r_0)
&=\begin{bmatrix}\sin(\theta)&r\cos(\theta)&0\end{bmatrix}
\begin{bmatrix}\mathrm{d}r\\\mathrm{d}\theta\\\mathrm{d}\phi\end{bmatrix}\\
&=\begin{bmatrix}\sin(\theta)&r\cos(\theta)&0\end{bmatrix}\mathcal{J}^{-1}
\begin{bmatrix}\mathrm{d}x\\\mathrm{d}y\\\mathrm{d}z\end{bmatrix}
\end{align}
$$
we simply compute the length
$$
\begin{align}
|\nabla g|
&=\Big|\begin{bmatrix}\sin(\theta)&r\cos(\theta)&0\end{bmatrix}\mathcal{J}^{-1}\Big|\\
&=\sqrt{1+\cos^2(\theta)\tan^2(\phi)}
\end{align}
$$

Computation of $\mathrm{d}\sigma$
On $\mathcal{S}$, $r=\frac{r_0}{\sin(\theta)}$, therefore,
$$
\mathcal{J}=\left[
\begin{array}{ccc}
 \cos (\theta ) \cos (\phi ) & -r_0 \cos (\phi ) & -r_0 \cot (\theta ) \sin
   (\phi ) \\
 \cos (\phi ) \sin (\theta ) & r_0 \cot (\theta ) \cos (\phi ) & -r_0 \sin
   (\phi ) \\
 \sin (\phi ) & 0 & r \cos (\phi )
\end{array}
\right]
$$
Therefore, the changes in position induced by a change of $\theta$ and $\phi$ is
$$
\begin{bmatrix}\mathrm{d}x\\\mathrm{d}y\\\mathrm{d}z\end{bmatrix}
=\mathcal{J}\begin{bmatrix}\mathrm{d}r\\\mathrm{d}\theta\\\mathrm{d}\phi\end{bmatrix}
=\mathcal{J}\begin{bmatrix}-\frac{r_0\cos(\theta)}{\sin^2(\theta)}&0\\1&0\\0&1\end{bmatrix}
\begin{bmatrix}\mathrm{d}\theta\\\mathrm{d}\phi\end{bmatrix}
$$
We simply compute the length of the cross product
$$
\left|\,\mathcal{J}\begin{bmatrix}-\frac{r_0\cos(\theta)}{\sin^2(\theta)}\\1\\0\end{bmatrix}
\times
\mathcal{J}\begin{bmatrix}0\\0\\1\end{bmatrix}\,\right|
=\frac{r_0^2}{\sin^3(\theta)}\sqrt{1-\sin^2(\theta)\sin^2(\phi)}
$$
