[Math] About the derivative of the absolute value function

absolute valuecalculusderivatives

For this question, let $f(x) = |x|$.


I found this answer saying that the derivative of the absolute value function is the signum function. In symbols,

$$\frac{d}{dx}|x| = \mathrm{sgn}(x).$$

I know that

$$f'(x) = \frac{x}{|x|}$$

using the chain rule. Notice that this is well-defined for $x \neq 0$. However, the definition of the signum function is

$$\mathrm{sgn}\,x = \begin{cases}-1 && \text{for } x< 0 \\ 0 &&\text{for }x = 0 \\ 1 && \text{for } x > 0\end{cases}.$$

This will be my question:

Are $x/|x|$ and $\mathrm{sgn}\,x$ the same derivative of $|x|$?

Best Answer

No they are not. The absolute value function is differentiable at $x$ if and only if $x\ne0$. And, when that happens, the derivative is indeed $\operatorname{sgn}(x)$ or $\frac x{|x|}$. But, since the derivative of the absolute value function is undefined at $0$, but $\operatorname{sgn}$ is defined at that point, those two functions have distinct domains and therefore they cannot possibly be equal.