> I see that the Dirac delta function is documented, but I
> can't see how to use unit functions.
>
> Or maybe, is it possible to define a generic peicewise function ?
Maxima's handling of piecewise defined functions if not very complete.
It has some knowledge of abs and signum, and you can use those to define
other piecewise differentiable functions. For example:
gradef(signum(x),2*delta(x))$
Perhaps not strictly correct, but....
unitbox(x):= (signum(x)+1)*(signum(1-x)+1)/4$
unitbox(0)=unitbox(1)=1/2, though unitbox(x)=1 for 0<x<1.
diff(unitbox(x),x) =>
(1-SIGNUM(x-1))*DELTA(x)/2-DELTA(x-1)*(SIGNUM(x)+1)/2
which is correct, but not terribly useful I wouldn't think.
Maxima's handling of delta isn't very complete, either. As documented,
Delta is only used as output by the Laplace function. Maxima doesn't
even know that delta(x)=0 for x#0 or that
integrate(delta(x),x,minf,inf)=1.
-s