:

## Discontinuous antiderivatives

Maple
Maple, Mathematica, and many other CAS define indefinite integral up to piecewise constants. That means, in particular, that the integral of a continuous function can be discontinuous. In many cases that can be easily fixed, such as for integrals involving floor(x) and frac(x). However, it has not been done neither in Maple nor in Mathematica. Here is another example, suggested by David W. Cantrell
```int(1/(2+cos(x)),x);

2/3*3^(1/2)*arctan(1/3*tan(1/2*x)*3^(1/2))```

Mathematica gives the same answer. This answer can be used for evaluating of definite integrals only on intervals without discontinuities, in all other cases it is useless, because the main application of indefinite integration is in finding definite integrals through the Fundamental Theorem of Calculus. If indefinite integral is discontinuous, that can not be done. David W. Cantrell suggested another form of the indefinite integral in this example (given by Derive), continuous

```(x - 2*arctan(sin(x)/(2 + sqrt(3) + cos(x))))/sqrt(3); ```
It is much nicer and can be used for evaluating of definite integrals. In some examples obtaining a continuous indefinite integral is not that easy. Here is an example suggested by Robert Israel,
```int(abs(exp(x)+cos(x)),x); ```
Nice looking answer but practically useless, because of discontinuities,
```int(abs(exp(x)+cos(x)),x=-2..0); ```
Again, 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))-
```plot(f,-20..2); ``` 