1
$\begingroup$

Why is

Integrate[ HeavisideTheta[1 - x^2] DiracDelta[1 - x^2] , {x, 0, 1} ]
(*0*)

It should be HeavisideTheta[0]?

$\endgroup$
1
  • 1
    $\begingroup$ Try Integrate[HeavisideTheta[a - x^2] DiracDelta[1 - x^2], {x, 0, 1}] to see if you agree with it, then take the limit a->1 in the two directions. $\endgroup$ Commented Aug 20, 2013 at 11:55

2 Answers 2

5
$\begingroup$

I think what you want is

Integrate[HeavisideTheta[1 - x^2] DiracDelta[1 - x^2], {x, 0, 1 + $MachineEpsilon}]

This gives

HeavisideTheta[0]/2

The $MachineEpsilon (or any number > 0) is necessary because you need to integrate across the singularity of the Dirac Delta (i.e. - in a range including at least a little bit above and below it) to capture its behavior as a distribution.

The factor of 1/2 is due to a delta function having a nontrivial differentiable function (like your 1-x^2) as its argument. Wikipedia and other sources have more complete explanations.

$\endgroup$
1
  • $\begingroup$ In v14, Integrate[HeavisideTheta[1 - x^2] DiracDelta[1 - x^2], {x, 0, 1 + $MachineEpsilon}] (*0*) $\endgroup$
    – lotus2019
    Commented Jun 3 at 7:43
2
$\begingroup$

I do not think the question is asking for workarounds, is it? it is asking why is the answer given is not HeavisideTheta[0]

Since I have to make this as an answer, ok, then my answer is this: It should have, and this is a bug.

from http://mathworld.wolfram.com/DeltaFunction.html

$$ \int_{-\infty}^{\infty}f\left( t\right) \delta\left( t-a\right) dt=f\left( a\right) $$

So when $\delta(t-a)$ is under the integral it acts to pull out the value of the function at the point where $t=a$, i.e. where $\delta(0)$

In the example given $\int_{0}^{1}\theta\left( 1-x^{2}\right) \delta\left( 1-x^{2}\right) dx$, when $x=1$ then $\delta\left( 0\right) $, hence the result should be $\theta\left(1-1^{2}\right) =\theta\left( 0\right) $.

But $\theta\left( x\right) $ is not defined at $x=0$

http://reference.wolfram.com/mathematica/ref/HeavisideTheta.html

hence Mathematica should have returned HeavisideTheta[0]

Mathematica graphics

$\endgroup$
2
  • 1
    $\begingroup$ That's not correct. The site you linked to correctly states that a delta function is a linear functional: you feed it a function, and it acts on that function in the way you described in your first equation. You are not guaranteed to be able to use it you don't integrate over the whole real line. Normally, this isn't an issue because a delta function is zero everywhere except for where its argument is also zero. However, you must integrate over a neighborhood containing that point (i.e. not one of the boundary points). $\endgroup$
    – Jaffe42
    Commented Aug 29, 2013 at 3:43
  • $\begingroup$ Additionally, the factor of 1/2 is correct. While it's true that Mathematica doesn't evaluate the Heaviside, you have to use the rule \delta[g(x)] = \sum _i \frac{\delta[(x-x_i)]}{|g'(x_i)}. $\endgroup$
    – Jaffe42
    Commented Aug 29, 2013 at 3:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.