# Does entry-wise non-negativity imply positive semidefiniteness?

Suppose we are given the function $f_1(x_1,x_2) = x_1x_2$, whose Hessian is

$$\nabla^2 f_1(x)= \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}$$

Now, it looks like this matrix is componentwise greater than or equal to zero, i.e.,

$$\nabla^2 f_1(x)= \begin{bmatrix} 0 & 1 \\ 1 & 0\end{bmatrix} \succcurlyeq 0$$

which means that the matrix should be positive semidefinite (and, hence, the function $f_1(x_1,x_2)$ should be convex). However, Boyd & Vandenberghe's Convex Optimization states that $f_1(x_1,x_2)$ is not convex.

Boyd & Vandenberghe also has another problem:

Is $f_2(x_1,x_2)=\frac{1}{x_1x_2}$ on the positive orthant convex?

The solution says that its Hessian is

$$\nabla^2 f_2(x)= \frac{x_1}{x_2}\begin{bmatrix} \frac{2}{x_1^2} & \frac{1}{x_1x_2} \\ \frac{1}{x_1x_2} & \frac{2}{x_2^2}\end{bmatrix} \succcurlyeq 0$$

Therefore, $f$ is convex and quasiconvex. My interpretation of this problem is that componentwise greater than or equal to zero of the Hessian implies that the matrix is positive semidefinite. However, this interpretation seems to contradict the above problem for $f_1$.

• CONFUSION ALERT: Surprised that no one seems to have noticed: The given matrix $\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}$ is the Hessian of $g(x_1, x_2) = x_1x_2$, not of $f(x_1, x_2) = (x_1x_2)^{-1}$. This matrix has eigenvalues $\pm 1$, so is not positive semi-definite. – Robert Lewis Apr 19 '18 at 19:37
• OK, I guess Siong Thye Goh noticed this just about the time I made the above comment! – Robert Lewis Apr 19 '18 at 19:39
• Actually, I noticed it 10 minutes before your post. Cheers. – max_zorn Apr 19 '18 at 19:48

The Hessian matrix of $1/(xy)$ is $$\begin{pmatrix} \frac{2}{x^3y} & \frac{1}{x^2y^2}\\ \frac{1}{x^2y^2} & \frac{2}{x^3y}\end{pmatrix}$$ Now if $x>0$ and $y>0$ this is a positive definite matrix because the diagonal entries are positive and the determinant is positive. Hence the function is strictly convex on the positive orthant.
Finally, for a $2\times 2$ symmetric real matrix, it is positive semidefinite if and only if the diagonal entries and the determinant are nonnegative.