Integrating function with abs or max



[Ray Tice <trayracing at yahoo.com>, Mon, 22 Jan 2007 14:38:25 -0800 (PST)]:
> How do I reformulate functions that use abs or max so that maxima
> can integrate them?  For example, integrate(abs(x), x, -1, 1) won't
> evaluate, but both of these will:
>     integrate(abs(x), x, -1, 0)
>     integrate(abs(x), x,  0, 1)

I believe, the correct way to handle these kinds of things is to
replace abs(x) by something akin to (if x >= 0 then x else -x).
Someone has done some work on unevaluated conditionals that should
allow you to do this.

Alternatively, I have some code somewhere that should be able to
handle this, although the result might well be ugly, and I believe
that only linear protaseis are implemented; tell me if you want me to
dig it up wherever it sits on my hard drive.

Best regards,

Albert.