Hessian matrix (second derivative test)

The Hessian matrix of a scalar function of several variables f:RnRf: \R^n \to \R describes the local curvature of that function. By taking the determinant of the Hessian matrix at a critical point we can test whether that point is a local maximum, minimum, or saddle point. The Hessian matrix is defined as:

Hessian(f)=(2fx122fx1x22fx1xn2fx2x12fx222fx2xn2fxnx12fxnxn2fxn2). \mathrm{Hessian}(f) = \begin{pmatrix} \frac{\partial^2 f}{\partial x_1^2} & \frac{\partial^2 f}{\partial x_1 \partial x_2} & \cdots & \frac{\partial^2 f}{\partial x_1 \partial x_n} \\ \frac{\partial^2 f}{\partial x_2 \partial x_1} & \frac{\partial^2 f}{\partial x_2^2} & \cdots & \frac{\partial^2 f}{\partial x_2 \partial x_n} \\ \vdots & \vdots & \ddots & \vdots \\ \frac{\partial^2 f}{\partial x_n \partial x_1} & \frac{\partial^2 f}{\partial x_n \partial x_n} & \cdots & \frac{\partial^2 f}{\partial x_n^2} \\ \end{pmatrix}.

In the case of a function of two variables:

Hessian(f(x,y))=(fxxfxyfyxfyy). \mathrm{Hessian}(f(x, y)) = \begin{pmatrix} f_{xx} & f_{xy} \\ f_{yx} & f_{yy} \end{pmatrix}.
Note

fxf_x is one way to write the partial derivative of the function ff with respect to xx. It means the same thing as fx\frac{\partial f}{\partial x}.

Interpreting the Hessian determinant in two variables

The determinant of the Hessian matrix of a function ff at a critical point p\mathbf p can tell us whether p\mathbf p is a local minimum, maximum, or saddle point. Let the Hessian determinant at a point x1,y1x_1, y_1 be H=Det(Hessian(f)(x1,y1))H = \mathrm{Det}(\mathrm{Hessian}(f)|_{(x_1, y_1)}):

  • If H>0H>0 and both fx(x1,y1)>0f_x(x_1, y_1) > 0 and fy(x1,y1)>0f_y(x_1, y_1) > 0, then (x1,y1)(x_1, y_1) is a local minimum.

  • If H>0H>0 and both fx(x1,y1)<0f_x(x_1, y_1) < 0 and fy(x1,y1)<0f_y(x_1, y_1) < 0, then (x1,y1)(x_1, y_1) is a local maximum.

  • If H<0H<0 then (x1,y1)(x_1, y_1) is a saddle point.

  • If H=0H=0 then the test is inconclusive.