Hessian Matrix Calculator

Type a function of x, y (and z), and optionally a point, to find its Hessian.

Use x, y and z. Type powers with ^ and functions with brackets: sin(xy), e^(x + y), ln(x), sqrt(x).

Optional: a point such as (1, 0) to evaluate the Hessian there and classify a critical point.

Try

Result

You enteredH[x2−x y+y2+z2]H\left[x^{2} - x\,y + y^{2} + z^{2}\right]

H(0,0,0)=[2−10−120002]\displaystyle H\left(0, 0, 0\right) = \begin{bmatrix} 2 & -1 & 0 \\ -1 & 2 & 0 \\ 0 & 0 & 2 \end{bmatrix}

At the point

local minimum\displaystyle \text{local minimum}

Determinant

det⁡H=6\displaystyle \det H = 6

Determinant at the point

det⁡H(0,0,0)=6\displaystyle \det H\left(0, 0, 0\right) = 6
Show the work
  1. Hessian matrix

    The Hessian collects every second partial derivative: row i, column j is f differentiated by the i-th and then the j-th variable. It describes how the surface bends in every direction.

    Using H=[fxxfxyfyxfyy]H = \begin{bmatrix} f_{xx} & f_{xy} \\ f_{yx} & f_{yy} \end{bmatrix}

    H=[fxxfxyfxzfyxfyyfyzfzxfzyfzz]H = \begin{bmatrix} f_{xx} & f_{xy} & f_{xz} \\ f_{yx} & f_{yy} & f_{yz} \\ f_{zx} & f_{zy} & f_{zz} \end{bmatrix}
  2. Second partial derivatives

    Differentiate each first partial again with respect to each variable. The mixed partials agree (fxy=fyx, …f_{xy} = f_{yx},\ \dots, Clairaut's theorem), so the matrix is symmetric.

    H=[2−10−120002]H = \begin{bmatrix} 2 & -1 & 0 \\ -1 & 2 & 0 \\ 0 & 0 & 2 \end{bmatrix}
  3. Determinant of the Hessian

    The determinant, the product of the eigenvalues.

    det⁡H=6\det H = 6
  4. Hessian at the point

    Substitute (0,0,0)\left(0, 0, 0\right).

    H(0,0,0)=[2−10−120002]H\left(0, 0, 0\right) = \begin{bmatrix} 2 & -1 & 0 \\ -1 & 2 & 0 \\ 0 & 0 & 2 \end{bmatrix}
  5. Leading principal minors (Sylvester's criterion)

    All leading minors positive: positive definite. Alternating −, +, −: negative definite. Otherwise, with a nonzero determinant: indefinite.

    D1=2D2=3D3=6\begin{gathered} D_{1} = 2 \\ D_{2} = 3 \\ D_{3} = 6 \end{gathered}
  6. What the Hessian says

    At a critical point, a positive definite Hessian means a local minimum.

  7. Result

    The Hessian at the point.

    H(0,0,0)=[2−10−120002]H\left(0, 0, 0\right) = \begin{bmatrix} 2 & -1 & 0 \\ -1 & 2 & 0 \\ 0 & 0 & 2 \end{bmatrix}

Worked examples