Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I thought the derivative of function $\text{floor}(x)$ should be $\infty$ for integer values of $x$ and 0 elsewhere. But wolframalpha plot showed something different. Is there any explanation?

share|cite|improve this question
It does not exist for integer values, and it is $0$ elsewhere. Explanation: don't trust Wolfram too much. – 1015 Feb 17 '13 at 3:58
I really appreciate this website as an atomized helping tool, and it may be a good idea to collect as much bugs we can find and raise them to the website owners to improve. – Tariq Feb 17 '13 at 4:11
I don't think being a WolframAlpha bug tracker would be a good use of this site. If you find a bug in WolframAlpha you should probably just let them know directly. – Rahul Feb 17 '13 at 4:16
up vote 8 down vote accepted

The Alpha plot is badly wrong. The derivative of $\lfloor x \rfloor$ is 0 at non integers and not defined at integers. You would have to ask the people at Wolfram why this happens.

share|cite|improve this answer
It does that for some other graphs as well. – Joe Z. Feb 17 '13 at 4:02

It's probably calculating the derivative numerically instead of symbolically. An approach that gives a good approximation for functions that actually are differentiable, but behaves weird when the function is discontinuous.

For example, using a simple centered difference approximation $f'(x) \approx \frac{f(x + h) - f(x - h)}{2h}$, with $h = 0.05$, gives $f'(1) \approx \frac{f(1.05) - f(0.95)}{0.1} = \frac{1 - 0}{0.1} = 10$. This is nonsense, but an artifact of the computation.

share|cite|improve this answer

If you try asking Wolfram Alpha to differentiate the floor function, it will just output "Floor'(x)". If you force Wolfram Alpha to plot the derivative of the floor function, I think what Wolfram Alpha does is it as an infinite sum of dirac deltas, so that when you integrate, you can still get back the floor function. See and

Clearly that's not what you had in mind when you asked Wolfram Alpha to plot the graph, but well...

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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