Left and right gradients of an absolute function

164 Views Asked by At

I need to find left and right partial derivatives of the following function.

$$ \Phi (x_1, x_2) = \vert x_2 - x_1 \vert \ \text{on} \ \mathbb{R}^2 $$

The first question is to prove $\Phi$ is convex, which I can do. The second is to find left and right gradients and see if the gradient exists. My attempt:

$$ x_2 \ge x_1 \implies \vert x_2 - x_1 \vert = x_2 - x_1 $$

$$ x_2 \le x_1 \implies \vert x_2 - x_1 \vert = - x_2 + x_1 $$ The left gradient as $x$ approach $0$ is ($x_1 \le x_2$): $$ D\Phi_{-} (0) = [ -1 \ 1] $$ The right gradient as $x$ approach $0$ is ($x_1 \ge x_2$): $$ D\Phi_{-} (0) = [ 1 \ -1] $$ Since the left is not equal to the right, the gradient does not exist. Is this a right way to prove this?

1

There are 1 best solutions below

2
On

The one-sided partial derivatives exist at all points. The right derivative of $\Phi$ w.r.t. $x_1$ at $(x_1,x_2)$ is $1$ for $x_1 \geq x_2$ and $-1$ for $x_1 <x_2$. [ For example in the second case we get $\lim_{h \to 0+} \frac {(-x_1-h+x_2)-(-x_1+x_2)} h =-1$]. Similarly, the left derivative of $\Phi$ w.r.t. $x_1$ at $(x_1,x_2)$ is $-1$ for $x_1 \geq x_2$ and $1$ for $x_1 <x_2$. The partial derivatives w.r.t. $x_2$ are similar.