# Is positive definite function (dynamical systems) always convex?

Let $$f : \mathbb{R}^n \to \mathbb{R}$$, $$n \in \mathbb{N}$$, be such that

1. $$f \in C^1(\mathbb{R}^n)$$,
2. $$f(0) = 0$$,
3. $$f(x) > 0$$ for all $$x \in \mathbb{R}^n \setminus\{0\}$$.

Is it true that such function must be convex on a neighborhood of the origin? If not, can you come up with a counterexample?

Considering the simplest scenario when $$n = 1$$, I expect that a smooth function with infinite amount of minima approaching the origin should serve as a counterexample. But I am unable to construct an explicit formula for the function.

• if it is smooth (or even $C^2$), then it is surely convex , since its second derivative is positive May 3 at 18:07
• @Exodd Interesting! Could you show me a sketch of the proof for a $C^2$ function? Or is this available in the literature? May 3 at 18:12
• for $C^2$ functions, just expand $f(h) + f(-h) -2f(0) / h^2$ with Taylor, to find that $f''(0)\ge 0$ May 3 at 18:26
• @Exodd It seems like $f(x) = x^6(1 + \sin^2(x^{-1}))$ disproves your claim. May 4 at 6:56

The answer is in general no. As a general counterexample, consider any smooth strictly positive function $$f_0$$ that is defined on the unit sphere $$S^{n-1} \subset \mathbb{R}^n$$ and then define $$f$$ to be homogeneous of degree $$p>1$$ such that $$f$$ agrees with $$f_0$$ on $$S^{n-1}$$, that is $$f(x) = \|x\|^p f_0(x/\|x\|)$$ for $$x \ne 0$$. Then $$f$$ is clearly $$C^1$$, but it need not be convex in any neighborhood of the origin.
For a one-dimensional counterexample, consider $$f(x) = x^4 \left( 1 + \sin^2(x^{-1}) \right)$$.
• I have troubles understanding the general counterexample. If I take $n = 2$, $\|\cdot\|$ as the Euclidean norm, $p = 2$, and I set $f_0 \equiv 1$ on the unit sphere $S^1$, then $f(x) = x^2 + y^2$ which is clearly convex. Am I missing something? May 4 at 9:05