Another: dirac_delta integration: possible bug?
I think there is another problem with the integration of the dirac_delta in Sage:
(previous problem is discussed in the thread Integration of dirac_delta)
Here is the problem:
var('a',"real")
f=integral(dirac_delta(a*x),x,-oo,oo);show(f)
returns 1
where it should return 1/|a|
and
var('a',"real")
f=integral(dirac_delta(x^2-a^2),x,-oo,oo);show(f)
returns 1/|a|
, where it should be 1/(2|a|)
I agree with the
1/|a|
in the second case, both roots contribute for1/|2a|
. Also you may have noticed that the answer I gave you in your other post produces the right answer in the first case, but 0 in the second one. That's becausea<+oo
is alwaysFalse
. For it to work you have to put assumptions ona
, and also not use infinity as a bound.I looked at the code and tried to fix it to accomodate this problem but I wasn't very successful (though I learned a lot!) I tried the following with your version, but I am getting
0
.am I using it wrong? (especially the assumptions?)
For me it works with
x^2-a^2
instead ofx^2-a
. If you don't take the square, you need to assumea>0
, otherwise there is no real root, the the answer is zero.