# Integration of DiracDelta

I just came across the following curiosity and I'm not sure whether it's a bug or just me missing something. Here's a minimal example: I defined the following "function"

 In[1]:= S[x_, y_, z_] := DiracDelta[x^2 + y^2 + z^2 - 1]; 

which is supposed to parametrize the surface of a unit sphere. However, when I integrate over the entire space (x,y,z $\in$ [-2,2] should do) I get $2\pi$ as a result

 In[2]:= Integrate[S[x, y, z], {x, -2, 2}, {y, -2, 2}, {z, -2, 2}]

 

Out[2]:= 2 Pi 

Shouldn't this be rather 4$\pi$?

-

$$\int_{-2}^2 \delta(x^2+y^2+z^2-1)~ dx dy dz = \int_0^\infty dr \int_0^\pi d\theta \int_0^{2\pi}d\phi ~r^2\sin\theta~ \delta(r^2-1)$$ $$= \frac{1}{2}\int_0^\infty d(r^2) \int_0^\pi d\theta \int_0^{2\pi}d\phi ~r\sin\theta~ \delta(r^2-1) = \frac{1}{2}\int_0^\pi d\theta \int_0^{2\pi}d\phi ~ \sin\theta= 2\pi$$
I think it would be nice to replace the integration region in the first integral by R^3 though. –  sebhofer Feb 6 at 9:25