Surface area of sphere using Dirac delta This question is related to this one.
Suppose I want to calculate the surface area $S(R)$ of a sphere of radius $R$. I can express $S(R)$ as
$$S(R)=\int_{\mathbb{R}^3} \delta (\| \vec x \|-R) \ d \vec x$$ 
I would then obtain
$$S(R) = 4 \pi \int_0^\infty \delta(r-R) r^2 dr = 4 \pi R^2$$
which is the correct result.
But it seems to me that I could equivalently express $S(R)$ as
$$S(R)=\int_{\mathbb{R}^3} \delta (\| \vec x \|^2-R^2) \ d \vec x$$ 
which gives
$$S(R) = 4 \pi \int_0^\infty \delta(r^2-R^2) r^2 dr $$
From the property of composition of the delta with a function,
$$\delta(r^2-R^2)=\frac{\delta(r-R)+\delta(r+R)}{2R}$$
but since $r \geq 0$ I only have to consider the positive root, so that
$$S(R) = 4 \pi  \int_0^\infty \frac{\delta(r-R)}{2R} r^2 dr = 2 \pi R$$
Why do I get two different results? Is something wrong with the second way of expressing $S(R)$?
 A: Your result is actually correct even if it may not seem intuitive at first glance. I had a very similar problem here: Compute area of a sphere through a Dirac delta
The key part is that:
$$\int_{R^n}{f(x)\delta(g(x))|\nabla g(x)|\,dx} = \int_{R^n}{f(x)\delta_S(x)\,dx} = \int_{S}{f(x)\,d\sigma(x)}$$
That means that your parametrisation function $g(x)$ is actually very important. If you want to get $4\pi\rho^2$ you will have to multiply your delta function with $|\nabla g(r)| = 2r$, $\delta_S(r) = 2r\delta(r^2-\rho^2)$. Then those would cancel out, and you will get:
$$\int_{0}^{2\pi}{\int_{0}^{\pi}{\int_{0}^{\infty}{\delta(r^2-\rho^2)2r^3\sin\theta\,dr}\,d\theta}\,d\phi} = \int_{0}^{2\pi}{\int_{0}^{\pi}{\frac{2\rho^3\sin\theta}{2\rho}\,d\theta}\,d\phi} = 4\pi\rho^2$$
The key thing to understand is that you cannot simply substitute if your delta is of the form $\delta(g(r))$ where $g(r)$ is not the identity plus/minus a shift.
Here's a nice and intuitive explanation of the problem: https://www.mathpages.com/home/kmath663/kmath663.htm
