We have the function $f : \mathbb{R}^2 \to \mathbb{R}$ given by
$$f(x,y) := \max \left\{ |x|, |y| \right\}$$
Let $C := \left\{ (x,y) \mid |x|=|y| \right\}$. Given point $(x,y) \notin C$, how can I find the gradient $\nabla f(x,y)$?
I have to find $\frac{\partial f }{\partial x}$ and $\frac{\partial f }{\partial y}.$ But I am not sure, do we just get the following?
$$\frac{\partial f }{\partial x}=\max \{|1|,|y| \}, \qquad \frac{\partial f }{\partial y}=\max \{|x|,|1| \}$$
I'm not sure, can anyone help me ?
Hint:
$$\max(a, b) = \frac{a + b + |a - b|}{2}$$
Proof: