# Dirac Delta does not converge

I have trouble evaluating a simple integral in Mathematica. I have the code:

integrand = f[1/x] DiracDelta[-r0 + rm - rm x + rp x]
Assuming[{rp, rm, r0} \[Element] Reals && rp > 0 && rm > 0 && r0 > 0, Integrate[integrand, {x, -\[Infinity], \[Infinity]}]]
(*Integral of ... does not converge on ...*)


This surprised me, since using the usual dirac delta identity is $$\delta(g(x)) = \sum_i \frac{\delta(x-x_i)}{|g'(x_i)|} \ \ \ \ \text{where}\ x_i\ \text{are roots of}\ g$$ We can say $$\delta(-r0 + rm - rm \ x + rp \ x) = \frac{\delta(x- \frac{r0+rm}{rm-rp})}{|rp-rm|}$$ and inserting this into Mathematica I get the "correct" result:

integrand2 = DiracDelta[-((-r0 + rm)/(rm - rp)) + x]/Abs[-rm + rp] f[1/x]
Assuming[{rp, rm, r0} \[Element] Reals && rp > 0 && rm > 0 && r0 > 0, Integrate[integrand2, {x, -\[Infinity], \[Infinity]}]]
(*f[(-rm + rp)/(r0 - rm)]/Abs[rm - rp]*)


My question is why doesn't the first code integrate to the correct value?

• The support of DiracDelta[-r0 + rm - rm x + rp x] is x==(-r0 + rm)/(rm - rp). This does not make sense if rm==rp in both cases you considered. Sep 25, 2023 at 13:40
• rm = 1 + I; rp = 1; r0 = 1; integrand2 = DiracDelta[-((-r0 + rm)/(rm - rp)) + x]/Abs[-rm + rp] f[1/x]; Integrate[integrand2, {x, -\[Infinity], \[Infinity]}] results in f[1]. All this would be funny if it isn't so sad. Sep 25, 2023 at 14:28

Mathematica's DiracDelta shows problems with scaling property.

As a workaround try

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

Assuming[{rp, rm, r0} \[Element] Reals && rp > 0 && rm > 0 && r0 > 0 &&eps > 0,
Integrate[1 dirac [-r0 + rm - rm x + rp x], {x, -\[Infinity], \[Infinity]}]]
(*1/Abs[rm - rp]*)


which gives the correct scaling factor.

The integral you asked for follows to f[(rp-rm)/(rm-r0)]/Abs[rm - rp]

Hope it helps!

• The result of Assuming[{rp, rm, r0} \[Element] Reals && rp > 0 && rm > 0 && r0 > 0 && eps > 0, Integrate[ 1 dirac[-r0 + rm - rm x + rp x], {x, -\[Infinity], \[Infinity]}, GenerateConditions -> True]] is the same! We see the implementation of DiracDelta in Mathematica leaves much to be desired. Sep 25, 2023 at 13:56