Newbie - integrate piecewise function



Sometimes the problem IS trivial.
e.g.
change integral from a to c  to the sum of integrals
from a to b, and a to c  when the integrand is defined by
two different functions from a to b  and from a to c, and you
are given the value for b.

Just because trivial examples are trivial does not mean the
problem is easily solved.

What if you took the product of two piecewise defined functions
and then asked to integrate THAT?  Clearly any CAS that claims
to integrate piecewise functions would have to handle that too.
And one could decompose geometric regions bounded by arbitrary
functions, sometimes. It ceases to be trivial.

Here is a standard example where piecewise functions could
be a problem:  (abs(x)-x)*(abs(x)+x).  For real x this is always 0.
Another is atan(x)+atan(1/x),  which is a step function, but you
might not know it, especially if it is disguised.

Your question is entirely reasonable, in my opinion.
RJF

Nikos Apostolakis wrote:

>I am sure that my question will only serve to show my ignorance
>about computer algebra, but nevertheless here it goes
>
>On Fri, Oct 22, 2004 at 08:02:16AM -0700, Richard Fateman wrote:
>
>  
>
>>.... 
>>By contrast, what
>>integration means in Macsym/Maxima and other computer algebra
>>systems, is mostly what is done
>>by their integration programs, but the indefinite integration
>>procedures mostly aim at ANTIDIFFERENTIATION.  That is what
>>the Risch "algorithm" does.  This works on certain classes
>>of algebraic expressions. It does not work (except by making
>>special hacks) on arbitrary functions, including those that are
>>piecewise defined.  The builder of a CAS may add such hacks
>>on the grounds that "the custosmer is always right" and put
>>it in to the integration program. But don't expect it to work
>>on every input you can create.
>>
>>...
>>    
>>
>
>Why not? can't one define these "hacks" one level of abstraction
>up? I mean couldn't one extend these algorithms to work for the
>class of piecewise defined functions whose "pieces" are algebraic
>functions of that class (the class for which the Risch"algorithm" 
>works)?
>
>Hoping in your patience
>Nikos
>