332 CHAPTER 18. OPTIMIZATION
12. ∗Let
f (x,y) =
−1 if y = x2,x ̸= 0(y− x2
)2 if y ̸= x2
0 if (x,y) = (0,0)
Show that ∇ f (0,0) = 0. Now show that if (a,b) is any nonzero unit vector, thefunction t→ f (ta, tb) has a local minimum of 0 when t = 0. Thus in every direction,this function has a local minimum at (0,0) but the function f does not have a localminimum at (0,0).
18.3 The Second Derivative TestThere is a version of the second derivative test in the case that the function and its first andsecond partial derivatives are all continuous.
Definition 18.3.1 The matrix H (x) whose i jth entry at the point x is ∂ 2 f∂xi∂x j
(x) is calledthe Hessian matrix. The eigenvalues of H (x) are the solutions λ to the equationdet(λ I−H (x)) = 0.
The following theorem says that if all the eigenvalues of the Hessian matrix at a criticalpoint are positive, then the critical point is a local minimum. If all the eigenvalues of theHessian matrix at a critical point are negative, then the critical point is a local maximum.Finally, if some of the eigenvalues of the Hessian matrix at the critical point are positive andsome are negative then the critical point is a saddle point. The following picture illustratesthe situation.
Theorem 18.3.2 Let f : U → R for U an open set in Rn and let f be a C2 function andsuppose that at some x ∈ U, ∇ f (x) = 0. Also let µ and λ be respectively, the largestand smallest eigenvalues of the matrix H (x). If λ > 0 then f has a local minimum at x.If µ < 0 then f has a local maximum at x. If either λ or µ equals zero, the test fails. Ifλ < 0 and µ > 0 there exists a direction in which when f is evaluated on the line throughthe critical point having this direction, the resulting function of one variable has a localminimum and there exists a direction in which when f is evaluated on the line throughthe critical point having this direction, the resulting function of one variable has a localmaximum. This last case is called a saddle point.
Here is an example.
Example 18.3.3 Let f (x,y) = 10xy+ y2. Find the critical points and determine whetherthey are local minima, local maxima or saddle points.