Calculate the subgradient at $\pm \sqrt{2}$ for $1/2 x^2$

150 Views Asked by At

Let $f(x) = (1/2) x^2, x \in [-\sqrt{2}, \sqrt{2}]$ and $f(x) = +\infty$ elsewhere

I would like to compute the subgradient of this function at the boundary $\pm\sqrt2$. However, I am not sure how to proceed.

Here is my attempt:

$\partial f(x) = \{g \in \mathbb{R}| (1/2) y^2 \geq (1/2) x^2 + g(y - x), \forall y \in [-\sqrt{2}, \sqrt{2}]\}$

Therefore, $\partial f(\sqrt{2} ) = \{g \in \mathbb{R} | (1/2) y^2 \geq 1 + g(y - \sqrt{2}), \forall y \in [-\sqrt{2}, \sqrt{2}]\}$

Solving for $g$ requires me to solve that quadratic, which looks a bit complicated. So I test some values of $y$.

Let $y = \sqrt{2}$, then $1 \geq 1 + g(\sqrt{2}-\sqrt{2})$ or $g \in [-\infty, \infty]$.

Let $y = -\sqrt{2}$, then $1 \geq 1 + g(-\sqrt{2}-\sqrt{2})$ or $g \geq 0$.

Does this mean that the subgradient of this function at $\sqrt{2}$ is $g \in [0, \infty]$? It does not make sense when looking at the graph.

Update: there was some typos.

2

There are 2 best solutions below

3
On BEST ANSWER

The derivative of $f$ from the left at $x=\sqrt{2}$ is just the derivative of $h(x)=x^2/2$ at that point, that is, $f'_-(\sqrt{2})=\sqrt{2}$. The derivative from the right is $+\infty$, given that the function jumps to infinity. Therefore, your subdifferential is the set $\partial f(\sqrt{2})=[\sqrt{2},+\infty)$. Your function is even, so $\partial f(-\sqrt{2})=[-\infty,-\sqrt{2})$.

0
On

You made a typo substituting $x=\sqrt2$; your inequality should be $$ \frac12 y^2 \ge 1 + g(y-\sqrt2). $$ for all $y\in [-\sqrt2, \sqrt2]$. For $y$ outside this interval, there is no restriction since $f(y)=\infty$ there. Solving for $g$ is easy, not a quadratic: $$ g \ge \frac{\frac12 y^2-1}{y-\sqrt2} = \frac{y+\sqrt2}{2}, $$ which attains it's supremum when $y\to \sqrt2$ (it needs to hold for all $y$ in the interval, so we look for the $y$ that forces $g$ to be largest), so $g\ge \sqrt2$. So the subgradient is $[\sqrt2, \infty)$.

You should be able to repeat this process for $x=-\sqrt2$ now. Note that the answer could be found easier using regular derivatives, since the lower bound on $g$ is equal to $$ \lim_{y\to(\sqrt2)^-}\frac{f(y)-f(\sqrt2)}{y-\sqrt2} = \frac{d}{dy}\frac12y^2 \bigg|_{y=\sqrt2} = \sqrt2 . $$

NOTE: The mistake in your attempt was that you only inserted two particular values of $y$ in the inequality. You need it to hold for all values of $y$, and since $f$ is convex, the most restricting $y$-values will be in limit as $y\to (\sqrt2)^-$ (which leads us back to the derivative).