Hessian Matrix Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

What is the Hessian matrix?

The Hessian matrix is a square matrix that collects all second-order partial derivatives of a scalar-valued function of several variables. It summarizes how the function curves in different directions near a point, and it is a core tool in multivariable calculus, optimization, and numerical analysis.

In this calculator we focus on a function of two real variables, written as f(x, y). At a point (x, y), the 2×2 Hessian matrix is

H = fxx fxy fyx fyy

Here:

If the function is sufficiently smooth (twice continuously differentiable), then f_xy = f_yx, so the Hessian is symmetric.

How to use the Hessian Matrix Calculator

This tool evaluates the Hessian matrix of f(x, y) at a single point and applies the second-derivative test to classify that point as a local minimum, local maximum, saddle point, or inconclusive. To use it:

  1. Enter the function in the field labeled Function f(x, y).
  2. Enter the point where you want to evaluate the Hessian:
    • Type the x coordinate in the corresponding box.
    • Type the y coordinate in the corresponding box.
  3. Click the compute button to calculate the second partial derivatives and build the Hessian matrix at that point.
  4. Read the output:
    • The calculator shows the Hessian entries f_xx, f_xy, f_yx, and f_yy evaluated at your point.
    • It also computes the determinant of the Hessian and uses the second-derivative test to classify the point.

This workflow is useful whenever you need to inspect the local curvature of a surface, check the nature of a critical point in homework or research, or verify hand calculations.

Input format and supported syntax

The function field accepts a standard, calculator-style syntax for f(x, y). While the exact parser may vary by implementation, the following conventions are typically supported:

Some example inputs that illustrate typical usage are:

Coordinates should be entered as real numbers. For instance, you might use 0, 1.5, -2, or 3.14159. If the function is not defined at the chosen point (for example, division by zero), the calculator may return an error or an undefined result.

The second-derivative test in two variables

When analyzing critical points of f(x, y) (points where the gradient is zero), the Hessian plays the role that the second derivative plays in single-variable calculus.

Suppose that at a specific point you have the Hessian

H = [[a, b], [b, c]],

where a = f_xx, b = f_xy = f_yx, and c = f_yy evaluated at that point. Define the determinant

D = a*c - b^2.

The classical second-derivative test states:

The calculator automatically computes a, b, c, and D, then applies this decision rule to label the point.

Worked example

Consider the quadratic function

f(x, y) = x^2 + x*y + y^2.

We will compute the Hessian at the point (0, 0) and classify that point using the second-derivative test.

1. First partial derivatives

2. Second partial derivatives

3. Form the Hessian

At any point (x, y), the Hessian is

H(x, y) = [[2, 1], [1, 2]].

Because this particular function is quadratic, the Hessian is constant and does not depend on the point. At (0, 0) you have

H(0, 0) = [[2, 1], [1, 2]].

4. Compute the determinant and classify

In this case, a = 2, b = 1, and c = 2. The determinant is

D = a*c - b^2 = 2*2 - 1^2 = 4 - 1 = 3.

This satisfies D > 0 and a = 2 > 0, so by the second-derivative test the point (0, 0) is a local minimum of f(x, y). In fact, for this positive-definite quadratic function, (0, 0) is also the unique global minimum.

If you enter this function and the point (0, 0) into the calculator, it should output the Hessian matrix [[2, 1], [1, 2]], report D = 3, and classify the point as a local minimum.

Interpreting the results

The calculator output usually contains:

You can interpret these pieces as follows:

Keep in mind that the second-derivative test assumes you are evaluating at a critical point where the gradient is zero. If you feed in a point that is not critical, the classification still describes the local curvature, but it does not directly say whether that point is an extremum of the function.

Comparison: different Hessian configurations

The table below summarizes the main behaviors the calculator may report, assuming you are at a critical point.

Condition on Hessian Determinant D Typical classification Geometric picture
f_xx > 0, D > 0 Positive Local minimum Surface shaped like a bowl, curving upward in all directions.
f_xx < 0, D > 0 Positive Local maximum Surface shaped like an upside-down bowl, curving downward in all directions.
D < 0 Negative Saddle point Surface rising in some directions and falling in others.
D = 0 Zero Inconclusive Higher-order terms determine the behavior; more analysis is required.

Typical use cases

This Hessian matrix calculator is especially helpful for:

By automating the derivative calculations, the tool lets you focus on interpreting the results, rather than getting bogged down in algebra.

Assumptions and limitations

Like any symbolic or numeric calculator, this tool operates under a set of assumptions and has some limitations you should keep in mind:

When results look surprising, double-check that your function is entered correctly, that the point lies in the domain of the function, and that you are interpreting the classification in the context of a critical point.

Summary

The Hessian matrix condenses second-order information about a function of two variables into a compact 2×2 array of partial derivatives. By computing the Hessian at a point and examining its determinant and entries, you can infer whether the function is locally minimized, maximized, or has saddle-like behavior there. This calculator streamlines that process for functions of the form f(x, y), helping you verify calculations, explore examples, and build intuition about curvature and optimization in several variables.

Enter a function and point.

Embed this calculator

Copy and paste the HTML below to add the Hessian Matrix Calculator for f(x, y) – Classify Minima, Maxima, Sa... to your website.