8

It appears that $\max(x, y)$ isn't differentiable according to this question. However, the explanation is due to the fact that $\max(x, -x) = \lvert x\rvert$, and since there won't be the case $\max(0, -0)$, does this mean that this function is differentiable?

Ren
  • 467

2 Answers2

12

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$).

Bill Cook
  • 29,244
2

$max(0,x)$ is not differentiable everywhere. $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 everywhere.

Sean K
  • 15
  • 3