# Antiderivative of a piecewise function

ricardoapcruz shared this question 3 years ago

Geogebra doesn't compute the antiderivative for piecewise functions correctly. For different values of the integration constant, the graph of the antiderivative remains wrong yet, according to the 1st Fundamental Theorem of Calculus. The following file contains an example, where g(x) should be the antiderivative of f(x). The values of g(x) should be 0 for x<1 and the ramp should start at (1, 0) and end at (4, 6). Is it a GeoGebra bug?

P.S. The same problem occurs with GeoGebra Classic 5.0.527.0-d (27 February 2019).

Java: 1.8.0_161

OS: Windows 10 1

For your example, you can define

```F(x)=If(x < 1, 0, x < 4, 2x - 2, 6)
f(x)=F'(x)``` 1

So the command Integral(<function>) can give an answer that is not continuous for piecewise functions. Can Geogebra calculate an antiderivative by \$int_0^x f(x) dx\$, in some other way, with a variable bound of integration? 1

You can do it numerically: https://www.geogebra.org/m/nrxmfnmf 1

Thanks for the tip, your attention and your time. 