Is $\max(0, x)$ a differentiable function?

The function $f(x) = \mbox{max}(0,x) = \left\{ \begin{array}{ccc} 0 & & x < 0 \\ x & & x \geq 0 \end{array}\right.$ is continuous everywhere since the formulas match up at $x=0$.

However, the slope of $f(x)$ for all $x<0$ is clearly 0 and the slope of $f(x)$ for all $x>0$ is clearly 1. If you try to compute the derivative of $f(x)$ at $x=0$, $f'(0)=\lim\limits_{h \to 0} \frac{f(0+h)-f(0)}{h} = \lim\limits_{h \to 0} \frac{f(h)}{h}$ you'll get the limit from the left is 0 and from the right is 1. Thus the derivative does not exist at $x=0$.

So $\mbox{max}(0,x)$ is continuous but isn't differentiable (at $x=0$).


$max(0,x)$ is not differentiable. $x \le 0 \rightarrow max(0,x) = 0$ which means that $x \le 0 \rightarrow \frac d{dx} max(0,x) = 0$. Similarly, $x \ge 0 \rightarrow max(0,x) = x$ which means that $x \ge 0 \rightarrow \frac d{dx} max(0,x) = 1$. At $x = 0$, the derivative is therefore discontinuous. Thus, the function is not differentiable.

Tags:

Derivatives