# Convex function from Hessian

Am I correct to say that the following function is convex?

\begin{align} & f(x,y)=-\sqrt{xy} \\ & x>0,y>0 \\ \end{align}

After computing the Hessian:

$$Hf =\left[ \begin {array}{cc} 1/4\,{\frac {{y}^{2}}{ \left( xy \right) ^{ 3/2}}}&1/4\,{\frac {xy}{ \left( xy \right) ^{3/2}}}-1/2\,{\frac {1}{ \sqrt {xy}}}\\ 1/4\,{\frac {xy}{ \left( xy \right) ^ {3/2}}}-1/2\,{\frac {1}{\sqrt {xy}}}&1/4\,{\frac {{x}^{2}}{ \left( xy \right) ^{3/2}}}\end {array} \right]$$

Which simplifies to:

$$Hf=\left[ \begin {array}{cc} 1/4\,{\frac {y}{x\sqrt {xy}}}&-1/4\,{\frac {1}{\sqrt {xy}}}\\ -1/4\,{\frac {1}{\sqrt {xy}}}&1/4 \,{\frac {x}{y\sqrt {xy}}}\end {array} \right]$$

And taking the determinant:

$$det(Hf)=0 \ \ \ \ \forall \ x,y \in \Re^+$$

Which is inconclusive.

Will need another method, namely $z^T (H f) z \$

## See solution in the answer below for continuation:

Aside: And, extending this to an n-dimensional problem: $$f(x_1,x_2,...,x_n)=-\sqrt[n]{x_1x_2...x_n}$$ $$x_i \gt 0 \ \ \ i=1,2,3,...,n$$

Will also yield a convex function.

Thanks.

-

The function is convex, but note that zero determinant is not a sufficient condition to give positive semi-definite (or negative semi-definite). With $z^T=(a,b)$, I get $$z^T H\!f z=\frac{1}{4(xy)^{3/2}}(ay-bx)^2,$$ and so $H\!f$ is positive semi-definite, giving a convex function.

-
I just checked your result and it looks to be correct. I was, for some reason, thinking of affine functions and a zero matrix. Thank you. – user42538 Nov 18 '12 at 0:18

The $n$-dimensional function $f(x_1,x_2,...,x_n)=-\sqrt[n]{x_1x_2...x_n}$ where $x_i \gt 0 \ \ \ i=1,2,3,...,n$ is called arithmetic average (except for a negative sign).

Yes, it is convex. The Hessian matrix $\mathsf{H}f$ is

$$\mathsf{H}f = \left ( \frac{f(x_1,...,x_n)}{n^2x_ix_j}(1-\delta_{ij}) \right)_{ij} \quad i,j = 1,...,n$$

where $\delta_{ij} = 1$ if $i=j$, $0$ otherwise. It is easy to show that for any $d \in \mathbb{R}^n$, $d^T\mathsf{H}fd \ge 0$.

This function is actually Example 4.3.3 of the text book "Fundamentals of Convex Analysis" by Jean-Baptiste Hiriart-Urruty & Claude Lemarechal.

-