Why am I unable to integrate the HEAVISIDE function symbolically in certain forms using the Symbolic Math Toolbox 3.1 (R14)?

8 views (last 30 days)
The ability of the INT function to find an explicit solution sometimes depends on the order in which a multiplication is presented. I enter the following code:
clear all
syms t x
f = heaviside(x)*heaviside(t-x);
g= int(f,x,-Inf,Inf)
and receive the expected output:
g =
t-heaviside(-t)*t
However, when I enter the following code:
clear all
syms t x
f = heaviside(t-x)*heaviside(x);
g = int(f,x,-Inf,Inf)
I receive the following warning message:
Warning: Explicit integral could not be found.
In sym.int at 58
g = int(heaviside(t-x)*heaviside(x),x = -Inf .. Inf)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Oct 2013
This issue is a bug in the Maple kernel that Symbolic Math Toolbox 3.1 (R14) uses to perform symbolic integration. Maple does not recognize the second integrand expression as satisfying the formula it uses to calculate the first integral.
Adding a call to the SIMPLIFY function to the end of the code will return the correct result, as shown in the following example:
clear all
syms t x
f = heaviside(t-x)*heaviside(x);
g = int(f,x,-Inf,Inf)
h=simplify(g)
Note:
This solution is is applicable to releases of MATLAB before MATLAB 7.5 (R2007b). The computation engine used for the Symbolic Math Toolbox has since changed.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!