ans =
Does Symbolic int() Always Return Justifiable Results When the Integrand Includes a kroneckerDelta?
Show older comments
Integrating the kroneckerDelta sounds a bit weird, but it it it's allowe it should be consistent.
Define the Kronecker Delta and some test functions
syms x w real
K = kroneckerDelta(x);
y = [1;cos(x);exp(-x);exp(-1j*w*x)];
All of the test functions are equal to one at the origin, so I would expec that multiplying them by K(x) would return K(x).
Checking
isAlways(K.*y == K)
Why is the second entry not provable? Especially because
simplify(K.*y)
I would expect that all integrals of K*y(i) would either be zero or unevaluated. The first three do return zero, but the last one is unevaluated. What is unique about the last case?
int(K.*y,x,-10,10)
The anti-derivative yields a result in all four cases, though I don't understand what an anti-derivative of the Kronecker Delta would be. I'm very surprised that all of these were not returned as unevaluated. But, given that they are evaluated, and in light of the isAlways result above, why are the third and fourth entries different from the first and from each other?
A = int(K.*y,x)
3 Comments
David Goodmanson
on 8 Apr 2025
Edited: David Goodmanson
on 8 Apr 2025
Hi Paul,
Syms certainly has problems and is coming out with some bad results here. Trying to make sense of syms can be like trying to read tea leaves. But just on the math aspect, the antiderivative or integral, whichever you want to call it, of a delta function is simply the heaviside function, isn't it? That way, with a<b
Int{a,b} f(x)*delta(x) dx = f(0) a<0<b
= 0 0<a<b or a<b<0
= f(0)/2 a=0 or b=0 % most consistent way to treat this case
David Goodmanson
on 8 Apr 2025
Edited: David Goodmanson
on 8 Apr 2025
Hi Paul,
I should have noticed the the kronecker part, since I've used it enough in the past. Interesting that the function works for noninteger input. Might be better if it didn't.
Answers (0)
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

