Question: Simplifying expressions(symbolic integration)

Hi all,

I have the following functions.

restart:
with(IntegrationTools):
N:=4:

i:='i':
for i from 1 to N do
assume(x[i-1]::constant):
assume(x[i+1]::constant):
assume(x[i-1]::constant):
assume(h::constant):
 phi[i](t):=piecewise(t>=x[i-1] and x[i]>t, (t-x[i])/(h), x[i]
(x[i+1]-t)/(h), 0);
end do;
## my goal is solve the integrals involving phi[i]'s as integrand and x[i]'s as its limits.
## as a test case I tried to calculate Int( diff( phi[1], t)* diff( phi[1], t), t=x[0]..x[2]);
 
V:=Int(diff(phi[1](t), t)*diff(phi[1](t), t), t=x[0]..x[2]);
addionally assuming(x[0]<x[1] and x[1]<x[2]
 and x[2]<x[3]);
Parts(V, phi[1]);
 
## The output pretty much looks what we get by hand, but there are plently
 of Heaviside functions involve. 
By a simple look at the output those Heaviside functions have to
 disappear by using the order x[0]>x[1]>x[2].
But it isnt. 
Would any body please point out my mistake or give me some better idea?
 
Thanks!!!
 
 
Please Wait...