I thought I had found a bug in Mathematica and reported it already in version 9, since it wasn't fixed in version 10 or 11 I reported it two more times but I never get any reply whatsoever so I'm thinking perhaps it is not a bug and I have just misunderstood the way Mathematica is supposed to work.

I do not expect these last two integrals to give 0 but they do. Should they not return 1? The first two integrals return what I expect them to and are just provided for comparison.

Integrate[DiracDelta[Cos[θ]] θ, {θ, 0, π}]
Integrate[DiracDelta[Cos[θ]] Exp[θ], {θ, 0, π}]
Integrate[DiracDelta[Cos[θ]] Sin[θ], {θ, 0, π}]
Integrate[DiracDelta[Cos[θ]] UnitStep[θ], {θ, 0, π}]
share|improve this question
1  
Please do not use Bugs tag for initial posts, it is intended to be used after confirmation by participants. – ciao 8 hours ago
    
Fort the last example, Integrate[ DiracDelta[Cos[\[Theta]]] UnitStep[\[Theta]] // Simplify[#, 0 <= \[Theta] <= \[Pi]] &, {\[Theta], 0, \[Pi]}] evaluates to 1 – Bob Hanlon 7 hours ago
2  
For distributions, it is better to use HeavisideTheta instead of UnitStep, since HeavisideTheta is a generalized function (distribution) and UnitStep is not. Integrate[DiracDelta[Cos[t]] HeavisideTheta[t], {t, 0, Pi}] does return 1. This is covered in the documentation in the tutorial on GeneralizedFunctions. – Carl Woll 7 hours ago

I'd consider it a bug.

Reason: I would consider following identity: $$\delta(f(x))=\sum_i\frac{\delta(x-x_i)}{|f'(x_i)|}$$

Where $\forall x_i : f(x_i)=0$

This leads us to: $$\delta(\cos x)=\frac{\delta(x-\pi/2)}{|-\sin(\pi/2)|}=\delta(x-\pi/2)$$

So we conclude: $$\int_0^\pi\text{d}x\;\delta(x-\pi/2)\cdot\sin x=\sin(\pi/2)=1$$ The same for UnitStep. And Mathematica realizes this:

Integrate[DiracDelta[x - Pi/2]*Sin[x], {x, 0, Pi}]
Integrate[DiracDelta[x - Pi/2]*UnitStep[x], {x, 0, Pi}]

1

1

With FullSimplify before:

FullSimplify[DiracDelta[x - Pi/2]*Sin[x], 0 < x < Pi]
FullSimplify[DiracDelta[x - Pi/2]*UnitStep[x], 0 < x < Pi]

2 DiracDelta[[Pi] - 2 x]

2 DiracDelta[[Pi] - 2 x]

Which evaluates in Integrate to:

Integrate[2 DiracDelta[\[Pi] - 2 x], {x, 0, Pi}]

1

So, my vote is on bug.

share|improve this answer

I also vote for a bug. The easiest way to see it is using an undefined function,

Integrate[DiracDelta[Cos[x]] f[x], {x, 0, Pi}]

which gives f[Pi/2]. So for an undefined function it gives the right answer but for f=Sin it does not give Sin[Pi/2]. Hence a Bug.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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