Second partial derivative test
Functions of two variables
Define D(x, y) to be the determinant
of H. Finally, suppose that (a, b) is a critical point of f (that is, fx(a, b) = fy(a, b) = 0). Then the second partial derivative test asserts the following:
- If and then is a local minimum of f.
- If and then is a local maximum of f.
- If then is a saddle point of f.
- If then the second derivative test is inconclusive, and the point (a, b) could be any of a minimum, maximum or saddle point.
Note that other equivalent versions of the test are possible. For example, some texts may use the trace fxx + fyy in place of the value fxx in the first two cases above. Such variations in the procedure applied do not alter the outcome of the test.
Functions of many variables
For a function f of more than two variables, there is a generalization of the rule above. In this context, instead of examining the determinant of the Hessian matrix, one must look at the eigenvalues of the Hessian matrix at the critical point. The following test can be applied at any critical point (a, b, ...) for which the Hessian matrix is invertible:
- If the Hessian is positive definite (equivalently, has all eigenvalues positive) at (a, b, ...), then f attains a local minimum at (a, b, ...).
- If the Hessian is negative definite (equivalently, has all eigenvalues negative) at (a, b, ...), then f attains a local maximum at (a, b, ...).
- If the Hessian has both positive and negative eigenvalues then (a, b, ...) is a saddle point for f (and in fact this is true even if (a, b, ...) is degenerate).
In those cases not listed above, the test is inconclusive.
Note that for functions of two or more variables, the determinant of the Hessian does not provide enough information to classify the critical point, because the number of jointly sufficient second-order conditions is equal to the number of variables, and the sign condition on the determinant of the Hessian is only one of the conditions. Note also that this statement of the second derivative test for many variables also applies in the two-variable and one-variable case. In the latter case, we recover the usual second derivative test.
In the two variable case, and are the principal minors of the Hessian. The first two conditions listed above on the signs of these minors are the conditions for the positive or negative definiteness of the Hessian. For the general case of an arbitrary number n of variables, there are n sign conditions on the n principal minors of the Hessian matrix that together are equivalent to positive or negative definiteness of the Hessian: for a local minimum, all the principal minors need to be positive, while for a local maximum, the minors with an odd number of rows and columns need to be negative and the minors with an even number of rows and columns need to be positive. See Hessian matrix#Bordered Hessian for a discussion that generalizes these rules to the case of equality-constrained optimization.
Geometric interpretation in the two-variable case
|This section does not cite any references or sources. (April 2013)|
Assume that all derivatives of f are evaluated at (a, b), and that the values of the first derivatives vanish there.
If then . If and have different signs, then one must be positive and the other must be negative. Thus the concavities of the x cross section (the yz trace) and the y cross section (the xz trace) are in opposite direction. This is clearly a saddle point.
If then , which implies that and are the same sign and sufficiently large. For this case the concavities of the x and y cross sections are either both up if positive, or both down if negative. This is clearly a local minimum or a local maximum, respectively.
This leaves the last case of D < 0 — so — and and having the same sign. The geometric interpretation of what is happening here is that since is large it means the slope of the graph in one direction is changing rapidly as we move in the orthogonal direction and overcoming the concavity of the orthogonal direction. So for example, let's take the case of all second derivatives are positive and (a,b) = (0,0). In the case of D > 0 it would mean that any direction in the xy plane we move from the origin, the value of the function increases--a local minimum. In the D < 0 case ( sufficiently large), however, if we move at some direction between the x and y axis into the second quadrant, for example, of the xy plane, then despite the fact that the positive concavity would cause us to expect the value of the function to increase, the slope in the x direction is increasing even faster, which means that as we go left (negative x-direction) into the second quadrant, the value of the function ends up decreasing. Additionally, since the origin is a stationary point by hypothesis, we have a saddle point.
To find and classify the critical points of the function
we first set the partial derivatives
equal to zero and solve the resulting equations simultaneously to find the four critical points
- and .
In order to classify the critical points, we examine the value of the determinant D(x, y) of the Hessian of f at each of the four critical points. We have
Now we plug in all the different critical values we found to label them; we have
Thus, the second partial derivative test indicates that f(x, y) has saddle points at (0, −1) and (1, −1) and has a local maximum at since . At the remaining critical point (0, 0) the second derivative test is insufficient, and one must use higher order tests or other tools to determine the behavior of the function at this point. (In fact, one can show that f takes both positive and negative values in small neighborhoods around (0, 0) and so this point is a saddle point of f.)