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?
Derivative of floor function
20.8k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 4 best solutions below
On
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 http://reference.wolfram.com/mathematica/ref/DiracDelta.html and http://mathworld.wolfram.com/DeltaFunction.html
Clearly that's not what you had in mind when you asked Wolfram Alpha to plot the graph, but well...
On
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.
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.
Update: Alpha has changed its behavior in response to the input. It clearly now does not understand the request at all.