11
$\begingroup$

Bug introduced in 5.0 or earlier, persisting through 12.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]} *)
$\endgroup$
  • 1
    $\begingroup$ delta is only defined in terms of its integral, and this result will give the correct integral value. In what sense is it wrong? $\endgroup$ – george2079 Sep 25 '16 at 14:45
  • 2
    $\begingroup$ 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"). $\endgroup$ – Bob Hanlon Sep 25 '16 at 14:59
  • $\begingroup$ @george2079 I've added a minimal example to the question. $\endgroup$ – xzczd Sep 25 '16 at 15:05
  • $\begingroup$ It seems more generally that for a numeric function f, Simplify[f[x] DiracDelta[x]] yields f[0] DiracDelta[x]. $\endgroup$ – Michael E2 Sep 25 '16 at 15:33
  • $\begingroup$ @MichaelE2 Not necessarily. If you shift the expression, it doesn't work: Simplify[Abs[x-x1]DiracDelta[x-x1]]. This would also be a potential workaround for this Q: just shift everything: (x - x1) DiracDelta[x - x1] // Simplify is not zero. $\endgroup$ – Jens Sep 25 '16 at 15:37
9
$\begingroup$

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]}

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

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.