My question is to
determine the region of $\Bbb R^2$ on which $f(x,y)=\max(x,y)$ is totally differentiable.
So far I have proved that $\max(x,y)$ is continuous on $\Bbb R^2$ because $\max(x,y)=\frac{x+y}2+\frac{|x-y|}2$ is the sum of continuous functions on $\Bbb R^2$. I guess $\max(x,y)$ is totally differentiable $\iff$ $x \ne y$ but I got stuck at the very first step. I wanted to show that if $x \ne y$ then $\max(x,y)$ is totally differentiable. Since $x \ne y$, $$f(x,y)=\begin{cases}x & \text{if} \ x>y\\ y & \text{if} \ x<y. \end{cases}$$ Symbolically, $$\frac{\partial f}{\partial x} = \begin{cases} 1, & x>y\\ 0, & x<y. \end{cases}$$
$$\frac{\partial f}{\partial y} = \begin{cases} 0, & x>y\\ 1, & x<y. \end{cases}$$ But for some fixed $(a,b)\in \Bbb R^2$ with $a>b$, I cannot convince mysefl why $$\frac{\partial f}{\partial x}(a,b)=\lim_{t \to 0}\frac{\max(a+t,b)-a}t=1?$$ Also $\frac{\partial f}{\partial x},\frac{\partial f}{\partial y}$ seem not to be continuous. Nothing guarantees the differentiability of $f(x,y)$ here.
Any help would be much appreciated.
In the open set $U = \{(x,y): y>x\},$ $f(x,y) = y.$ Of course the function $y$ is totally differentiable everywhere. Therefore $f$ is totally differentiable on $U.$ (No need to compute any partial derivatives.) The same holds for $\{(x,y): y<x\}.$
We're left thinking about the set $E= \{(x,y): y=x\}.$ Let $(a,a) \in E.$ If $h>0,$ we have
$$\frac{f(a,a+h)-f(a,a)}{h} = \frac{a+h - a}{h} = 1.$$
If $h<0,$ we have
$$\frac{f(a,a+h)-f(a,a)}{h} = \frac{a - a}{h} = 0.$$
It follows that $\lim_{h\to 0}(f(a,a+h)-f(a,a))/h$ does not exist, i.e., $\partial f/\partial y (a,a)$ does not exist. Thus $f$ is not differentiable at any point of $E.$