Second order condition for convexity

convex optimization

In Pr. Boyd's optimisation book, it is stated that for twice differentiable function $f$ with convex domain, $f$ is convex if and only if $\nabla^2f(x) \succcurlyeq 0$ for all $x \in dom f$. The point here is that the Hessian matrix should be positive semi-definite. My question is that can we have this for functions with scalar inputs? If so, why doesn't this hold for $f(x)=x^3$. While the stated condition is necessary and sufficient, the second derivative is $\frac{d^2}{dx^2}f(x) = 6x$ which is zero for input zero, but this is not a minimiser point.

Best Answer

For functions $\Bbb R\to \Bbb R$ the condition $\nabla^2_xf\succcurlyeq 0$ reduces to $f''(x)\geqslant0$.

$x^3$ is in point of fact convex on $[0,\infty)$ (because $f''\geqslant 0$ there) and not convex in any larger interval (because $f''$ has some negative values there).