# Finding local minima / maxima of multivariable function

Suppose we have a function $f(x,y) = x^3 + 2y^2+3xy+y$

To find critical points of $f$, we compute its gradient:

$\nabla f=(3x^2+3y,\ 3x+4y+1)$

Solving this pair of equations, we see that the critical points of $f$ are $[1, -1]$ and $[ {-1 \over 4}, {-1 \over 16} ]$.

The Hessian matrix for function $f$ is:

$$\nabla^2 f = \begin{pmatrix} 6x & 3 \\ 3 & 4 \\ \end{pmatrix}$$

Since the determinant of this self-adjoint matrix is in the form:

$det(\nabla^2 f) = 24x - 9$

Then the determinant of $\nabla^2 f$ is positive when $x > {9 \over 24}$

Looking at each of the critical points, using Sylvester's criterion we see that

$det(\nabla^2 f(1,-1)) = 15$, which is positive, therefore $[1,-1]$ is a local minimum $f$

and

$det(\nabla^2 f({-1 \over 4}, {-1 \over 16})) = {6 \over 4} * 4 - 9 = -3$, which is negative, therefore $[{-1 \over 4}, {-1 \over 16}]$ is a local maximum of $f$

Is this result correct?

-

It seems that you did something wrong at the end. Since $\det(...)<0$ at $[-\frac{1}4,\frac{-1}{16}]$, then this point is a saddle point for the function. I suggest see this link instead http://en.wikipedia.org/wiki/Second_partial_derivative_test. $\ddot\smile$