# Is $f(x_1,x_2)=x_1x_2$, with $x_1,x_2 \in \mathbb{R}_+$, a convex function?

Let $f(x_1,x_2)=x_1x_2$, with $x_1,x_2 \ge 0$. Is $f$ a convex function? Why?

$\ \\$

Edit (in view of the comments below)

The Hessian matrix is $H=[0\, 1; \,1 \,0]$, which is indefinite (in general). In fact, $x H x'= 2x_1x_2$. However, $2x_1x_2\ge 0$ when $x_1,x_2\ge 0$, so that the Hessian is indeed positive semidefinite when $x_1,x_2\ge 0$. Therefore, is this sufficient to conclude that my $f$ is convex?

-
Just apply the definition. –  A.D Jan 25 '13 at 14:47
Or, maybe you know a criterion where the Hessian matrix is negative definite? –  GEdgar Jan 25 '13 at 15:05

The Hessian is indeed indefinite. A $2\times 2$ matrix $A$ is positive semidefinite if and only if $x'Ax\geq0$ for all $x\in\mathbb{R}\times\mathbb{R}$ and not only those in $\mathbb{R}_+\times\mathbb{R}_+$. Hence $f(x,y)=xy$ is not convex.

Indeed, you could try to see $f(1,0)=f(0,1)=0$ while $f(1/2,1/2)=1/4 > 0$.

-
Thank you. This is exactly what I wanted to know. –  user52227 Feb 16 '13 at 14:11

Note that \begin{align}f(a(x_1,x_2)+(1-a)(y_1,y_2)) &=f(ax_1+(1-a)y_1 , ax_2+(1-a)y_2) \\ &=(ax_1+(1-a)y_1)(ax_2+(1-a)y_2) \\ &= a^2x_1x_2 +(1-a)^2y_1y_2 +a(1-a)(x_1y_2+x_2y_1) \\ & \leq ax_1x_2 +(1-a)y_1y_2 \\&=af(x_1 ,x_2)+ (1-a)f(y_1,y_2) \end{align}

Note that $0<a<1$

-
Thanks. This would prove that $f$ is convex. But I am sorry, can you please explain the $\le$ in your derivation? It's not clear to me –  user52227 Jan 25 '13 at 15:40

Consider two points with $x = a > 0$ and $y > 0$. They lie on a straight line which is both convex and concave. Now consider two points on $x=y,\quad x>0$, here $f=x^2$ which is convex. Now, two points on $x+y=5$ (say) gives you a concave function, so $f$ is clearly neither convex nor concave in your region (or indeed, anywhere).

-