# Integral with DiracDelta gives incorrect answer

If I calculate

Integrate[DiracDelta[x - y] DiracDelta[x - z], {x, -∞, ∞},
GenerateConditions -> False]


I get this right answer, viz.

DiracDelta[-y + z]


But if I calculate a similar integral

Integrate[DiracDelta'[x - y] DiracDelta[x - z], {x, -∞, ∞},
GenerateConditions -> False]


I get the wrong answer 0 when in fact the right answer is

DiracDelta'[z-y]

• what is DiracDelta'[x - y] supposed to mean? Aug 21, 2023 at 6:24
• Derivative of the Dirac Delta. \int dx DiracDelta'[x-a] f[x] = -f'[a] if a is real is given correctly by Mathematica. Aug 21, 2023 at 6:57
• All the above integrals are an (unsuccessful) attempt to implement the $\delta$-distribution into Mathematica (see, for example, Encyclopedia of Mathematics (The Wiki article on this topic is permanently edited. The latest change is dated 7, August 2023, at 22:09 (UTC).)). Aug 21, 2023 at 7:34
• Why does Wolfram Inc retain concepts that give manifestly wrong answers? Aug 21, 2023 at 7:44
• The reason why Mathematica answers wrong questions is unclear. Products of distributions are undefined, in general. Either by conventional evaluation $$\int f(x) \delta (x-z) \delta '(x-y) \, dx=-\int \delta (x-y) (f(x) \delta (x-z))' \, dx=-\int f'(x) \delta (x-y) \delta (x-z) \, dx-\int f(x) \delta (x-y) \delta '(x-z) \, dx$$ or by Fourier transform $F(\delta delta') (k)= 1 \star k$$Aug 21, 2023 at 10:19 ## 2 Answers The reason why Mathematica answers wrong questions is unclear. Products of distributions are undefined, in general. Either by conventional evaluation $$\int f(x) \delta (x-z) \delta '(x-y) \, dx=-\int \delta (x-y) (f(x) \delta (x-z))' \, dx=-\int f'(x) \delta (x-y) \delta (x-z) \, dx-\int f(x) \delta (x-y) \delta '(x-z) \, dx$$ or by Fourier transform where products go to convolutions $$\mathit{F}(\delta * \delta') (k)= \int dk' 1(k') (k-k')$$ Perhaps its an too ambitious project, to exclude nonsensical input from the algorithm searching closed integral forms. • Product of distributions aren't undefined and lead sometimes to distributions. Aug 21, 2023 at 15:19 • If$y=z\$, then all the products under "the integrals" are undefined since the supports are identical. Aug 21, 2023 at 16:53

Mathematica DiracDelta especially DiracDelta' sometimes doesn't evaluate correctly.

Often it helps to define DiracDelta as a limit, here examplary

dirac = Function[x, Exp[-(x^2/(2 eps))]/Sqrt[2 Pi eps]]  (* eps->0   *)


Mathematica evaluates

int=Integrate[dirac'[x - y] dirac[x - z], {x, -\[Infinity], \[Infinity]},Assumptions -> eps > 0 ]
(*(E^(-((y - z)^2/(4 eps))) (y - z))/(4 eps^(3/2) Sqrt[\[Pi]])*)


Result is identical to dirac[(y-z)/Sqrt[2]] (y-z)/eps and "diverges" for eps->0

But result is a distribution too, because int==-1/2 dirac'[(y - z)/Sqrt[2]]=!=dirac'[z-y] and "confirms" expectation of QP !

Hope it helps!

• How about Limit[(E^(-((y - z)^2/(4 eps))) (y - z))/(4 eps^(3/2) Sqrt[\[Pi]]), eps -> 0, Direction -> "FromAbove", Assumptions -> {y, z} \[Element] Reals] which results in 0? Aug 21, 2023 at 14:28
• @user64494 Similar Limit[DiracDelta[x], x -> 0] gives 0 too, but doesn't disprove distribution theory! Aug 21, 2023 at 15:40
• This is not similar, that's another story. Aug 21, 2023 at 16:50
• It's the same story, both expressions are distributions! Aug 21, 2023 at 17:13