# Using Hessian to find extrema

1. Oct 29, 2013

### MuIotaTau

1. The problem statement, all variables and given/known data

Identify and determine the nature of the critical points of the function $$f(x,y,z) = (x^2 + 2y^2 + 1) cos z$$

2. Relevant equations

$\vec{x}$ is a critical point $\iff Df(\vec{x}) = 0$

$\vec{x}$ is a minimum $\iff$ every determinant of upper left submatrix of Hessian is positive

$\vec{x}$ is a maximum $\iff$ every odd determinant of upper left submarix of Hessian is negative and every even determinant is positive

$\vec{x}$ is a saddle point otherwise

3. The attempt at a solution

The derivative of $f$ is the row matrix with elements $2xcosz$, $4ycosz$, $(-x^2-2y^2-1)sinz$.

Setting each component equal to zero, I try to find the critical point, but I feel as if something is going wrong. The first critical point (or rather, set of critical points) I find is $(0,0,2k\pi)$, where $k$ is a positive integer. But how am I supposed to use the second derivative test on something like that? I'm just a bit lost.

2. Oct 29, 2013

### Dick

You are missing some critical points. k doesn't have to be positive. And, for example, $(0,0,\pi)$ is also a critical point. Then your next job is to write down the Hessian matrix and evaluate it at the critical points. What does it look like? The answer is really pretty simple.

3. Oct 29, 2013

### MuIotaTau

Oh sorry, you're right, what I have written down on paper is $k$ is an integer (which is still wrong, only less so ). So that particular set of critical points should be $(0,0,k\pi)$ where $k$ is any integer. And I have additional points, do I not? $(2y^2 - 1 , y, (k + \frac{1}{2})\pi)$ for any $y$, right?

So let's see if I can get away with not trying to TeX up the matrix and just write the determinants. $$d_1 = 2 cos z$$ $$d_2 = 8 (cos z)^2$$ $$d_3 = 8(x^2 + 2y^2 + 1)(cos z)^2 (sin z) - 16x^2 (cos z)^3$$

So for $(0,0,k\pi)$, I get that $d_1$ is either positive or negative, $d_2$ is always positive, and $d_3$ is always zero. So does that mean I simply discard the result from $d_3$ and I get that critical points of this form are either minima or maxima? Specifically, if $k$ is even, it's a minimum, and if $k$ is odd, it's a maximum?

And assuming I have all that right, does the Hessian not give me any information on my other set of critical points, since all the determinants equal zero?

Last edited: Oct 29, 2013
4. Oct 29, 2013

### Dick

Yes, the set of all critical points is $(0,0,k\pi)$ for k any integer. There aren't any others. An expression for a critical point is just a number or a vector, right? It can't contain any of the variables defining the function. And I'm not sure what you are trying to say about the Hessian. Just tell me what you get for it. You don't have to tex it up. Just tell me what you are getting for each of the three rows. It's a lot easier to insert the numerical values of the critical points first, especially x=0 and y=0, and then find the determinants.

5. Oct 29, 2013

### MuIotaTau

Yeah, sorry, I guess I meant any points $(2b^2 - 1, b, (k + \frac{1}{2})\pi)$ where $b$ is any real number and $k$ is any integer. That satisfies the condition that $Df = 0$, doesn't it?

Okay, sure thing! For the first row: $2cosz$, $0$, $-2xcosz$
For the second: $0$, $4cosz$, $-4ysinz$
For the third: $-2xcosz$, $-4ysinz$, $(-x^2 - 2y - 1)sinz$

Yeah, that's definitely true. So my matrix entries should be:

$2cos(k\pi)$, $0$, $0$
$0$, $4cos(k\pi)$, $0$
$0$, $0$, $0$

Therefore $d_1 = 2cos(k\pi)$ and $d_2 = 8(cos(k\pi))^2$.

So for those points where $k$ is even, both $d_1$ and $d_2$ are positive, so those are minima. And for those points where $k$ is odd, $d_1$ is negative and $d_2$ is positive, so those are maxima. $d_3$, however, is zero, but can we just ignore that and base our conclusion off of $d_1$ and $d_2$ only? Or does $d_3$ being zero invalidate the whole test?

6. Oct 29, 2013

### Dick

Well, no. You need sin(z)=0 to get a critical point. Then cos(z) is not zero, so x=0 and y=0. Go back to your expression for the derivative. $(x^2+2y^2+1)$ is NEVER zero.

You've got some problems there. I think some might just be typos, but $(-x^2 - 2y - 1)sinz$ should definitely be $(-x^2 - 2y^2 - 1)cosz$. Check it.

Last edited: Oct 29, 2013
7. Oct 30, 2013

### MuIotaTau

Oh man, do I ever feel dumb. I simply changed $x^2$ to $x$ at some point in my calculation, which obviously changed the problem significantly.

You're right, yet another error! I just somehow forgot to differentiate that sine term.

So, after having reviewed my work, I get that my Hessian is

$2 cos k\pi$ $0$ $0$
$0$ $4 cos \pi$ $0$
$0$ $0$ $-cos k\pi$

And so $d_3$, being the trace of the Hessian, is no longer zero. But now when $k$ is even, $d_1$ and $d_2$ are positive, $d_3$ is negative. So even $k$ values give saddle points and odd values give maxima?

8. Oct 30, 2013

### Dick

Almost right, I assume you want $4 cos k \pi$ in the second row, I'll take that to be a typo. And it gets a little blurry what you are doing after that, but if k is even then, yes, you have mixed signs, so it's a saddle point. Why do you think it's different if k is odd?

9. Oct 30, 2013

### MuIotaTau

Oops, yes, sorry, a simple typo. $d_1$, the first determinant, is $2cosk\pi$. $d_2$ is $8 (cos k\pi)^2$. $d_3$ is $-8 (cosk\pi)^3$. So when $k$ is odd, the cosines evaluate to negative one. This makes $d_1$ negative, $d_2$ stays positive, and $d_3$ becomes positive.

Which makes them saddle points as well.

Oops.

It's amazing what simply trying to explain your work can do, you know? Thanks for sticking with me the whole way through, I truly appreciate it. We can consider this problem solved!

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted