From: "David W. Cantrell" <DWCantrell@sigmaxi.net>
OTOH there are continuous functions for which useful antiderivatives can be given "up to piecewise constants" but for which continuous antiderivatives cannot be given in closed form in terms of familiar functions. Here's an example due to Robert Israel: Consider the continuous function |exp(x) + cos(x)|. An antiderivative as given by Derive is
sgn(exp(x) + cos(x))*(exp(x) + sin(x))
which has discontinuities at the zeros of exp(x) + cos(x). Now, if only we could express those zeros in closed form... but we can't. I think that it is better for a CAS to give an answer such as Derive's than to just return the indefinite integral unevaluated.
Certainly, it is better to have some answer than no answer. Still, even in this example the answer with a continuous antiderivative can be given. Something like signum(exp(x)+cos(x))*(exp(x)+sin(x)) - 2*sum(abs(exp(k)+sin(k)),k=RootOf(exp(_Z)+cos(_Z),_Z,x..0)); That doesn't work in Maple though. However, the following works (at least for x not too far from 0), f:=x->signum(exp(x)+cos(x))*(exp(x)+sin(x))- 2*piecewise(x<0,add(abs(exp(k)+sin(k)), k=map2(fsolve,t->exp(t)+cos(t), fdiscont(signum(exp(_Z)+cos(_Z)),_Z=x..0)))); It can be plotted, plot(f,-20..2); Alec