2

I want to check if the function $f(x)$ is convex, where

$$ f(x)=\bigl|a|x|-x\bigr|^2.$$

There are several possibilities to check if the function is convex:

  1. The second derivative: Not possible, because it is only subdifferential.
  2. Geometry: too complicated for this case.
  3. Convex inequality: $$f(tx+(1-t)y) \leqslant tf(x) + (1-t)f(y).$$

To 3: How to use the inequality? Can somebody help to put the function into the convex inequality?

jester
  • 324

2 Answers2

1

$f$ can be written as $$ f(x) = \begin{cases} (a-1)^2 x^2 & x\ge0,\\ (-a-1)x^2 & x\le 0. \end{cases} $$ The first derivative is given by $$ f(x) = \begin{cases}2 (a-1)^2 x & x\ge0,\\ 2(-a-1)^2x & x\le 0, \end{cases} $$ which is a monotonically increasing function, hence $f$ is convex.

daw
  • 49,113
  • 2
  • 38
  • 76
1

first of all you don't need the outer abs |.| because of the square. Hence

$$ f(x)=\vert a\vert x\vert-x\vert^2=(a\vert x\vert -x)^2=a^2\vert x\vert^2-2a\vert x\vert x +x^2 $$ Observe that $\vert x\vert^2=x^2$ for all $x\in \mathbb{R}$. Thus, $$ f(x)=a^2 x^2-2a\vert x\vert x +x^2=(a^2+1)x^2-2a\vert x\vert x $$ Now, we can consider $f$ for $x\geq0$ and $x<0$, i.e. $$ f(x)=\begin{cases} (a^2-2a+1)x^2,&\quad x\geq 0\\ (a^2+2a+1)x^2,&\quad x< 0 \end{cases}=\begin{cases} (a-1)^2x^2,&\quad x\geq 0\\ (a+1)^2x^2,&\quad x< 0 \end{cases} $$ In both cases you have a parabola for $a\in \mathbb{R}\setminus \{-1,+1\}$ which are opened up. Hence $f$ is convex. Otherwise one part of $f$ is 0, the other part a parabola open up. So, $f$ is again convex.

Serdar
  • 151
  • You need to check the convexity of $f$ at $x=0$, the parabola argument is not enough. The function $(|x|-1)^2$ is non-convex, but also consists of two parabolas opened up. – daw Mar 23 '18 at 11:09
  • Yeah you're right. You can easily check that $f$ is continuous and differentiable in 0. The function (\vert x\vert-1)^2 is continuous but not differentiable in 0. – Serdar Mar 23 '18 at 11:35