Let $f$ be a real-valued $C^2$ function in $\mathbb{R}^2.$ By Second partial derivatives, we know that if the Hessian is negative definite (equivalently, has all eigenvalues negative) at a, then $f$ attains a local maximum at a.
My question is about necessary condition for local maximum.
One of necessary conditions for local maximums is that its Hessian is negative semidefinite.
I was wondering if the following is true:
If $f$ is $C^2$ and has a local maximum at $x,$ then all second partial derivatives at $x$ are nonpositive.
Please let me know if you have any comment of it. Thanks in advance!