# Differentiability of $\mathrm{max}(x, y)$ at $x=y$

I am trying to figure out differentiability of $\mathrm{max}(x, y)$. Intuitively, it should not be differentiable at $x=y$, since it changes direction "non-smoothly" at those points.

I can not, however, find a way to prove this algebraically.

Hint: Write

$$\operatorname{max}(x,y) = \frac{x + y + |x-y|}{2}$$

Take any point $(a,a)$ and prove that the partial derivative does not exist. The partial derivative is $\lim_{x\rightarrow a} \frac{f(x,a)-f(a,a)}{x-1}$. The left limit for this is $$\lim_{x\uparrow a}\frac{\max\{x,a\}-a}{x-a}=\lim_{x\uparrow a}\frac{a-a}{x-a}=0$$ while the right limit is $$\lim_{x\downarrow a}\frac{\max\{x,a\}-a}{x-a} = \lim_{x\downarrow a}\frac{x-a}{x-a}=1$$

Let $f(x,y)=\max \{x,y\}$. Now look at $f$ on the section $y=-x$: $$f(x,-x)=\max \{x,-x\}=|x|.$$ This function is not differentiable as a function of the variable $x$, so $f$ can't be differentiable.


• Formula valid for... $x\ne y$. – Martín-Blas Pérez Pinilla Feb 10 '14 at 14:06
• @Martín-BlasPérezPinilla Yes. I agree. Thanks. – Felix Marin Feb 10 '14 at 14:18
• @Martín-BlasPérezPinilla Consider the $\large{\rm sgn}$ function as a distribution and it will make sense. – Felix Marin Feb 10 '14 at 23:36
• Distributions? These seem wildly out of the scope of the question, don't you think? – Did Feb 11 '14 at 16:10