Example of investigating a stationary point
Consider $$ f(x,y) = 4x^3 - 12xy + y^2 + 10y + 6. $$
Computing the first derivatives $$\begin{align*} f_x &= 12x^2 - 12y, \\ f_y &= -12x + 2y + 10. \end{align*}$$ Stationary points satisfy $f_x = f_y = 0$. So $$\begin{align*} 0 &= 12x^2 - 12y \\ y &= x^2 \\ 0 &= -12x + 2x^2 + 10 \\ 0 &= (x - 5)(x - 1) \end{align*}$$ and so the stationary points are $(1,1)$ and $(5,25)$.
Now we compute the second derivatives $$\begin{align*} f_{xx} &= 24x \\ f_{xy} &= -12 \\ f_{yy} &= 2. \end{align*}$$
-
For $(1,1)$, the Hessian is $$ H = \pmat{24 & -12 \\ -12 & 2}. $$ Using Sylvester's criterion, we compute $$\begin{align*} |H_1| &= 24 \\ |H_2| &= 24\cdot2 - (-12)(-12) = -96 \end{align*}$$ so the signature is $+,-$ and the criterion does not work.
But notice that $\lambda_1\lambda_2 = |H| = -96 < 0$ so $\lambda_1, \lambda_2\neq 0$ and have opposite signs. Thus $(1,1)$ is a saddle point.
The contours locally satisfy $$\begin{align*} \delta\v xH\delta\v x^T &= \text{const.} \\ 24\delta x^2 + 2(-12)\delta x\delta y +2\delta y^2 &= \text{const.} \end{align*}$$ which is a hyperbola.
-
For $(5,25)$, the Hessian is $$ H = \pmat{120 & -12 \\ -12 & 2}. $$ Computing, $$\begin{align*} |H_1| &= 120 \\ |H_2| &= 120\cdot2 - (-12)(-12) = 96 \end{align*}$$ so the signature is $+,+$ and hence $H$ is positive definite. Therefore, $(5,25)$ is a local minimum.
Contour plot:
Contour near $(1,1)$: the eigenvalue $\lambda_1 > \lambda_2$, so the contour lines are narrower along the eigenvector $\v u_2$ associated with $\lambda_2$.
Contour near $(5,25)$, the eigenvalue $\mu_1 > \mu_2$, so the ellipse is narrower along the eigenvector $\v v_2$ associated with $\mu_2$.