5

I want to know if $f(x, y) = (x \cdot y)^2 \,/\, 2$ with $x, y \in \mathbb{R}$ is a convex function. Naïvely, this plot looks very convex to me. However, one of the eigenvalues of the Hessian $H_f$, $$H_f = \begin{pmatrix} y^2 & 2xy \\ 2xy & x^2 \end{pmatrix}$$ is negative: $$\lambda_\pm = \frac{1}{2} \Big( x^2 + y^2 \pm \underbrace{\sqrt{(x^2 + y^2)^2 + 12x^2 y^2}}_{\ge \, x^2 + y^2} \Big)$$ which means that the Hessian is not positive semidefinte, hence the function is not convex, right?

Curiously, another property of convex functions is that their first-order Taylor approximation is a global underestimator: $$\frac{(b_1 b_2)^2}{2} = f(b_1, b_2) \overset{?}{\ge} f(a_1,\, a_2) + (\nabla f)^\top \begin{pmatrix} b_1 - a_1 \\ b_2 - a_2 \end{pmatrix} = -\frac{3}{2} (a_1 a_2)^2 + a_1 a_2 (a_2 b_1 + a_1 b_2) \quad \forall a_1, a_2, b_1, b_2 \in \mathbb{R}$$ I cannot find a counter example where this relation doesn't hold which aligns well with my observation that the plot looks quite convex. Obviously, at least one of my points is wrong... Can you spot my blunder? (Just in case this function is indeed not convex, is this obvious from the plot?)

dezdichado
  • 13,888
avitase
  • 53

2 Answers2

2

The function is not convex because the Hessian is not positive semidefinte (except on the $x$- and $y$-axis). Even without computing the eigenvalues this follows from the fact that the determinant of the Hessian matrix is negative except for $xy=0$.

You can also verify directly that $$ f(1, 1) = \frac 12 > 0 = \frac 12 \bigl( f(2, 0) + f(0, 2)\bigr) $$ violates the convexity condition. (You might recognize that in your plot).

Martin R
  • 113,040
1

To intuitively see that $f(x,y)=(xy)^2$ is not convex, take a look at $f$ on the line segment $L=\{(x,y) \in \mathbb{R}^2$; $y=2-x$; $2 \le y \le 0\}$. Note that $f$ achieves a bigger value on any point in the interior of $L$ than it does on either of the two endpoints $(0,2)$, $(2,0)$ of $L$.

Mike
  • 20,434