Hessian Matrix and Critical Point Calculator

Enter a scalar function of one, two, or three variables. The calculator builds its exact symbolic gradient and Hessian, searches a bounded region for critical points, and applies the Hessian eigenvalue test—all locally in your browser.

Enter the function

Use ^ for powers and * between variables. Supported functions include sin, cos, exp, ln, and sqrt.

Use 1–3 distinct single-letter variables.

The same closed interval is searched along every variable axis.

Enter one coordinate per variable, such as 1, 0.

Try an example

Keyboard shortcut: Ctrl/ + Enter.

Advertisement

Hessian and critical points

Symbolic gradient and Hessian
The symbolic result will appear here.
Critical points found in the search region
Critical-point results will appear here.
Specific point check
Enter an optional point to test it directly.

Calculation steps and classification logic

The derivative and classification steps will appear here.

Calculator methodology and limits

Developed and reviewed by
Starlight Robotics calculator team
Last reviewed
Symbolic method
First partial derivatives form the gradient; differentiating them again in variable order forms the Hessian.
Search method
Damped Newton iterations from a grid of 25, 81, or 125 starting points for one, two, or three variables.
Input limits
One scalar expression under 300 characters, one to three variables, finite bounds between −1,000,000 and 1,000,000, and at most 40 reported points.
Privacy
The function, bounds, coordinates, and results stay in your browser; no solving API receives them.

Numerical-search limit: a bounded multi-start search is evidence, not proof of completeness. It may miss critical points of highly oscillatory, flat, singular, or ill-conditioned functions. The Hessian test is also inconclusive when an eigenvalue is zero or numerically near zero.

How to use the Hessian calculator

  1. Enter a scalar function and list its variables in the row and column order you want.
  2. Choose common lower and upper bounds. The calculator numerically searches that interval along every variable axis.
  3. Optionally enter a known point to check whether its gradient is approximately zero and, if so, classify it.
  4. Select Calculate Hessian, then inspect the exact matrix, located points, eigenvalues, and derivative steps.

Hessian matrix formula

For a twice-differentiable scalar function \(f(x_1,\ldots,x_n)\), the Hessian is the square matrix of second partial derivatives:

\[H_f(\mathbf x)=\left[\frac{\partial}{\partial x_j}\left(\frac{\partial f}{\partial x_i}\right)\right]_{n\times n}.\]

A critical point satisfies \(\nabla f=\mathbf 0\) when the gradient exists. At such a point, a positive-definite Hessian gives a strict local minimum, a negative-definite Hessian gives a strict local maximum, and an indefinite Hessian gives a saddle point. This is the multivariable second derivative test described in OpenStax Calculus, Volume 3, section 4.7.

Classification examples

Local minimum

For \(f=x^2+y^2\), the only critical point is \((0,0)\). The Hessian eigenvalues are \(2,2\), so both directions curve upward.

Local maximum

For \(f=-x^2-y^2\), the Hessian eigenvalues are \(-2,-2\), so the critical point at the origin is a strict local maximum.

Saddle point

For \(f=x^2-y^2\), the eigenvalues \(2,-2\) have opposite signs. The surface curves up in one direction and down in another.

Degenerate Hessian

For \(f=x^4+y^4\), the origin is a minimum but the Hessian there is zero. The second derivative test alone is inconclusive, so higher-order reasoning is required.

Hessian matrix and critical point FAQs

What is a Hessian matrix?

It is the square matrix containing every second-order partial derivative of a scalar-valued function. Its row and column order follows the variables you enter.

How does the calculator find critical points?

It runs damped Newton iterations from a fixed grid of starting locations inside your bounds and keeps distinct finite points where the gradient norm is at most \(10^{-7}\).

Can the search miss a critical point?

Yes. Numerical root finding is not a completeness proof. Try narrower or shifted bounds, test a known point directly, and use analytic reasoning for flat, oscillatory, singular, or difficult functions.

How are minima, maxima, and saddle points classified?

Positive Hessian eigenvalues indicate a local minimum, negative eigenvalues indicate a local maximum, and mixed signs indicate a saddle point. A zero or near-zero eigenvalue makes this test inconclusive.

What does “degenerate Hessian” mean?

It means the Hessian has a zero or numerically near-zero eigenvalue. The point can still be a minimum, maximum, saddle, or neither; higher-order terms or another argument are needed.

Does the search find nondifferentiable critical points?

No. It searches for stationary points where the gradient exists and is approximately zero. Cusps, corners, discontinuities, and other points where a first derivative does not exist require separate domain analysis.

Why might mixed partial derivatives look different?

Equivalent symbolic expressions can have different forms. For sufficiently smooth functions, the mixed partials are equal even when the calculator’s algebraic formatting does not make that equality visually obvious.

Are points on the search boundary constrained extrema?

No. This tool searches for unconstrained critical points where the full gradient is zero. A boundary optimum that does not have zero gradient requires constrained optimization or endpoint analysis.

Does my input leave the browser?

No. Parsing, differentiation, root searching, and classification run on your device.

Explore more mathematical tools

Explore more tools