Notes on the Second Test

If f(x1, . . . , xn) is a real-valued of several real variables, whose second partial at a point at the point p = (a1, . . . , an) exist, then the Hessian of f at p is the matrix of second partials     ∂11f(p) ∂12f(p) ··· ∂1nf(p) fx1x1 (p) fx1x2 (p) ··· fx1xn (p)  ∂21f(p) ∂22f(p) ∂2nf(p)  fx x (p) fx x (p) fx x (p)    2 1 2 2 2 n  H =  . .. .  =  . .. .  .  . . .   . . . 

fxnx1 (p) fxnx2 (p) ··· fxnxn (p) fxnx1 (p) fxnx2 (p) ··· fxnxn (p) If the second partials are continuous in a ball around p, then mixed partials are equal, so H is a symmetric real matrix. 4 2 0 Example 1. If f(x, y, z) = x2y + y2z and p = (1, 2, 3), then H = 2 6 4 . (Check!) 0 4 0

Linear Algebra Terminology/Facts. (1) An n × n real matrix has n special associated values, complex numbers called eigenvalues. (Definition omitted.) An n×n real has real eigenvalues. The eigenvalues of a are its diagonal entries. (2) A real symmetric matrix is positive definite if its eigenvalues are positive. It is positive semidefinite if its eigenvalues are positive or zero. It is negative definite if its eigenvalues are negative. It is negative semidefinite if its eigenvalues are negative or zero. It is indefinite if it has at least one positive eigenvalue and at least one negative eigenvalue.

Second . Assume p is a critical point of f, and the of f at p has continuous second partials in a ball around p. • If H is positive definite, then f has a local min at p. • If H is negative definite, then f has a local max at p. • If H is indefinite, then f has a saddle at p. • If H is semidefinite, then the test fails. There are some quick tests for when a matrix H satisfies these conditions. The principal minors     fx1x1 fx1x2 fx1x3   fx1x1 fx1x2 for the Hessian H are H1 = fx1x1 ,H2 = ,H3 = fx2x1 fx2x2 fx2x3  , ETC. fx2x1 fx2x2 fx3x1 fx3x2 fx3x3 • H is positive definite if the of all principal minors, det(H1), det(H2),... are positive. [This is a theorem, not a definition.] • H is negative definite if the determinants of the principal minors have alternating signs, −, +, −, +, ··· (starting with −). [A theorem.] • IF H = H2 is a 2 × 2 matrix, then H is indefinite if det(H) < 0. [A theorem.] • IF H is a 2 × 2 matrix, and det(H) = 0, then H is semidefinite, and the 2nd Derivative Test fails. 1 2 Exercise. Find and classify the critical points of f(x, y, z) = x2 + 2xy + 2xz + 2y2 + 4yz + 3z2.

Solution. ∇f(x, y, z) = h2x + 2y + 2z, 2x + 4y + 4z, 2x + 4y + 6zi. This exists for every point (x, y, z), so the critical points of f are the points p for which ∇f(p) = 0. If you set ∇f = 0, and solve some equations, you find that p = (0, 0, 0) is the only point where ∇f(p) = 0, so it is the only critical point. 2 2 2 The Hessian matrix at p = 0 is H = 2 4 4 . The principal minors are 2 4 6 2 2 2 2 2 H = 2 ,H = ,H = 2 4 4 . 1 2 2 4 3   2 4 6

Their determinants are det(H1) = 2, det(H2) = 4, det(H3) = 8. These are all positive, so H is positive definite. This implies that f has a local minimum at (0, 0, 0).

Test your understanding. Let f(x, y) = cos(x) + y sin(x) − y2. (1) Show that p = (0, 0) and q = (π, 0) are critical points of f.

−1 1  1 −1 (2) Find the Hessians at p and q. You should get H(p) = ,H(q) = . 1 −2 −1 −2

(3) Classify the critical points p and q. (Circle the correct answer or write “Test fails.”)

(a) p is a local max/local min/.

(b) q is a local max/local min/saddle point.