# Finding extremum values in a given function using hessian matrix

Please check if my answers are correct specially for part 3 and help me to do the fourth part in this problem

Let f(x,y)=x$^4$-8x$^2$+y$^4$-18y$^2$

1. Find the critical points of f
2. Determine the nature of the critical points of f
3. Find the set of global minimizers of f
4. Does f have a global maximizer?Justify?

I first calculated the gradient of f and then let partial derivative of x and y to be equal to 0.Thereby the critical points I found are (0,0)(0,3)(0,-3)(6,0)(6,3)(6,-3).

Then I computed the Hessian matrix :

H(x,y)= $$\begin{pmatrix} 12x^2-48x & & 0 \\ 0& & 12y^2-36 \\ \\ \end{pmatrix}$$ To find the nature of critical points I computed the Hassian matrix at each critical point.

These are my answers for part 2:
H(0,0)

This can be either positive semi definite or negative semi definite.Hence the critical point can either be a minimizer , maximizer or a saddle point.Therefore it can't be concluded the type of the critical point.

H(0,3)

This is positive semi definite. Therefore as earlier nothing can be said about the critical point.
Same with H(0,-3).

H(6,0)is also positive semi definite.

H(6,3) is a positive definite matrix.Hence there's a local minimum at (6,3)

H(6,-3) is a positive definite matrix.Hence there's a local minimum at (6,-3).

I used the theory

H(z) is negative semidefinite for all z ∈ S ⇒ [x is a global maximizer of  f  in S if and only if x is a stationary point of  f ]
H(z) is positive semidefinite for all z ∈ S ⇒ [x is a global minimizer of  f  in S if and only if x is a stationary point of  f ],


When H(x,y) is positive semidefinite for all x in a particular region, in that region the function is convex and any local minimizer is a global minimizer in that region. Is this a correct statement?

To be positive semi definite det H(1)>0 and det H(2)=0:
Thus 12x$^2$ - 48x > 0.

x$\in$ (-infinity,0)$\cup$(4,infinity)

det H(2)=0 when (12x$^2$-48x)(12y$^2$-36)=0
Since (12x$^2$-48x) >0,
(12y$^2$-36)=0
Thus y=$\pm$$\sqrt3 Thus hessian matrix is positive definite when x\in (-infinity,0)\cup(4,infinity) and y=\pm$$\sqrt3$ .

But can I say that the matrix is positive definite even if det H(2)>0.
Therefore I selected the critical points where x$\in$ (-infinity,0)$\cup$(4,infinity) and y>$\sqrt3$ and y<-$\sqrt3$.
Thus the global minimizers of f are (6,3)are (6,-3).

This is a very long process and I do not understand how to find the answer for part 4.
Is there a short method to do this kind of a problem and I would prefer if anybody can help me to do this problem using theories based on positive/negative definite/semidefiniteness and using hessian matrix.

We need to back up a little, because there's an error in the critical point calculation. We have

$$\frac{\partial f}{\partial x} \ = \ 4x^3 \ - \ 16x \ = \ 4x \ (x^2 \ - \ 4 ) \ = \ 0 \ \ ,$$

$$\frac{\partial f}{\partial y} \ = \ 4y^3 \ - \ 36y \ = \ 4y \ (y^2 \ - \ 9 ) \ = \ 0 \ \ .$$

The possible "pairings" of coordinate solutions for these equations give us nine critical points: $\ (0, 0) \ , \ (0, \ \pm 3) \ , \ (\pm 2, \ 0) \ , \ (\pm 2, \ \pm 3) \$ .

There is also an error in the Hessian matrix, since one of the first partial derivatives was incorrect; the second partial derivatives are

$$\frac{\partial^2 f}{\partial \ x^2} \ = \ 12x^2 \ - \ 16 \ \ \ , \ \ \frac{\partial^2 f}{\partial \ y^2} \ = \ 12y^2 \ - \ 36 \ \ \ , \ \ \frac{\partial^2 f}{\partial x \ \partial y} \ = \ \frac{\partial^2 f}{\partial y \ \partial x} \ = \ 0 \ \ .$$

So the Hessian is

$$\mathbf{H} \ = \ \begin{pmatrix} 12x^2-16 & 0 \\0&12y^2-36 \\ \end{pmatrix} \ \ .$$

Because the entries in the matrix are even functions, it saves us some work to evaluate it for the critical points:

(0, 0) -- $\begin{pmatrix} -16 & 0 \\0 &-36 \\ \end{pmatrix} \ \ ,$ which is negative definite, making this location a local maximum of the function;

(0, ±3) -- $\begin{pmatrix} -16 & 0 \\0 &72 \\ \end{pmatrix} \ \ ,$ which is indefinite;

(±2, 0) -- $\begin{pmatrix} 32 & 0 \\0 &-36 \\ \end{pmatrix} \ \ ,$ which is also indefinite;

(±2, ±3) -- $\begin{pmatrix} 32 & 0 \\0 &72 \\ \end{pmatrix} \ \ ,$ which is positive definite, hence these points are local minima.

We can verify this using the $\ D-$ index often learned on our first encounter with multivariate optimization, $\ D \ = \ f_{xx} \ f_{yy} \ - \ f^2_{xy} \$ :

$$D \ \vert_{(0,0)} \ = \ (-16) \ (-36) \ - \ 0^2 \ > \ 0 \ \ , \ \ f_{xx} \ < \ 0 \ \ ,$$

so this is a local maximum;

$$D \ \vert_{(0,\pm 3)} \ = \ (-16) \ (72) \ - \ 0^2 \ < \ 0 \ \ , \ \ D \ \vert_{(\pm 2,0)} \ = \ (32) \ (-36) \ - \ 0^2 \ < \ 0 \ \ ,$$

which indicates that these are "saddle points"; and

$$D \ \vert_{(\pm 2, \pm 3)} \ = \ (32) \ (72) \ - \ 0^2 \ > \ 0 \ \ , \ \ f_{xx} \ > \ 0 \ \ ,$$

hence these are local minima.

A three-dimensional graph of $\ f(x,y) \$ is a bit difficult to read because of the large range of relevant values of the function (as we shall see), and because of the complicated character of part of the surface. Instead, we will view "slices" through the surface to investigate the critical points.

A slice through $\ y \ = \ 0 \$ shows the local maximum at $\ ( 0, \ 0, \ 0) \$ and what appear to be minima at $\ x \ = \ \pm 2 \$ . However, if we take slices nearby at $\ y \ = \ \pm \frac{1}{2} \ ,$ we see that the cross-sectional curve "shifts downward" (computing the function at these values of $\ y \$ confirms this). So $\ (0, \ 0) \$ indeed marks a local maximum, but $\ (0, \ \pm 2) \$ are saddle points (maxima in the $\ y-$ direction, but minima in the $\ x-$ direction).

Similarly, we can examine the rest of the critical points by using slices in the vicinity of $\ y \ = \ \pm 3 \$ . The cross-sectional curves at $\ y \ = \ \pm \frac{5}{2} \$ and $\ y \ = \ \pm \frac{7}{2} \$ "shift upward" , so we find that the points $\ (\pm 2, \ \pm 3) \$ are true local minima, but the points $\ (0, \ \pm 3) \$ are saddle points (maxima in the $\ x-$ direction, minima in the $\ y-$ direction).

For questions (c) and (d), then, we have identified one local maximum at $\ (0, \ 0)$ and four local minima at $\ (\pm 2, \ \pm 3) \$ . The degree of the polynomial in each "dimension" of our function is even, and the leading coefficient is positive in both cases ( $\ x^4 \ - \ 8x^2 \$ and $\ y^4 \ - \ 18y^2 \$ ) , so the surface "opens upward" in both dimensions. We can conclude that the local minimal are in fact global minima; hence, the global minimum value of our function is $\ f(\pm 2, \ \pm 3) \$ $= \ 16 \ - \ 32 \ + \ 81 \ - \ 162 \ = \ -97 \$ . On the other hand, these polynomials have no upper bound, so our function grows without limit when we "get far from the origin". Thus, the local maximum we found at the origin is only that; the function has no global maximum.