Given $$f(x, y) = x^m y^n$$ where $m$ and $n$ are positive integers, for which values of $m$ and $n$ is $f$ convex?
My intuition says that both $m$ and $n$ should be even. I am trying to prove this by showing that the Hessian matrix is positive semidefinite and getting a strange result.
We have $$\nabla f = \begin{bmatrix}mx^{m-1}y^n \\ nx^m y^{n-1}\end{bmatrix} \\ Hf = \begin{bmatrix}m(m-1)x^{m-2}y^n & nmx^{m-1} y^{n-1}\\ nmx^{m-1} y^{n-1} & n(n-1)x^{m}y^{n-2}\end{bmatrix}$$
$H$ is positive semidefinite if all upper-left determinants are nonnegative. The first submatrix has $ m(m-1)x^{m-2}y^n \geq 0$ for even $m, n$. But
$$\begin{align}\det H & = \left\vert\begin{matrix}m(m-1)x^{m-2}y^n & nmx^{m-1} y^{n-1}\\ nmx^{m-1} y^{n-1} & n(n-1)x^{m}y^{n-2}\end{matrix}\right\vert \\ & = \displaystyle - m^{2} n x^{2 m-2} y^{2 n-2} - m n^{2} x^{2 m-2} y^{2 n-2} + m n x^{2 m-2} y^{2 n-2} \\ & = \left(- m^{2} n - m n^{2} + m n\right) \left(x^{2 m-2} y^{2 n-2}\right) \\ & = (1-m-n)(mn)(x^{2 m-2} y^{2 n-2}) \end{align}$$
$x^{2 m-2} y^{2 n-2}$ and $mn$ are nonnegative, so we need $1-m-n \geq 0 $, which is true for no positive integers.
This is obviously wrong, as $f(x, y) = x^2 y^2$ is positive definite.
Where is my error?
$f(x, y) := x^2 y^2$ may be positive semidefinite, but that does not imply that it is convex. It is not.