Why is
Integrate[ HeavisideTheta[1 - x^2] DiracDelta[1 - x^2] , {x, 0, 1} ]
(*0*)
It should be HeavisideTheta[0]
?
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.
Integrate[HeavisideTheta[1 - x^2] DiracDelta[1 - x^2], {x, 0, 1 + $MachineEpsilon}] (*0*)
$\endgroup$
Commented
Jun 3 at 7:43
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]
Integrate[HeavisideTheta[a - x^2] DiracDelta[1 - x^2], {x, 0, 1}]
to see if you agree with it, then take the limita->1
in the two directions. $\endgroup$