## Directional Derivatives Part 3: Is it a max, min, or saddle point?!

### May 18, 2010

Last time, we noticed that when at some point we have that one of two things happens: either there’s a max or min, or there’s a saddle point. So, I guess, that’s kind of three things. Okay, three things can happen: max, min, or saddle point. Let’s take a look at these.

Our first function is the function .

It kind of looks like a big hammock! Okay, now, let’s note that , and therefore is equal to zero exactly when its components are: we, therefore, have that at the point , the gradient is zero. This means we have to have something happening at this point! Can you see what it is? That’s right, kiddo, it’s a minimum.

What’s happening here? Well, let’s take a hint from two variable calculus: what happens when a point has a derivative of zero, and its second derivative is concave up? That’s right, it’s a minimum. Can we do the same sort of thing here? Well, maybe! But we have a number of second derivatives. Specifically, we have these:

which look like what they are: we begin with the first, which is the second derivative with respect to y and then to x. To take this partial, we first take the partial with respect to x, and then we take the partial of *that* derivative with respect to y. The others are computed similarly, with the last two being with respect to x and then x again, and with respect to y and then with respect to y again. So, what do these mean?

Well, if we pick out just one (let’s say, for the sake of it, we pick out , then we have the sort of ordinary concavity interpretation: in the x-direction on the graph, we have a concave upwards if this is positive and concave downwards if it is negative. Similarly for the second partial . The only confusing one should be the one where we take the derivative with respect to x and then with respect to y. For this, there is not an easy interpretation (or, at least, one does not come to me immediately), but this will turn out not to matter so much.

In fact, we need to remember only *three *second partial derivatives. It is a relatively well-known theorem that for nice functions the second mixed partials (that is, and ) are equivalent! Kind of neat, right? I may write more on this theorem later, but for now let’s assume it.

Now, let’s look at our function above. What can we say about the second derivatives at the point ? Let’s compute them!

Compute for yourself that these are correct, and that the mixed partials are actually equivalent. In this case, there is nowhere to plug in the point , but in general there will be.

We notice a few things: at the point , we have the graph is concave up in the x and y directions. We can intuitively see what this means: the surface will look like a right-side-up bowl at , and, in fact, that’s what it kind of looks like!

Awesome. Let’s look at another function. This time, it’s going to be .

In this case, we have , and so the point where this is 0 is going to be . Okay, let’s take second derivatives!

Now, think about it: the second partials in the x-direction tell us the graph is concave up, but the second partials in the y-direction tell us the graph is concave down. So what should we expect? Think about it for a second, but you should come up with a picture that looks like a saddle. This is where the term comes from! Look at the picture and see if you can see the concavity working.

The actual theorem for this is not so much different. First, let’s make up a formal thing that we can put our second partial derivatives in! It’ll kind of be like a little storage box. We’ll call this **the hessian matrix** after a mathematician who was pret cool. The hessian matrix looks like this:

Obviously, this is just a formal object with no meaning if we have no function to apply the derivatives to, but this is an easy way to show what the hessian looksl ike.

**Theorem: **At points where , if the hessian of the function is positive, then there is either a maximum or minimum at that point. If the hessian of the function is negative, then it is a saddle point.

Without going into too much detail of the proof, let’s just note *why *it works; and, in fact, we’ve already kind of seen why it works! Let mean “second partial with respect to x and then y”, and mean “second partial with respect to x and then x, and so on. The hessian’s determinant is then . Take the determinant of it yourself if you don’t believe me!

Now, let’s note that is always non-negative (positive or zero). Suppose that ONLY ONE of and is negative; then the entire determinant is negative (do you see why?) and therefore we have a saddle point. This was that thing that we talked about above on the second function: one direction is concave up, the other is concave down. If both are the same sign, then we have that both are either concave up or concave down, and this will usually give us a positive value altogether (since we usually have the product of the second partials in the same direction is larger than the square of the mixed partial; this is something I’m not sure of, and need to prove to myself at some point! If anyone has a counterexample, please comment!).

So say we get a positive determinant for our hessian. We know that this is either a max or a min, so how do we know which it is? Well, it’s easy! We did it for our first problem: if both second non-mixed partials are positive (that is, concave up) then there is a minimum at this point. If they are both negative (that is, concave down), then there is a maximum at this point!

So, to sum up, we need to just do a few things to check for relative max and mins and saddle points on a surface:

- Find out where . These correspond to “critical points.”
- Construct the hessian matrix.

- If the hessian is negative, the graph has a saddle point.
- If the hessian is positive, then the graph has a max or min.
- If the hessian is positive, then if and are both positive, then the surface has a relative minimum. If they are both negative, then the surface has a relative maximum.

Note that if the hessian or both of the non-mixed partials are equal to 0, we can’t say very much about the graph at that point in terms of max, min, and saddle points. In that case, graphical analysis will tell us a little more information.

There is a little bit more, though. Remember in calculus how in order to see if something was a max or a min on a certain domain, we’d also need to try the endpoints? Well, in this case, there could be many “endpoints” — say, for example, we want to check out our surfaces above, but only at points that are on the inside or the boundary of the unit cylinder; then there are many points to check on the boundary of the cylinder! Fortunately, there’s a really clever way to do this that we’ll talk about next time. For now, let’s do some exercises.

**Exercises:**

- Let . Find all relative max, min, and saddle points.
- Let . Find all relative max, min, and saddle points.
- Let . Find all relative max, min, and saddle points.

[**Note**. For some reason, in the previous version of this post I listed the matrix above as the “Jacobian” — this was not correct, though the jacobian is another kind of matrix that will come in handy eventually!]

dude that was so clear.

You probably meant Hessian Matrix and not Jacobian, no?

Your statement of a negative determinant of a matrix for a saddle point is only valid for 2×2 matrices.

It follows directly from the theorem that for a saddle point at x*, y*, a matrix cannot be either positive definite or negative definite. Hence, the 2nd order principal minor of the matrix has to be non-zero and further for a 2×2 matrix always it follows that it is negative.

I have a counter example for your fxx*fyy > fxy^2:

Try it out on f(x,y) = xy

Your Hessian is [0 1; 1 0] s.t. |H| = -1

What is missing in the proof is that the Hessian is positive definite. You can start with the higher dimension Taylor polynomial, use the gradient equal to zero at our critical point and that t is sufficiently small to show that the gradient being positive definite forces f(x*) to be a local minimum.