People say that |x| is not differentiable, but isn’t the derivative of |x|, |x|/x

absolute valuecalculusderivativesgraphing-functionssolution-verification

I have heard that $|x|$ is not differentiable, but I found a derivative that meets all the requirements necessary.
Here is my proof that the derivative of $|x|$ is $|x|/x$. First, note that $|x|$ has a slope of $1$ when x is positive. $|x|/x$ also equals $1$ when $x$ is positive. $|x|$ has a slope of $-1$ when $x$ is negative. $|x|/x$ equals $-1$ because $|x|$ is positive and $x$ is negative. $|x|$ has an undefined slope at $x=0$ and |x|/x is also undefined at $x=0$. Therefore, $|x|$'s derivative is $|x|/x$.

Anything wrong with this?

Best Answer

The issue is that $f(x) = |x|$ is not differentiable at $x = 0$. Looking at the definition of the derivative at $x = 0$: $$\lim_{h\to 0}\frac{f(h) - f(0)}{h} = \lim_{h\to 0}\frac{|h|}{h}.$$ Now, since $$|h| = \begin{cases} -h, & h\le 0\\ h, & h>0 \end{cases}$$ we have that $$\lim_{h\to 0^{-}}\frac{|h|}{h} = \lim_{h\to 0^{-}}\frac{-h}{h} = -1$$ whereas $$\lim_{h\to 0^{+}}\frac{|h|}{h} = \lim_{h\to 0^{+}}\frac{h}{h} = 1,$$ which means that $f'(0)$ does not exist. If we consider $x\ne 0$ then we can say that $f'(x) = -1$ for $x < 0$ and $f'(x) = 1$ for $x>0$, i.e. $$f'(x) = \begin{cases} -1, &x<0\\ \text{DNE}, &x=0\\ 1, &x>0 \end{cases} = \begin{cases} \frac{|x|}{x}, &x\ne 0\\ \text{DNE}, &x = 0 \end{cases} $$ So, we can't say that $f$ is differentiable on $\mathbb{R}$, but we can say it is differentiable on $\mathbb{R}{\setminus\{0\}}$.

Related Question