Derivative of $\left | x-\left \lfloor x+1 \right \rfloor \right |$ at $x = 1.5$

absolute valuecalculusceiling-and-floor-functionsderivatives

Q: If $f(x)=\left | x-\left \lfloor x+1 \right \rfloor \right |$, where $\left \lfloor x \right \rfloor$ denotes the greatest integer less than or equal to x and $\left | x \right |$ denotes the absolute value of x, then $f'(1.5)$ =

I am not quite sure how the derivative of floor function and absolute function. I did some research and found out that the derivative of an absolute function is $\frac{\left \lfloor x \right \rfloor}{x}$. But I am stuck with the floor function.

What concept should I be aware of to solve this question?

Best Answer

For non-integral and positive $x$, $\lfloor x+1\rfloor>x$ (e.g. if $x=2.7$ then $\lfloor x+1\rfloor=3$). So around $1.5$, $f(x)=\lfloor x+1\rfloor-x=\lfloor x\rfloor-x+1$.

Around the same place, $\lfloor x\rfloor$ is constant, so that when we take the derivative, it and the constant $1$ disappear and we are left with the derivative of $-x$, i.e. $-1$ which is our answer.

Related Question