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$?


I think Mathematica is correct here:

$$\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$$

  • $\begingroup$ Hmpf... you beat me to it ;) +1 $\endgroup$ – sebhofer Feb 6 '14 at 9:23
  • $\begingroup$ I think it would be nice to replace the integration region in the first integral by R^3 though. $\endgroup$ – sebhofer Feb 6 '14 at 9:25
  • $\begingroup$ Damn, you are absolutely right! In order to get 4*Pi I would have to replace the argument of the delta"function" by (Sqrt[x^2+y^2+z^2]-1). Cheers! $\endgroup$ – André Feb 6 '14 at 9:39
  • $\begingroup$ Unexpected but true. Here's a Generalisation: In[175]:= Integrate[ DiracDelta[(x^2 + y^2 + z^2)^a - 1], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}, {z, -Infinity, Infinity}] Out[175]= (2*Pi)/Abs[a] $\endgroup$ – Dr. Wolfgang Hintze Aug 17 '14 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.