This question already has an answer here:

Consider the floor function:

$$f(x) = \lfloor x \rfloor$$

The indefinite integral of f is:

$$\int_0^x f(x) dx = x\lfloor x \rfloor - \frac {\lfloor x \rfloor^2 + \lfloor x \rfloor} 2$$

This should be an antiderivative of floor, right?

Nope! If you take the derivative of the integral you find that sharp corners cause the derivative to not exist.

So then this would mean that the integral of floor is not an antiderivative right?

Therefore, I have found a case where the antiderivative does not equal the indefinite integral.

In that case I must be flawed as that violates the first fundamental theorem of calculus.

Where is the mistake in my logic and why does it appear to disprove the first fundamental theorem's relationship between integral and derivative?

This isn't part of the above question per se, but I noticed interesting enough, that the derivative of the integral above is:

$$\lfloor x \rfloor \frac {x - \lfloor x \rfloor}{x - \lfloor x \rfloor}$$

I wonder what sort of properties would be altered within integration/differentiation if one were to IDK... redefine the derivative by canceling the terms in that fraction? Or for that matter, canceling all fractions of that nature?


marked as duplicate by The Great Duck, Community Jan 16 '17 at 19:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ you should consider instead $\int_0^x sign(x) dx = |x|$ and the fundamental theorem of calculus is that $|x|$ is weak differentiable with $(|x|)' = sign(x)$ almost everywhere $\endgroup$ – reuns Jun 17 '16 at 21:37
  • 1
    $\begingroup$ @user1952009 why should I change the function? That's illogical. I noticed the property when taking the integral of floor. How is it logical to change the function arbitrarily? $\endgroup$ – The Great Duck Jun 17 '16 at 23:54
  • 1
    $\begingroup$ $sign(x)$ is the simplest example for understanding what is happening, exactly in the same way as for $\lfloor x \rfloor = \sum_k \frac{(1+sign(x-k))}{2}$ $\endgroup$ – reuns Jun 18 '16 at 0:09
  • 4
    $\begingroup$ ok then when people are trying to help you, they are completely ridiculous... sure ! so I'm telling you your example is a complicated version of $(|x|)' = sign(x), x\ne 0$, and that at $x=0$ there is no problem, only a discontinuity of the derivative $\endgroup$ – reuns Jun 18 '16 at 1:37
  • 3
    $\begingroup$ I didn't mean to edit your question, but edit what you wrote on your paper, yes, because your function hides the phenomena which is that everything happens as for $(|x|)'$ $\endgroup$ – reuns Jun 18 '16 at 3:37

The fundamental theorem of calculus has a crucial hypothesis: $$F(x)=\int_{a}^x f(t)dt\Rightarrow F'(a)=f(a) $$

Whenever and wherever $f$ is continuous, here we are assuming $f$ is continuous at the point $a$. The floor function is very much not continuous. When you see theorems, it is very important that you check what the hypotheses are.

  • 1
    $\begingroup$ Oh. Oops. I had a feeling I shouldve gone and looked in that section before posting this. XD I'll accept this in a little while (unless something amazing appears but thats unlikely). $\endgroup$ – The Great Duck Jun 16 '16 at 22:17
  • 22
    $\begingroup$ @EthanHunt This site has really improved my typing. $\endgroup$ – qbert Jun 16 '16 at 22:17
  • $\begingroup$ @qbert mine was already pretty good before coming here. But yeah, this site can do that to ya. $\endgroup$ – The Great Duck Jun 16 '16 at 23:00
  • 2
    $\begingroup$ Dude, this is an oversight that bites tons of people. I voted the question and answer up accordingly. $\endgroup$ – The Nate Jun 17 '16 at 6:53
  • 1
    $\begingroup$ @The Nate I can imagine. I just find it ironic how I had this strange urge to reread the fundamental theorem. I was thinking that the order of differentiating and integrating made a difference... I just find it funny, that's all. I would've caught my error. Oh well, now it is here for people to see! :) $\endgroup$ – The Great Duck Jun 17 '16 at 20:43

The first fundamental theorem of calculus is stated as follows:

For any continuous function $f:[a,b]\rightarrow \mathbb R$ the function $F(x)=\int_{a}^x f(x)\,dx$ has $F'(x)=f(x)$ for all $x\in (a,b)$.

Notice that $f(x)=\lfloor x\rfloor$ is not continuous at the integers, thus this theorem says nothing about that. Note that the derivatives do agree at points where $f(x)$ is continuous.

An interesting thing to note is that there is another version of the first fundamental theorem of calculus called the Lebesgue differentiation theorem which loosens the restriction on $f$, but only says that $F'(x)=f(x)$ almost everywhere. It relies on measure theory to state, so I won't reproduce it here, but it's worth noting that one has a trade-off between conditions on $f$ and results for $F$.


Therefore, I have found a case where the antiderivative does not equal the indefinite integral.

That statement is actually not quite right. What you have in fact found is a case where the indefinite integral can not be used to obtain the original function through differentiation. But you can't say anything about an antiderivative that does not equal something else, because it doesn't exist.

Indeed, the statement “any antiderivative is equal to the indefinite integral” is still true – for all of the zero antiderivatives!

What's more: in more than one sense the integral is actually differentiable. In particular, for any $x$ and any sequence $((x)_i)_i$ converging to $x$ from above (i.e. $x_i>x$), you get $$ \lim_{i\to\infty} \frac{F(x_i) - F(x)}{x_i - x} \equiv \lim_{\xi\searrow x} \frac{F(\xi) - F(x)}{\xi - x} = \lfloor x\rfloor = f(x). $$ For all $x\not\in\mathbb{Z}$, this upper derivative is equal to the normal derivative. Trouble is, there would be no compelling reason to favour the upper derivative over the lower derivative, and it turns out that the lower derivative disagrees: $$ \lim_{\xi\nearrow x} \frac{F(\xi) - F(x)}{\xi - x} = \lceil x-1\rceil. $$ This is still equal to $f(x)$ almost everywhere, but for $x\in\mathbb{Z}$ we have $\lceil x-1\rceil = f(x)-1$.

You can pretty much say that the derivative is deliberately constructed in such a way that it doesn't exist in cases like this where there would be an ambiguity and the Fundamental Theorem would be contradicted. By requiring continuity of $f$, the Fundamental Theorem also precludes such ambiguity and guarantees that the integral has a well-defined derivative.

These upper or lower derivatives really aren't much use in practice, but there is a concept called weak derivative that does have some pretty useful applications.

  • 1
    $\begingroup$ I was speaking loosely. I simply meant that the indefinite integral is not the antiderivitive. $\endgroup$ – The Great Duck Jun 17 '16 at 23:48
  • 1
    $\begingroup$ Interesting though that there actually are such things as one sided derivatives. I had thought about using them when manipulating floor but had decided not to due to there being better* versions where floor is simply held constant. *better in my opinion $\endgroup$ – The Great Duck Jun 17 '16 at 23:52
  • $\begingroup$ I know this is a long time between posts but is that "weak derivative" thing a derivative equivalent to saying the derivative of a piecewise constant function is $0$? $\endgroup$ – The Great Duck Jan 22 '17 at 4:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.