# Constrained Optimization of a function of two variables.

I was given the following tutorial problem, and I'm having a bit of trouble seeing how it works.

I've been asked to find the four critical points of this system, with two of these being degenerate points, one being a maximum, and one being a minimum;

$$f(x_1, x_2) = x_1^3 + x_2^3 + 3x_1^2 - 3x_2^2 - 8$$ subject to $g(x_1, x_2) = x_1^2 + x_2^2 - 16 = 0$.

First, I constructed a Lagrangian;

$$L = x_1^3 + x_2^3 + 3x_1^2 - 3x_2^2 - 8 + \lambda(x_1^2 + x_2^2 - 16)$$

Then, taking the gradient of $L$, we get two equations;

$$x_1 (3x_1 + 2(\lambda + 3)) = 0$$ $$x_2 (3x_2 + 2(\lambda - 3)) = 0$$

For the first equation to be satisfied, we have either $x_1 = 0$ or $3x_1 + 2(\lambda + 3) = 0$. In the case that $x_1 = 0$, we have that $x_2 = \pm 4$, due to our initial constraint. If $x_2 = 4$, we get that $\lambda = -3$, and if $x_2 = -4$, we get that $\lambda = 9$.

In a similar fashion, if $x_2 = 0$, $x_1 = \pm 4$. If $x_1 = 4$, $\lambda = -9$, and if $x_1 = -4$, $\lambda = 3$.

Thus, we have four critical points; $$(0,4) , \lambda = -3$$ $$(0,-4) , \lambda = 9$$ $$(4,0) , \lambda = -9$$ $$(-4,0) , \lambda = 3$$

Now, I then computed my Hessian matrix; $$H =\left( \begin{array}{ccc} 6x_1 + 6 + 2\lambda & 0 \\ 0 & 6x_2 - 6 + 2\lambda \\ \end{array} \right)$$

Then, I just plug in all my critical points (with their respective $\lambda$ values), and look at both the determinant and the principal minor of the Hessian.

Clearly, both $(0,4)$ and $(-4,0)$ are degenerate points, so we've satisfied the first criteria.

Looking at the Hessians for $(0,-4)$ and $(4, 0)$, I get that the principal minors for each are both positive, but each of the determinants are negative. For the point $(4,0)$, the principal minor is positive, while the determinant is negative, which implies that the point is a maximum. Similarly, $(0,-4)$ also appears to be a maximum.

Now, having verified my working on Wolframalpha, I've correctly identified $(4,0)$ as a local maximum, but it's also telling me that $(0,-4)$ is a local minimum.

From all the working I've done, I can't really see how $(0,-4)$ could be a minimum?? Could someone have a look at my working, and see where I've made my mistake??