MULTIVARIABLE CALCULUS

Hessian Matrix Calculator

Find the matrix of second partial derivatives of a scalar function, evaluate it at a point, and calculate its determinant with clear working.

MULTIVARIABLE CALCULUS

Enter a scalar function

The Hessian contains every second partial derivative of one scalar function. Variable order sets both matrix rows and columns.

Variable orderUse unique letters other than e; θ / theta is supported.
x^2+3*x*y+2*y^2
Evaluate at a point (optional)Enter every coordinate, or leave all fields empty for a symbolic Hessian.

Use standard notation such as x^2+3*x*y. Supported functions include trigonometric and hyperbolic functions, inverse trig, exp, ln, log10, sqrt, and abs. Angles use radians.

Ctrl + Enter to calculate
Try an example
Your Hessian will appear hereEnter a function, then calculate to see its second partial derivatives and Hessian determinant.
SECOND-ORDER MULTIVARIABLE CALCULUS

What is a Hessian matrix?

The Hessian matrix is the square matrix of all second-order partial derivatives of a scalar-valued function. It describes how the function’s gradient changes from point to point and is a central tool for studying local curvature and classifying stationary points.

Hf(x)=[∂2f∂xi ∂xj]i,j=1nH_f(\mathbf{x})=\left[\frac{\partial^2 f}{\partial x_i\,\partial x_j}\right]_{i,j=1}^{n}

Take the gradient first, then differentiate each gradient component with respect to each variable. The resulting matrix has one row and one column for every independent variable.

The calculator uses a safe symbolic differentiation engine for arithmetic, powers, parentheses, supported trigonometric and hyperbolic functions, exponentials, logarithms, square roots, and absolute value. Trigonometric functions use radians. A classical Hessian requires the relevant second partial derivatives to exist.

How to calculate the Hessian

  1. Choose the independent variables in a fixed order, such as x, y, z. The same order determines the Hessian’s rows and columns.
  2. Enter one scalar-valued function, for example x^2+3*x*y+2*y^2. Use explicit multiplication for clarity.
  3. Optionally enter a numerical value for every variable. Leave all point fields empty to keep the Hessian symbolic.
  4. Differentiate the function once with respect to each variable to form the gradient.
  5. Differentiate each gradient component with respect to every variable. These second partial derivatives populate the Hessian matrix.
  6. For an evaluation point, substitute its coordinates into the function, gradient, and Hessian, then calculate the Hessian determinant.

Worked Hessian examples

Find the Hessian of f(x, y) = x² + 3xy + 2y².

The first partial derivatives are fₓ = 2x + 3y and fᵧ = 3x + 4y. Differentiate each of these with respect to x and y.

H_f(x, y) = [[2, 3], [3, 4]] and det(H_f) = −1. The Hessian is indefinite because its determinant is negative. At a stationary point of this quadratic, that curvature pattern corresponds to a saddle rather than a local maximum or minimum.

Find the Hessian of f(x, y) = x² + y² at (1, 2).

The gradient is (2x, 2y), and differentiating again gives a constant diagonal matrix.

H_f = [[2, 0], [0, 2]], det(H_f) = 4, and f(1, 2) = 5. Both principal directions curve upward equally. The Hessian is positive definite at this point.

Find the Hessian of f(x, y, z) = x²y + z³.

Compute the second partial derivatives in the variable order x, y, z.

H_f = [[2y, 2x, 0], [2x, 0, 0], [0, 0, 6z]]. The matrix includes mixed derivatives such as fₓᵧ = fᵧₓ = 2x when the second partials are continuous.

Using the Hessian to study curvature

The Hessian generalizes the second derivative to several variables. Its quadratic form describes the second-order change in a function near a point. At a stationary point, a positive-definite Hessian is a local-minimum test and a negative-definite Hessian is a local-maximum test. An indefinite Hessian indicates saddle curvature. A zero determinant alone is inconclusive, and definiteness tests must be applied at a stationary point with suitable differentiability.

  • The Hessian is square: A scalar function of n variables has an n × n Hessian, with one row and one column per variable.
  • Off-diagonal entries are mixed partials: Entry (i,j) records the derivative with respect to row variable i of the first partial with respect to column variable j.
  • Smooth functions have symmetric Hessians: If the second partial derivatives are continuous near a point, Clairaut’s theorem gives fₓᵢₓⱼ = fₓⱼₓᵢ.
  • A determinant is not a full classification: In two variables, the Hessian determinant helps classify a stationary point. In higher dimensions, use definiteness or eigenvalue information; det(H) alone is insufficient.

Common Hessian calculation mistakes

  • Changing the variable order between the function and the Hessian labels; rows and columns follow the displayed variable order.
  • Confusing a mixed partial with a first partial; each Hessian entry differentiates twice.
  • Assuming the Hessian determinant alone proves a local maximum or minimum, especially in three or more variables.
  • Applying a stationary-point classification before checking that the gradient is zero.
  • Treating a zero determinant as a complete answer; it makes the usual determinant test inconclusive.
  • Entering degree-mode angles even though calculus trigonometric functions are interpreted in radians.

Hessian matrix calculator FAQ

What does a Hessian matrix calculator find?

It calculates every second partial derivative of a scalar-valued function and places them in a square matrix ordered by the selected variables.

How do I calculate a Hessian matrix?

Find the gradient first, then differentiate each gradient component with respect to each independent variable. The resulting second partials fill the Hessian rows and columns.

Is the Hessian matrix always symmetric?

It is symmetric when the mixed second partial derivatives are continuous near the point. At nonsmooth points or where those conditions fail, equality of mixed partials is not guaranteed.

What does the Hessian determinant tell me?

It is one curvature indicator. In two variables, at a stationary point, its sign helps distinguish a saddle from an extremum. In higher dimensions, the determinant alone does not determine definiteness.

Can I evaluate the Hessian at a point?

Yes. Enter one finite coordinate for every listed variable to see the function value, gradient, numerical Hessian, and determinant at that point.

Can the Hessian classify a local maximum or minimum?

The Hessian can support a second-derivative test at a stationary point. Positive definite indicates a strict local minimum, negative definite a strict local maximum, and an indefinite matrix a saddle. A singular or semidefinite Hessian may be inconclusive.

What is the difference between a Hessian and a Jacobian?

A Jacobian differentiates a vector-valued function once. A Hessian differentiates a scalar-valued function twice and is square because it has one row and column per input variable.

Does the Hessian calculator support trigonometric functions?

Yes. It supports the listed trigonometric and hyperbolic functions, and ordinary trigonometric inputs are in radians.

Related calculus tools