x DiracDelta[x] simplifies to 0, desired or a bug?

Bug introduced in 5.0 or earlier, persisting through 13.0.

I encountered this when trying to answer this question:

x DiracDelta[x] // Simplify
(* 0 *)


Is this a bug or desired? If it's desired, what's the meaning of it? Well, this behavior indeed causes trouble in certain cases, here is a minimal example:

test = ( I + ζ DiracDelta[ζ])/  ζ;
InverseFourierTransform[#@test, ζ, z] & /@ {Identity, Simplify}
(* {(1 + π Sign[z])/Sqrt[2 π], Sqrt[π/2] Sign[z]} *)

• delta is only defined in terms of its integral, and this result will give the correct integral value. In what sense is it wrong? Sep 25, 2016 at 14:45
• From the documentation: "DiracDelta[x] returns 0 for all real numeric x other than 0." Since x DiracDelta[x] is zero at x = 0 then x DiracDelta[x] is zero for all real x. DiracDelta is a generalized function and is only fully defined in the context of an integral ("DiracDelta can be used in integrals, integral transforms, and differential equations"). Sep 25, 2016 at 14:59
• @george2079 I've added a minimal example to the question. Sep 25, 2016 at 15:05
• It seems more generally that for a numeric function f, Simplify[f[x] DiracDelta[x]] yields f[0] DiracDelta[x]. Sep 25, 2016 at 15:33
• For what it's worth, I don't see a bug in all this. The example is playing with a hidden zero. If it gets exposed at an inopportune time, e.g. before a division can occur that removes the zero, that's unfortunate but not necessarily a bug. Arguably Simplify should not mess with distributions because they do not follow the same rules as analytic functions. But that would bring on problems of its own I suspect. Jul 18, 2018 at 13:06

The first line in your question is simplified correctly, but the added example shows that the simplification of the second line is in fact wrong because the denominator is ignored for too long.

To work around this, you could shift the variable like this:

test=(I+(ζ-ζ1) DiracDelta[ζ-ζ1])/(ζ-ζ1);
InverseFourierTransform[#@test,ζ,z]&/@{Identity,Simplify}


Then the results agree:

SameQ@@%


True

Therefore, to get the desired result, I tried this:

test = (I + (ζ - ζ1) DiracDelta[ζ - ζ1])/(ζ - ζ1);
(InverseFourierTransform[#@test, ζ, z] & /@ {Identity, Simplify}) /. ζ1 -> 0


{Sqrt[2 Pi] DiracDelta[0] DiracDelta[z] + Sqrt[Pi/2] Sign[z], Sqrt[2 Pi] DiracDelta[0] DiracDelta[z] + Sqrt[Pi/2] Sign[z]}

However, this doesn't quite work because there is a delta function of 0.

The best I could do with this shift trick is to prevent the simplification like this:

test = (I + ζ DiracDelta[ζ])/ζ;
InverseFourierTransform[#[test /. ζ -> (ζ - ζ1)] /. ζ1 -> 0,
ζ, z] & /@ {Identity, Simplify}


{(1 + Pi Sign[z])/Sqrt[2 Pi], (1 + Pi Sign[z])/Sqrt[2 Pi]}

• In v9 your first approach already works: Mathematica graphics :D Sep 26, 2016 at 3:08
• And things seem to be even worse in v11: i.stack.imgur.com/EAhvT.png Sep 26, 2016 at 3:43
• My results are for version 11 on OS X. Good to know that it can always get worse...
– Jens
Sep 26, 2016 at 5:03