# DiracDelta convergence in 3D - Cartesian vs. spherical coordinates

Integrating DiracDelta in 3D in Cartesian coordinates works just fine i.e. gives vecf[{x, y, z}]

vecr = {x, y, z};
vecrp = {xp, yp, zp};

Assuming[(vecr | vecrp | vecf[_]) ∈ Vectors[3, Reals],
Simplify[Integrate[DiracDelta[-xp + x] DiracDelta[-yp + y] DiracDelta[-zp +
z]*vecf[vecrp], {xp, -Infinity, Infinity}, {yp, -Infinity, Infinity}, {zp, -
Infinity, Infinity}]]]


However, the same integral in Spherical coordinates does not converge

 x = r*Sqrt[1 - μ^2]*Cos[ϕ];
y = r*Sqrt[1 - μ^2]*Sin[ϕ];
z = r*μ;

xp = rp*Sqrt[1 - μp^2]*Cos[ϕp];
yp = rp*Sqrt[1 - μp^2]*Sin[ϕp];
zp = rp*μp;

J = rp^2*Sqrt[1 - μp^2]
Assuming[(vecr | vecrp | vecf[_]) ∈ Vectors[3, Reals],
Simplify[Integrate[DiracDelta[-xp + x] DiracDelta[-yp + y] DiracDelta[-zp +
z]*vecf[vecrp]*J, {rp, 0, Infinity}, {μp, -1, 1}, {ϕp, 0,
2*Pi}]]]


I have also tried using Cos[θ] instead of μ.

• Could you be more precise? Sep 26, 2018 at 9:15
• But it is defined in the context of Dirac Deltra distribution, at the physicist level of rigor at least. Take a look at the attached document or any textbook on mathematical methods in physics e.g. Riley, Hobson, Bence, 13.1.3. Anyhow, Mathematica does NOT have problem with this product in Cartesian coordinates or in suitably prepared form in Spherical coordinates and my question is how to make automatic transition from first one to the second one. Sep 26, 2018 at 15:56
• @user64494 Multiplying the distributions DiracDelta[-xp + x] DiracDelta[-yp + y] DiracDelta[-zp + z] makes sense indeed for the integration variables are with respect to different coordinate directions. The resulting distribution is $\delta_{x_p,y_p,z_p}$ in $\mathbb{R}^3$. One cannot define a product of distributions in general but for two given ones, one can try to decide wether that is possible or not. There is actually a whole theory about that (e.g. see works by Hörmander). I would appreciate if you would hold back yourself a bit in the future and to try to be a bit more polite. Sep 26, 2018 at 19:28
• @user64494 And Integrate[DiracDelta[x],{x,-Infinity,Infinity}] is Mathematica's (and not only Mathematica's) way to write the pairing $\langle \delta_0, 1\rangle$. Sep 26, 2018 at 19:32
• @user64494 This "somebody" must have moderator priviledges. If I were you, I would start now to be a bit more careful. For the references: See here and here. Again, in particular the works by Hörmander are relevant. Sep 26, 2018 at 19:43

More an extended comment than an answer.

Hmm. What I can tell is that you do not apply the transformation formula correctly. The Jacobi determinant should look like this:

Jac = D[{xp, yp, zp}, {{rp, μp, ϕp}, 1}];
J = Simplify[Abs[Det[Jac]], {-1 < μp < 1, rp > 0}];


rp^2

But that doesn't cause the problem. Apparently, Mathematica cannot handle DiracDeltas with complicated arguments correctly. I agree with user64494 in that respect, that Mathematica does not treat distributions correctly in all cases. Admittedly, it is not that easy to teach Mathematica that

rp^2 DiracDelta[r μ - rp μp, r Sqrt[1 - μ^2] Cos[ϕ] - rp Sqrt[1 - μp^2] Cos[ϕp], r Sqrt[1 - μ^2] Sin[ϕ] - rp Sqrt[1 - μp^2] Sin[ϕp]]

can be simplied to

DiracDelta[r - rp , μ - μp, ϕ - ϕp]

You might be better off by realizing that "integrating" against

DiracDelta[-xp + x] DiracDelta[-yp + y] DiracDelta[-zp + z] (or, equivalently, against DiracDelta[x - xp , y - yp, z - zp]) means actually a point evaluation. In mathematical terms:

$$\int_{\mathbb{R}^n} \delta_{x_0} \, \varphi \, \mathrm{d} x := \langle \delta_{x_0}, \varphi \rangle := \varphi(x_0) \quad \text{for \varphi \in C^0_{\mathrm{cpt}}(\mathbb{R}^n).}$$

The integral sign is used only because one can obtain the action of $$\delta_{x_0}$$ on as limit of suitable sequences of so-called mollifiers (in the topology of weak-*-convergence).

This stays a point evaluation under pullback along coordinate transformations. In mathematical terms: If $$\varPhi$$ is a diffeomorphism then

$$\varPhi^* \delta_{x_0} = \delta_{\varPhi^{-1}(x_0)}.$$

Things get more involved if the transformation $$\varPhi$$ is not a diffeomorphism. This may also be a reason why a correct Mathematica implementation is so hard to obtain.

But maybe other users know of a suitable workaround...?

• I'd like to repeat that the integral under consideration has no sense in traditional math (See the comments to the question for more details. ). Sep 27, 2018 at 9:13