# Inconsistent Integration involving DiracDelta at boundaries

I'm working on integrals involving DiracDelta functions at the boundary of the integrals. I'm confused by the output Mathematica v10.1.0 gives me in this case:

f[x_] := DiracDelta[x] + Exp[-x];

Integrate[f[x], {x, 0, ∞}]
(* 2 - HeavisideTheta[0] *)

Limit[Integrate[f[x], {x, 0, b}], b -> ∞]
(* 2 *)

Limit[Integrate[f[x], {x, a, ∞}], a -> 0]
(* 1 *)


I understand the first case, where it basically allows me to pick my favorite definition and choose whether I want to include the DiracDelta in the integration. However, in the second line (where I evaluate a limit involving the other boundary) Mathematica seems to be sure that the boundary has to be included. Lastly, when I let the left integration boundary go to zero Mathematica correctly concludes that the DiracDelta should not be included, which is of course only correct if we approach a=0 from above, but this is consistent with the documentation of Limit.

My question is why Mathematica gives different results for the first two examples and how I can ensure that the DiracDelta is always included at the boundary.

I can't speak for what's happening with your second example, but to answer your second question, you can ensure DiracDelta is included by integrating over a larger interval then taking a limit.

Limit[Integrate[f[x], {x, -ε, ∞}, Assumptions -> 0 < ε < 1/10^10], ε -> 0]

2


I can break the calculations down, but I cannot really explain the first one.

This seems wrong:

Integrate[DiracDelta[x] + Exp[-x], {x, 0, b}]
(*  ConditionalExpression[-Cosh[b] + 2 HeavisideTheta[b] + Sinh[b], b ∈ Reals]  *)


Its limit is 2. The ConditionalExpression suggests that Integrate is using assumptions to make choices. Let's help it out below.

This seems right, and equivalent to the first result, 2 - HeavisideTheta[0], if Heaviside[0] is equal to 1/2, which it sometimes is:

Integrate[DiracDelta[x], {x, 0, b}, Assumptions -> b > 0]
(*  1 - E^-b + HeavisideTheta[0]  *)


Its limit as b -> Infinity is 1 + HeavisideTheta[0].

This seems right, too:

Limit[Integrate[DiracDelta[x] + Exp[-x], {x, a, ∞}], a -> 0, Direction -> 1]
(*  2  *)


Since for all a (a < 0), the integral of the DiracDelta part is 1, we do not get the HeavisideTheta in the answer.

• (at) Michael E2: (at least) in Version 8 things are even stranger: In[168]:= Integrate[DiracDelta[x] + Exp[-x], {x, 0, b}, Assumptions -> b > 0] Out[168]= 1 - E^-b + HeavisideTheta[0] (in agreement with your result) but now: In[169]:= Limit[%, b -> [Infinity]] Out[169]= 2, miraculously HeavisideTheta[0] has been replaced by the vaule 1. – Dr. Wolfgang Hintze May 13 '15 at 23:47