Multivariable Critical Points Calculator

Solve ∇f = 0 and classify every point with the discriminant D, minima, maxima, saddles.

Multivariable Critical Points Calculator

Critical Points in Two Variables

A surface z = f(x, y) is flat, momentarily horizontal, wherever both partial derivatives vanish: ∇f = 0 i.e. fₓ = 0 and f_y = 0 simultaneously. These critical points are the surface's candidate peaks, pits, and passes, and unlike the one-variable story, the third possibility is generic: a saddle maximum along one direction and minimum along another, like a mountain pass. Classification is the job of the second derivative test via the discriminant

D = fₓₓ·f_yy − (fₓ_y)²: D > 0, fₓₓ > 0 → local min; D > 0, fₓₓ < 0 → local max; D < 0 → saddle; D = 0 → test silent

D is the determinant of the Hessian matrix the surface's curvature bookkeeping, and the sign conditions are asking whether the surface curves the same way in every direction (extremum) or disagrees with itself (saddle).

How to Use This Calculator

Enter f(x, y). The calculator computes the gradient and all second partials symbolically, then solves the system fₓ = 0, f_y = 0 by multi-start Newton iteration across a grid of initial guesses, the robust way to find every critical point, not just one, deduplicates, and classifies each by D. The plot shows the two nullcline curves (where fₓ = 0 or f_y = 0); critical points are exactly their intersections, marked teal (minima), indigo (maxima), and red (saddles).

Worked Example

The default f = x³ − 3x + y². Gradient: fₓ = 3x² − 3, f_y = 2y. Setting both to zero: x = ±1, y = 0, two critical points. Second partials: fₓₓ = 6x, f_yy = 2, fₓ_y = 0, so D = 12x:

At (1, 0): D = 12 > 0, fₓₓ = 6 > 0 → local minimum (f = −2). At (−1, 0): D = −12 < 0 → saddle point (f = 2)

The x-slice explains it: x³ − 3x has its familiar one-variable min at x = 1 and max at x = −1; adding y² cups every slice upward in y. Where both directions agree (x = 1): a true pit. Where they disagree (x = −1: max in x, min in y): the saddle. Two-variable classification is exactly this direction-by-direction negotiation, formalized by D.

Why the Cross Term Matters

Students often ask why D isn't just "fₓₓ and f_yy agree in sign." The fourth chip answers: f = x⁴ + y⁴ − 4xy has fₓ_y = −4, and at the origin fₓₓ = f_yy = 0 with D = −16, a saddle detectable only through the cross term. The surface curves upward along the axes but plunges along the diagonal y = x's perpendicular; the mixed partial is what sees diagonal behavior. (That surface's true minima sit at (1, 1) and (−1, −1), found by the calculator, with the origin's saddle between them, a double-well landscape, the standard cartoon of phase transitions and of neural-network loss surfaces.) Axis-only curvature checks miss saddles; D never does.

Common Mistakes to Avoid

  • Solving fₓ = 0 and f_y = 0 separately, not simultaneously. A critical point must kill both partials at the same (x, y), the intersection of the nullclines, not their union. The plot renders this distinction literally.
  • Classifying with fₓₓ alone. fₓₓ > 0 with D < 0 is still a saddle. The one-variable reflex (second derivative positive = min) needs D's permission first.
  • Reading D = 0 as "degenerate = saddle" or "= extremum." Silence means silence: x⁴ + y⁴ (min), −x⁴ − y⁴ (max), and x³ + y³ (neither) all have D = 0 at the origin. Higher-order analysis or direct inspection decides.
  • Trusting one starting guess to find all points. Nonlinear gradients hide solutions; single-shot solvers report one and imply it's unique. Multi-start search (as here) or algebraic completeness arguments are required for "all critical points" claims.

Real-World Applications

Critical point analysis of surfaces is the mathematics of stability and equilibrium. Chemistry's potential energy surfaces: minima are stable molecules, saddle points are transition states and the saddle's height above the reactant minimum is the activation energy, reaction rates are literally computed from this page's classification. Physics reads phase transitions off double-well potentials (fourth chip); structural engineers certify equilibria of elastic systems by requiring positive-definite Hessians (D > 0 with fₓₓ > 0, scaled up to many variables).

Machine learning lives on high-dimensional versions: loss landscapes are surfaces whose minima are trained models, and the discovery that saddle points (not local maxima) dominate high-dimensional criticality reshaped optimizer design, gradient descent stalls near saddles precisely because ∇f ≈ 0 there. Economics finds Nash equilibria and welfare optima as critical points of payoff surfaces, and geographers' actual mountain passes are the saddle points of elevation functions, the hiking-map intuition this entire subject borrows.

Frequently Asked Questions

Are local extrema here automatically global?

No, x³ − 3x + y² has a local min at (1, 0) yet plunges to −∞ as x → −∞. Global claims need boundedness arguments (coercivity: f → ∞ in all directions) or a compact domain with boundary analysis, the 2D analogue of endpoint checking.

What replaces the "candidate table" from closed intervals?

On a closed bounded region: interior critical points + a full analysis of the boundary (often via Lagrange multipliers since a boundary is a constraint curve), then compare f values. Same extreme value theorem, one dimension up.

Why do the nullclines in the plot cross exactly at critical points?

The teal-marked curve fₓ = 0 collects points flat in the x-direction; f_y = 0 flat in y. Flat in both = critical, so intersections are precisely the critical set, the graphical version of "solve simultaneously," and a quick visual census of how many points exist.

How does this extend to three or more variables?

∇f = 0 becomes n equations; classification reads the Hessian's eigenvalues: all positive → min, all negative → max, mixed signs → saddle (with flavors). D in 2D is shorthand for that eigenvalue analysis, det and trace encode the two eigenvalues' signs.

What is a degenerate critical point, concretely?

One where the Hessian has determinant zero, the surface is flat to second order in some direction, and behavior is decided by higher terms. Monkey saddles (three valleys), flat troughs (a whole line of minima, like f = (x − y)²), and quartic bottoms all live here.

Can the multi-start search miss a critical point?

If it lies far outside the start grid or has a tiny basin of attraction, yes, numerical completeness is heuristic. The nullcline plot is the safety net: an intersection without a marker signals a missed point (rerun mentally centered there, or solve that region by hand).