Finding the gradient of $f(x,y)=\max \{|x|,|y| \}$

240 Views Asked by At

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 ?

1

There are 1 best solutions below

0
On

Hint:

$$\max(a, b) = \frac{a + b + |a - b|}{2}$$

Proof:

  • Assume $a > b$. Then, we have $0.5(a + b + |a - b|) = 0.5(a + b + a - b) = a$. As desired.
  • Assume $a < b$. Then, we have $0.5(a + b + |a - b|) = 0.5(a + b - a + b) = b$. As desired.
  • Assume $a = b$. Then, it is obvious.