MATLAB: Am I unable to integrate the HEAVISIDE function symbolically in certain forms using the Symbolic Math Toolbox 3.1 (R14)

explicitheavisideintegralsymbolicSymbolic Math Toolbox

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)

Best Answer

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.