Hessian Matrix Calculator
Enter a function and point.

What Is the Hessian Matrix?

The Hessian matrix collects all second-order partial derivatives of a scalar-valued function of multiple variables. For a function fx,y, the Hessian is

H=f∂x^2x2fx yxyfy xyxf∂y^2y2

This matrix reveals how curvature behaves near a specific point. When the Hessian is positive definite, the function has a local minimum. If it is negative definite, the point is a local maximum. Indefinite Hessians indicate saddle points. The Hessian thus plays a central role in optimization and analysis.

Symbolic Differentiation Approach

The calculator uses math.js to symbolically differentiate the user-provided function. After parsing f, the script computes xxf, xyf, and yyf. Because mixed partial derivatives commute for smooth functions, xyf equals yxf. The algorithm evaluates these derivatives at the chosen point to fill in the matrix.

Algorithm Robustness

The parser accepts standard mathematical syntax, including exponents and common functions such as sin, cos, and exp. If the expression fails to parse, the calculator presents a helpful message. For well-behaved input, the derivatives are exact, providing a reliable alternative to numerical differentiation, which may suffer from rounding errors or step-size issues.

Why the Hessian Matters

Second derivatives capture curvature, which governs how gradients change in multidimensional space. In machine learning, the Hessian influences optimization algorithms like Newton's method. In physics, it describes stability of equilibrium solutions. In differential geometry, the Hessian defines the second fundamental form, connecting calculus to surface curvature. By easily computing this matrix, you can explore how functions behave beyond simple slopes.

Using the Tool

Enter a function involving x and y, specify the evaluation point, and press Compute Hessian. The entries appear as numerical values with four decimal digits. Try varying the point to see how the matrix changes across the surface defined by your function. Experimentation will build intuition for convexity, saddle points, and other features.

Related Calculators

Runge-Kutta ODE Solver - Step Through Differential Equations

Perform a single Runge-Kutta 4th order step for first-order ODEs.

runge kutta ode solver RK4 calculator differential equation

Fast Fourier Transform Calculator - Compute Spectra Quickly

Apply the Cooley-Tukey FFT to a sequence of numbers to reveal frequency components.

FFT calculator fast fourier transform

Inverse Laplace Transform Calculator - Return to the Time Domain

Decompose simple rational expressions and compute the inverse Laplace transform.

inverse Laplace transform calculator control theory differential equations