[24] in mathematical software users group

home help back first fref pref prev next nref lref last post

RE: A formalism for discontinuities of fucntions ?

daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Fri Mar 27 10:28:22 1992

To: msug@Athena.MIT.EDU
Date: Fri, 27 Mar 92 10:27:35 EST
From: Reid M. Pinchback <reidmp@Athena.MIT.EDU>


>Please tell me the result for the following integration by Maple and Mma:
>
>inte(abs(x^3), x from -2 to 2)
>
>inte(sgn(x)*x^3, x from -2 to 2)

I don't have Mma handy on this machine, but I'll tell you the results
for Maple.

I guess that your "sgn" function extracts the sign of a number.
To the best of my knowledge, there is no *exact* equivalent of this in
Maple unless you "make it yourself".  There is a "sign" function, but
what it does is extract the sign of the leading coefficient of an
expression, so "sign(x)" is always 1, since the leading coefficient (1)
of the polynomial is non-negative.

Maple can numerically integrate the "abs(x^3)" case (with a result of 4),
but it cannot symbolically integrate it.  This is because there isn't a
*single* Maple mathematical function or expression that can be used to
express a closed-form solution.  What is needed is to split the integral
into 2 at the point x=0, and symbolically integrate the left and right halves.

You don't run into this problem when you try to integrate expressions like
abs(x^n) where n is "even" for the obvious reasons, ie: abs(x^(2*k)) = x^(2*k).
For non-even exponents, Maple doesn't really examine the limits of integration
until it first generates the symbolic solution.

Actually, to be accurate, I think the process that Maple goes through for
symbolic integration is a mathematically strict one:

 1. Test whether the function is continuous or not over the interval defined
    by the limits of integration.

 2. If continuous, it then generates the general symbolic solution.

 3. It then substitutes the endpoints into the general solution to
    evaluate the integral.

Now, if a function is found continuous in step 2, Maple will look for a
***general*** closed-form solution, without consideration of the limits
of integration.  This is probably why Maple couldn't evaluate abs(x^3),
since it knows of no such ***general*** solution.  (1/4)sgn(x)x^4 would
probably count as such a solution, if Maple knew about the sgn function,
but alas it does not.

If a function is *not* found to be continuous, then I think Maple chooses the
mathematically conservative approach and doesn't perform the integration.
This would be because a discontinuity is often the result of a limit
not existing near some point, and so the "proper" thing to do mathematically
is to go back to first principles and express the integral as a limit and
try and find the limit.  In calculus courses we sometimes get into the bad
habit of abusing notation and saying something like "int(1/x,x=1..infinity)"
when we should be saying "limit as c -> infinity of int(1/x,x=1..c)".
When a function contains a discontinuity, then sometimes this latter
expression suggests to us how we need to go about finding the integral
(if it exists).

-----------
Reid M. Pinchback
Faculty Liaison
Academic Computing Services, MIT

home help back first fref pref prev next nref lref last post