The Hessian and Second Derivative Test

Suppose a function of two variables has zero gradient at a point. Is that point a mountaintop, a valley floor, or a mountain pass? In single-variable calculus, the sign of f′′(x0)f''(x_0) settles the question. But in several variables there is no single number to check. Curvature now varies with direction, and a point can curve upward in one direction while curving downward in another. The Hessian matrix organizes all the second-order information at a point into one object. The algebraic notion of definiteness of that matrix converts a geometric question — local min, max, or saddle? — into a computable linear-algebra question about eigenvalues or leading minors. This matters because most of calculus's practical payoff lives at critical points. Optimizing cost functions, fitting models, finding equilibria in physics and economics, and locating stationary configurations in engineering design all reduce to classifying where the gradient vanishes. The Second Derivative Test is the multivariable engine that does this classification. It plays the same role that f′′f'' plays in one variable, but now built from the full matrix of second partial derivatives rather than a scalar. The big picture is that Taylor's theorem writes ff near a critical point as a constant plus a quadratic form controlled by the Hessian, plus a remainder that vanishes faster than that quadratic. Near the critical point, the local behavior of ff is dictated by the quadratic form. So classifying critical points reduces to classifying quadratic forms as positive definite, negative definite, indefinite, or degenerate. This is the same idea used later when studying constrained optimization via Lagrange Multipliers, where a "bordered Hessian" plays an analogous role. This article gives the precise definition of the Hessian. It states and proves the Second Derivative Test in full generality, via the multivariable Taylor expansion and eigenvalue analysis of symmetric matrices. It works two nontrivial examples, and shows exactly what goes wrong when the test's hypotheses are dropped. Finally, it situates the result among neighboring tools such as Critical Points and Extrema and Clairaut's Theorem on Mixed Partials.

Key takeaways
  • The Hessian Hf(x)H_f(\mathbf{x}) is the symmetric matrix of all second partial derivatives of ff at x\mathbf{x}.
  • At a critical point, Taylor's theorem shows ff is approximated by a quadratic form built from HfH_f.
  • The type of that quadratic form — positive definite, negative definite, indefinite, or degenerate — classifies the critical point.
  • Definiteness can be checked via eigenvalues (all positive = min, all negative = max, mixed signs = saddle) or via leading principal minors (Sylvester's criterion).
  • When the Hessian is singular (a zero eigenvalue), the test is inconclusive and higher-order information is needed.
  • Key idea: near a critical point the graph of ff hugs a quadratic surface shaped by HfH_f, and classifying that quadratic surface classifies the critical point.

Where this lives today

The Hessian test is the workhorse of multivariable optimization: gradient-based numerical methods such as Newton's method and quasi-Newton methods (BFGS) use the Hessian (or approximations to it) both to find critical points and to certify that a computed point is a genuine local minimum, which is essential in machine learning for training loss landscapes and in engineering design optimization. In statistics, the Hessian of the log-likelihood function at the maximum-likelihood estimate gives the (observed) Fisher information matrix, whose inverse approximates the covariance of the estimator. In economics, definiteness of the Hessian of a utility or profit function certifies genuine optimality (concavity/convexity) of consumer or firm behavior at an equilibrium. In differential geometry and topology, Morse theory studies smooth functions whose critical points all have nonsingular ("nondegenerate") Hessians, and uses the number of negative eigenvalues (the Morse index) at each critical point to reconstruct the topology of the underlying manifold from critical point data. In cryptography and computer graphics, curvature computations built from Hessian-like second-derivative data underlie mesh-smoothing algorithms and analysis of surfaces. Finally, the Hessian is the direct forerunner of the bordered Hessian used to classify constrained critical points found via Lagrange Multipliers, where the same definiteness ideas are adapted to a subspace tangent to the constraint surface.

Ask the tutor: How does the bordered Hessian modify this test when the critical point is constrained by Lagrange multiplier equations?

DefinitionHessian matrix and definiteness

Let U⊆RnU \subseteq \mathbb{R}^n be open and let f:U→Rf : U \to \mathbb{R} be a function whose second-order partial derivatives all exist and are continuous on UU (i.e. f∈C2(U)f \in C^2(U)). For x∈U\mathbf{x} \in U, the Hessian matrix of ff at x\mathbf{x} is the n×nn \times n matrix

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

By Clairaut's Theorem on Mixed Partials, since f∈C2(U)f \in C^2(U) the mixed partials are equal, ∂2f∂xi∂xj=∂2f∂xj∂xi\dfrac{\partial^2 f}{\partial x_i \partial x_j} = \dfrac{\partial^2 f}{\partial x_j \partial x_i}, so Hf(x)H_f(\mathbf{x}) is a real symmetric matrix. A symmetric matrix A∈Rn×nA \in \mathbb{R}^{n \times n}, viewed as the quadratic form Q(v)=vTAvQ(\mathbf v) = \mathbf v^{\mathsf T} A \mathbf v, is called:

  • positive definite if Q(v)>0Q(\mathbf v) > 0 for every v≠0\mathbf v \neq \mathbf 0;
  • negative definite if Q(v)<0Q(\mathbf v) < 0 for every v≠0\mathbf v \neq \mathbf 0;
  • indefinite if Q(v1)>0Q(\mathbf v_1) > 0 and Q(v2)<0Q(\mathbf v_2) < 0 for some v1,v2\mathbf v_1, \mathbf v_2;
  • positive (negative) semidefinite if Q(v)≥0Q(\mathbf v) \ge 0 (resp. ≤0\le 0) for all v\mathbf v, with equality possible for some v≠0\mathbf v \ne 0;
  • degenerate (or singular) if det⁡A=0\det A = 0, equivalently AA has 00 as an eigenvalue.

A point x0∈U\mathbf{x}_0 \in U is a critical point of ff if ∇f(x0)=0\nabla f(\mathbf{x}_0) = \mathbf{0} (this presumes ff is differentiable; see Critical Points and Extrema).

Intuition

In one variable, f′′(x0)>0f''(x_0) > 0 means the graph curves upward like a parabola opening up, giving a local min; f′′(x0)<0f''(x_0) < 0 gives a local max. In several variables, curvature is not a single number — it depends on direction. Moving away from a critical point along direction v\mathbf v, the second-order behavior of ff is governed by the number vTHf(x0)v\mathbf v^{\mathsf T} H_f(\mathbf x_0) \mathbf v, the "curvature of ff in direction v\mathbf v." The Hessian packages the curvature in every direction at once. If that number is positive for every direction v\mathbf v, the surface curves upward no matter which way you step: a bowl, hence a local minimum. If negative for every direction, it's a local maximum. If it's positive in some directions and negative in others — the classic saddle shape, curving up along one axis and down along another — the critical point is a saddle point: neither max nor min. The eigenvalues of Hf(x0)H_f(\mathbf x_0) are exactly the curvatures along the principal axes (the eigenvectors), so their signs settle the classification.

Figure
Three quadratic-form profiles at a critical point: bowl (both eigenvalues positive), dome (both negative), saddle (mixed signs).
Local min: λ₁,λ₂ > 0 x₀ (critical point) Local max: λ₁,λ₂ < 0 x₀ (critical point) Saddle: λ₁>0, λ₂<0 x₀ (critical point)

Number-line picture of the classification rule

Figure
Classifying a critical point in the plane from the two eigenvalues of the Hessian.
Sign pattern of eigenvalues (λ₁, λ₂) of H_f(x₀) + , + local min – , – local max + , – (mixed) saddle any zero inconclusive det H = λ₁λ₂, tr H = λ₁+λ₂ det H > 0 & tr H > 0 ⇒ min · det H > 0 & tr H < 0 ⇒ max det H < 0 ⇒ saddle · det H = 0 ⇒ test fails
TheoremSecond Derivative Test

Let U⊆RnU \subseteq \mathbb{R}^n be open, let f∈C2(U)f \in C^2(U), and let x0∈U\mathbf{x}_0 \in U be a critical point of ff, i.e. ∇f(x0)=0\nabla f(\mathbf x_0) = \mathbf 0. Let H=Hf(x0)H = H_f(\mathbf x_0) be the Hessian of ff at x0\mathbf x_0. Then: 1. If HH is positive definite, ff has a strict local minimum at x0\mathbf x_0. 2. If HH is negative definite, ff has a strict local maximum at x0\mathbf x_0. 3. If HH is indefinite, x0\mathbf x_0 is a saddle point: ff has neither a local max nor a local min there. 4. If HH is positive or negative semidefinite but singular (has a zero eigenvalue), the test is inconclusive — each of local min, local max, and saddle can occur. For n=2n = 2, writing H=(fxxfxyfxyfyy)H = \begin{pmatrix} f_{xx} & f_{xy} \\ f_{xy} & f_{yy}\end{pmatrix} at x0\mathbf x_0 and D=det⁡H=fxxfyy−fxy2D = \det H = f_{xx}f_{yy} - f_{xy}^2, cases 1–3 specialize to:

  • D>0D > 0 and fxx>0f_{xx} > 0: local minimum;
  • D>0D > 0 and fxx<0f_{xx} < 0: local maximum;
  • D<0D < 0: saddle point;
  • D=0D = 0: inconclusive.
LemmaEigenvalue characterization of definiteness

Let AA be a real symmetric n×nn\times n matrix with eigenvalues λ1,…,λn\lambda_1, \dots, \lambda_n (repeated by multiplicity). Then: (a) AA is positive definite iff λi>0\lambda_i > 0 for all ii. (b) AA is negative definite iff λi<0\lambda_i < 0 for all ii. (c) AA is indefinite iff AA has both a strictly positive and a strictly negative eigenvalue. Moreover, if m=min⁡iλim = \min_i \lambda_i and M=max⁡iλiM = \max_i \lambda_i, then for all v∈Rn\mathbf v \in \mathbb R^n,

m ∥v∥2  ≤  vTAv  ≤  M ∥v∥2.m\,\|\mathbf v\|^2 \;\le\; \mathbf v^{\mathsf T} A \mathbf v \;\le\; M\,\|\mathbf v\|^2 .
Proof

Technique: spectral theorem for real symmetric matrices, plus direct estimation. Since AA is real symmetric, the Spectral Theorem gives an orthonormal basis e1,…,en\mathbf e_1,\dots,\mathbf e_n of eigenvectors, Aei=λieiA\mathbf e_i = \lambda_i \mathbf e_i, with λi∈R\lambda_i \in \mathbb R. Let P=[e1⋯en]P = [\mathbf e_1 \cdots \mathbf e_n], an orthogonal matrix (PTP=IP^{\mathsf T}P = I), so A=PΛPTA = P \Lambda P^{\mathsf T} with Λ=diag(λ1,…,λn)\Lambda = \mathrm{diag}(\lambda_1,\dots,\lambda_n). For any v∈Rn\mathbf v \in \mathbb R^n, set y=PTv=(y1,…,yn)\mathbf y = P^{\mathsf T}\mathbf v = (y_1,\dots,y_n), so v=Py\mathbf v = P\mathbf y and, since PP is orthogonal, ∥y∥=∥v∥\|\mathbf y\| = \|\mathbf v\|. Then

vTAv=yTΛy=∑i=1nλiyi2.\mathbf v^{\mathsf T} A \mathbf v = \mathbf y^{\mathsf T} \Lambda \mathbf y = \sum_{i=1}^n \lambda_i y_i^2 .

Proof of the sandwich inequality. Since m≤λi≤Mm \le \lambda_i \le M for every ii and yi2≥0y_i^2 \ge 0,

m∑iyi2  ≤  ∑iλiyi2  ≤  M∑iyi2,m\sum_i y_i^2 \;\le\; \sum_i \lambda_i y_i^2 \;\le\; M \sum_i y_i^2,

i.e. m∥y∥2≤vTAv≤M∥y∥2=M∥v∥2m\|\mathbf y\|^2 \le \mathbf v^{\mathsf T}A\mathbf v \le M\|\mathbf y\|^2 = M\|\mathbf v\|^2 (using ∥y∥=∥v∥\|\mathbf y\|=\|\mathbf v\|), proving the displayed inequality.

(a) If all λi>0\lambda_i > 0 then m>0m > 0, so for v≠0\mathbf v \ne \mathbf 0 the inequality gives vTAv≥m∥v∥2>0\mathbf v^{\mathsf T}A\mathbf v \ge m\|\mathbf v\|^2 > 0; hence AA is positive definite. Conversely, if AA is positive definite, apply the quadratic form to v=ei≠0\mathbf v = \mathbf e_i \ne \mathbf 0: eiTAei=λieiTei=λi>0\mathbf e_i^{\mathsf T} A \mathbf e_i = \lambda_i \mathbf e_i^{\mathsf T}\mathbf e_i = \lambda_i > 0. So every eigenvalue is positive.

(b) Identical argument with all inequalities reversed (or apply (a) to −A-A, noting −A-A has eigenvalues −λi-\lambda_i and AA negative definite   ⟺  \iff −A-A positive definite).

(c) If AA has eigenvalues of both signs, say λp>0\lambda_p > 0 and λq<0\lambda_q < 0, then Q(ep)=λp>0Q(\mathbf e_p) = \lambda_p > 0 and Q(eq)=λq<0Q(\mathbf e_q) = \lambda_q < 0, so AA is indefinite by definition. Conversely, if AA is indefinite it is by definition neither positive nor negative semidefinite; in particular by (a)/(b)'s contrapositive it cannot have all eigenvalues ≥0\ge 0 nor all ≤0\le 0, so it has at least one strictly positive and at least one strictly negative eigenvalue. ■\blacksquare

∎
Proof

Main proof of the Second Derivative Test. Technique: multivariable Taylor's theorem with Lagrange remainder, reduced to a quadratic-form estimate via the Lemma. Fix x0∈U\mathbf x_0 \in U with ∇f(x0)=0\nabla f(\mathbf x_0) = \mathbf 0, and let H=Hf(x0)H = H_f(\mathbf x_0).

Step 1: Taylor expansion. Since f∈C2(U)f \in C^2(U) and UU is open, there is r>0r > 0 such that the closed ball B‾(x0,r)⊂U\overline{B}(\mathbf x_0, r) \subset U. By Taylor's Theorem in Several Variables (second-order form with Lagrange/Peano remainder), for every h\mathbf h with ∥h∥<r\|\mathbf h\| < r,

f(x0+h)=f(x0)+∇f(x0)⋅h+12hTHh+R(h),lim⁡h→0R(h)∥h∥2=0.f(\mathbf x_0 + \mathbf h) = f(\mathbf x_0) + \nabla f(\mathbf x_0)\cdot \mathbf h + \tfrac12 \mathbf h^{\mathsf T} H \mathbf h + R(\mathbf h), \qquad \lim_{\mathbf h \to \mathbf 0} \frac{R(\mathbf h)}{\|\mathbf h\|^2} = 0.

Since ∇f(x0)=0\nabla f(\mathbf x_0) = \mathbf 0, this simplifies to

f(x0+h)−f(x0)=12hTHh+R(h).(∗)f(\mathbf x_0 + \mathbf h) - f(\mathbf x_0) = \tfrac12 \mathbf h^{\mathsf T} H \mathbf h + R(\mathbf h). \tag{$\ast$}

Step 2: Case HH positive definite. By the Lemma, all eigenvalues λi\lambda_i of HH are positive; let m=min⁡iλi>0m = \min_i \lambda_i > 0. By the sandwich inequality,

hTHh≥m∥h∥2for all h.\mathbf h^{\mathsf T} H \mathbf h \ge m\|\mathbf h\|^2 \quad \text{for all } \mathbf h.

Since R(h)/∥h∥2→0R(\mathbf h)/\|\mathbf h\|^2 \to 0 as h→0\mathbf h \to \mathbf 0, choose δ∈(0,r)\delta \in (0, r) such that ∥h∥<δ  ⟹  ∣R(h)∣<m4∥h∥2\|\mathbf h\| < \delta \implies |R(\mathbf h)| < \tfrac{m}{4}\|\mathbf h\|^2 (possible by definition of the limit, taking ε=m/4>0\varepsilon = m/4 > 0). Then for 0<∥h∥<δ0 < \|\mathbf h\| < \delta, using (∗)(\ast),

f(x0+h)−f(x0)≥12m∥h∥2−m4∥h∥2=m4∥h∥2>0.f(\mathbf x_0 + \mathbf h) - f(\mathbf x_0) \ge \tfrac12 m \|\mathbf h\|^2 - \tfrac{m}{4}\|\mathbf h\|^2 = \tfrac{m}{4}\|\mathbf h\|^2 > 0.

Hence f(x0+h)>f(x0)f(\mathbf x_0 + \mathbf h) > f(\mathbf x_0) for all h≠0\mathbf h \ne \mathbf 0 with ∥h∥<δ\|\mathbf h\| < \delta; that is, x0\mathbf x_0 is a strict local minimum.

Step 3: Case HH negative definite. Apply Step 2 to −f-f: H−f(x0)=−HH_{-f}(\mathbf x_0) = -H is positive definite (its eigenvalues are −λi>0-\lambda_i > 0 since all λi<0\lambda_i < 0 by the Lemma), so x0\mathbf x_0 is a strict local minimum of −f-f, i.e. a strict local maximum of ff.

Step 4: Case HH indefinite. By the Lemma there exist unit eigenvectors u\mathbf u (eigenvalue λ+>0\lambda_+ > 0) and w\mathbf w (eigenvalue λ−<0\lambda_- < 0). Consider the restriction of ff to the line x0+tu\mathbf x_0 + t\mathbf u, t∈Rt \in \mathbb R. Since uTHu=λ+∥u∥2=λ+>0\mathbf u^{\mathsf T} H \mathbf u = \lambda_+ \|\mathbf u\|^2 = \lambda_+ > 0, (∗)(\ast) with h=tu\mathbf h = t\mathbf u gives

f(x0+tu)−f(x0)=12λ+t2+R(tu),R(tu)t2→0 as t→0,f(\mathbf x_0 + t\mathbf u) - f(\mathbf x_0) = \tfrac12 \lambda_+ t^2 + R(t\mathbf u), \qquad \frac{R(t\mathbf u)}{t^2} \to 0 \text{ as } t \to 0,

so exactly as in Step 2 (one-dimensional case, mm replaced by λ+\lambda_+) there is δ1>0\delta_1 > 0 with f(x0+tu)>f(x0)f(\mathbf x_0 + t\mathbf u) > f(\mathbf x_0) for all 0<∣t∣<δ10 < |t| < \delta_1. Symmetrically, using w\mathbf w with λ−<0\lambda_- < 0, there is δ2>0\delta_2 > 0 with f(x0+tw)<f(x0)f(\mathbf x_0 + t\mathbf w) < f(\mathbf x_0) for all 0<∣t∣<δ20 < |t| < \delta_2. Thus every neighborhood of x0\mathbf x_0 contains points where ff exceeds f(x0)f(\mathbf x_0) (along u\mathbf u) and points where ff is less than f(x0)f(\mathbf x_0) (along w\mathbf w). Hence f(x0)f(\mathbf x_0) is neither a local maximum value nor a local minimum value: x0\mathbf x_0 is a saddle point.

Step 5: Inconclusive case. Suppose HH is positive semidefinite (or negative semidefinite) but singular, i.e. some eigenvalue equals 00. The quadratic term 12hTHh\tfrac12 \mathbf h^{\mathsf T}H\mathbf h vanishes along the corresponding eigen-direction, so along that direction the sign of f(x0+h)−f(x0)f(\mathbf x_0+\mathbf h) - f(\mathbf x_0) is controlled entirely by the remainder R(h)R(\mathbf h), about which the hypotheses of the theorem (mere C2C^2 regularity and vanishing of ∇f\nabla f) give no information. Concrete examples below exhibit all three possible outcomes (min, max, saddle) with a singular semidefinite Hessian, which proves that no universal conclusion can be drawn in this case; hence the test is genuinely inconclusive here (this is established by the counterexamples rather than by further deduction from the hypotheses, since the hypotheses alone do not determine the outcome).

Step 6: The n=2n=2 determinant form. For n=2n = 2, H=(abbc)H = \begin{pmatrix} a & b \\ b & c\end{pmatrix} with a=fxx,b=fxy,c=fyya = f_{xx}, b = f_{xy}, c = f_{yy} at x0\mathbf x_0, and D=det⁡H=ac−b2D = \det H = ac - b^2. The eigenvalues λ1,λ2\lambda_1,\lambda_2 satisfy λ1λ2=D\lambda_1\lambda_2 = D and λ1+λ2=a+c\lambda_1+\lambda_2 = a+c (trace). If D>0D > 0, both eigenvalues have the same sign (their product is positive), and that common sign matches the sign of aa: indeed if a>0a > 0, testing the quadratic form on v=(1,0)\mathbf v = (1,0) gives Q(1,0)=a>0Q(1,0) = a > 0, so by the Lemma HH cannot be negative definite or indefinite (those require a negative or mixed eigenvalue giving some negative value of QQ), forcing HH positive definite; symmetrically a<0a<0 forces negative definite. If D<0D < 0, λ1λ2<0\lambda_1\lambda_2 < 0 so the eigenvalues have opposite signs, giving indefinite by the Lemma. If D=0D = 0, at least one eigenvalue is 00, the singular case. This recovers exactly the stated 2×22\times 2 criterion. ■\blacksquare

∎

Worked examples

Example 1 (asymmetric coefficients, non-origin critical point). Let

f(x,y)=x3−3xy2+6x2+3y2−9x.f(x,y) = x^3 - 3xy^2 + 6x^2 + 3y^2 - 9x .

Find and classify all critical points. Compute the gradient:

fx=3x2−3y2+12x−9,fy=−6xy+6y=6y(1−x).f_x = 3x^2 - 3y^2 + 12x - 9, \qquad f_y = -6xy + 6y = 6y(1-x).

Setting fy=0f_y = 0: either y=0y = 0 or x=1x = 1. Case y=0y=0: fx=3x2+12x−9=3(x2+4x−3)=0⇒x=−4±16+122=−2±7f_x = 3x^2 + 12x - 9 = 3(x^2+4x-3) = 0 \Rightarrow x = \dfrac{-4 \pm \sqrt{16+12}}{2} = -2 \pm \sqrt7. This gives critical points (−2+7,0)(-2+\sqrt7, 0) and (−2−7,0)(-2-\sqrt7, 0). Case x=1x=1: fx=3−3y2+12−9=6−3y2=0⇒y2=2⇒y=±2f_x = 3 - 3y^2 + 12 - 9 = 6 - 3y^2 = 0 \Rightarrow y^2 = 2 \Rightarrow y = \pm\sqrt2. This gives (1,2)(1,\sqrt2) and (1,−2)(1,-\sqrt2). Now compute the Hessian entries generally:

fxx=6x+12,fxy=−6y,fyy=−6x+6.f_{xx} = 6x+12, \qquad f_{xy} = -6y, \qquad f_{yy} = -6x+6.
D(x,y)=fxxfyy−fxy2=(6x+12)(6−6x)−36y2=36(x+2)(1−x)−36y2.D(x,y) = f_{xx}f_{yy} - f_{xy}^2 = (6x+12)(6-6x) - 36y^2 = 36(x+2)(1-x) - 36y^2.

At (1,2)(1,\sqrt2): D=36(3)(0)−36(2)=−72<0D = 36(3)(0) - 36(2) = -72 < 0. Saddle point. At (1,−2)(1,-\sqrt2): same computation (y2=2y^2 = 2 regardless of sign), D=−72<0D = -72 < 0. Saddle point. At (−2+7,0)(-2+\sqrt7, 0): numerically 7≈2.6458\sqrt7 \approx 2.6458, so x≈0.6458x \approx 0.6458. Then x+2≈2.6458x+2 \approx 2.6458, 1−x≈0.35421-x \approx 0.3542, D≈36(2.6458)(0.3542)≈33.73>0D \approx 36(2.6458)(0.3542) \approx 33.73 > 0. Since fxx=6x+12≈3.875+12=15.87>0f_{xx} = 6x+12 \approx 3.875 + 12 = 15.87 > 0: local minimum. At (−2−7,0)≈(−4.6458,0)(-2-\sqrt7, 0) \approx (-4.6458, 0): x+2≈−2.6458x+2 \approx -2.6458, 1−x≈5.64581-x \approx 5.6458, so D≈36(−2.6458)(5.6458)≈−537.7<0D \approx 36(-2.6458)(5.6458) \approx -537.7 < 0: saddle point. So ff has one local minimum, at (−2+7,0)(-2+\sqrt7,0), and three saddle points. (There is no local maximum — consistent with ff being a cubic in xx, hence unbounded above and below, so no global extrema exist, though local ones can.)

Example 2 (n=3n=3, using eigenvalues directly). Let

g(x,y,z)=x2+2y2+3z2+2xy−2yz−8x.g(x,y,z) = x^2 + 2y^2 + 3z^2 + 2xy - 2yz - 8x .

Critical point. ∇g=(2x+2y−8,  4y+2x−2z,  6z−2y)\nabla g = (2x+2y-8,\; 4y+2x-2z,\; 6z-2y). Set to zero:

2x+2y=8  ⇒  x+y=4,2x+4y−2z=0  ⇒  x+2y−z=0,6z=2y  ⇒  z=y/3.2x+2y = 8 \;\Rightarrow\; x+y=4, \qquad 2x+4y-2z=0 \;\Rightarrow\; x+2y-z=0, \qquad 6z=2y \;\Rightarrow\; z = y/3.

From the first equation x=4−yx = 4-y. Substitute into the second: (4−y)+2y−y/3=0⇒4+y−y/3=0⇒4+2y3=0⇒y=−6(4-y) + 2y - y/3 = 0 \Rightarrow 4 + y - y/3 = 0 \Rightarrow 4 + \tfrac{2y}{3} = 0 \Rightarrow y = -6. Then x=4−(−6)=10x = 4-(-6) = 10, z=−6/3=−2z = -6/3 = -2. Critical point: (10,−6,−2)(10, -6, -2). Hessian (constant, since gg is quadratic):

Hg=(22024−20−26).H_g = \begin{pmatrix} 2 & 2 & 0 \\ 2 & 4 & -2 \\ 0 & -2 & 6 \end{pmatrix}.

Use Sylvester's criterion (leading principal minors), equivalent to the eigenvalue test for definiteness of a symmetric matrix: HH is positive definite iff every leading principal minor is positive.

  • Δ1=2>0\Delta_1 = 2 > 0.
  • Δ2=det⁡(2224)=8−4=4>0\Delta_2 = \det\begin{pmatrix}2&2\\2&4\end{pmatrix} = 8 - 4 = 4 > 0.
  • Δ3=det⁡Hg\Delta_3 = \det H_g. Expand along the first row:
det⁡Hg=2det⁡(4−2−26)−2det⁡(2−206)+0=2(24−4)−2(12−0)=40−24=16>0.\det H_g = 2\det\begin{pmatrix}4 & -2\\-2&6\end{pmatrix} - 2\det\begin{pmatrix}2&-2\\0&6\end{pmatrix} + 0 = 2(24-4) - 2(12-0) = 40 - 24 = 16 > 0.

All three leading principal minors are positive, so HgH_g is positive definite. By the Second Derivative Test, (10,−6,−2)(10,-6,-2) is a strict local minimum of gg. (Because gg is a quadratic function with positive definite Hessian everywhere, this is in fact the unique global minimum, though the theorem itself only certifies the local statement.)

Counterexamplewhy C2C^2 regularity (Clairaut's hypothesis) cannot be dropped

The proof of the theorem relies on the Hessian being symmetric, which in turn rests on Clairaut's Theorem on Mixed Partials requiring f∈C2f \in C^2 (continuity of second partials). If we only assume the second partials exist but are not continuous, the mixed partials can differ, and the "Hessian" is no longer symmetric — the entire eigenvalue argument (which used the Spectral Theorem for symmetric matrices) collapses, and there is no guarantee the quadratic form hTHh\mathbf h^{\mathsf T}H\mathbf h even controls the correct Taylor remainder consistently in both orders. Concretely, consider the classical example

f(x,y)={xyx2−y2x2+y2,(x,y)≠(0,0),0,(x,y)=(0,0).f(x,y) = \begin{cases} xy\dfrac{x^2-y^2}{x^2+y^2}, & (x,y)\ne(0,0),\\[4pt] 0, & (x,y)=(0,0).\end{cases}

This function is differentiable everywhere and has continuous first partials, and (0,0)(0,0) is a critical point (∇f(0,0)=(0,0)\nabla f(0,0) = (0,0), checked directly from the difference quotient definition). A direct computation of the second partials at the origin via difference quotients gives

fxy(0,0)=−1,fyx(0,0)=1,f_{xy}(0,0) = -1, \qquad f_{yx}(0,0) = 1,

so the mixed partials disagree there: ff fails to be C2C^2 at the origin (second partials exist but are not continuous there), and Clairaut's hypothesis fails exactly at the point we care about. Writing down "the Hessian" at the origin is then ambiguous — using fxy=−1f_{xy}=-1 versus fyx=1f_{yx}=1 gives two different, non-symmetric 2×22\times2 arrays, so there is no single well-defined symmetric quadratic form to test, and the eigenvalue/definiteness machinery the theorem depends on simply does not apply. This shows precisely where continuity of second partials enters the proof: without it, "the Hessian" is not even well-defined as a symmetric object, let alone classifiable by sign of eigenvalues.

Scope, edge cases & common traps

SituationWhat happens
HH positive/negative definiteTest conclusive: strict local min/max (proved above)
HH indefiniteTest conclusive: saddle point (proved above)
HH singular (some eigenvalue =0=0)Test inconclusive; examine higher-order terms or restrict to lines through x0\mathbf x_0
f∉C2f \notin C^2 near x0\mathbf x_0Hessian may be non-symmetric or discontinuous; theorem does not apply
x0\mathbf x_0 not a critical pointTheorem inapplicable; must first verify ∇f(x0)=0\nabla f(\mathbf x_0)=\mathbf 0
Global vs. local extremumTheorem only certifies local behavior; global claims need extra structure (e.g. convexity, compact domain)

The mathematician behind it

Origins · 1 minLudwig Otto Hesse and how this was discovered
LO
Ludwig Otto Hesse
1811–1874 · 19th-century Germany, algebraic and differential invariant theory

Hesse was a German mathematician working primarily in algebraic geometry and invariant theory, a student of Jacobi at Königsberg. He introduced the determinant now called the Hessian in his 1858 studies of cubic and quartic curves, using the matrix of second partial derivatives to detect inflection points and singularities of algebraic curves and surfaces — the same matrix that later became the standard tool for classifying critical points of smooth functions in analysis and optimization.

History
- 1844: Hesse begins publishing systematic work on invariants of algebraic forms at Königsberg.
- 1858: Hesse introduces the determinant of second partial derivatives (the "Hessian determinant") in the study of curves defined by homogeneous polynomials, to locate inflection points.
- Late 1800s: The construction is absorbed into the developing theory of multivariable analysis and the calculus of variations.
- Early 1900s: Taylor's theorem in several variables, combined with the eigenvalue theory of quadratic forms, is used to give the modern proof of the second derivative test as presented here.
- Mid-to-late 1900s: The Hessian becomes a core tool in optimization theory, numerical analysis (Newton's method), and Morse theory, where nondegenerate critical points (Hessian never singular) organize the topology of manifolds.
Does the Second Derivative Test require the function to be twice differentiable everywhere, or just at the critical point?

The cleanest and most commonly used version, as stated here, assumes f∈C2f \in C^2 on an open set UU containing the critical point — that is, all second partials exist and are continuous throughout a neighborhood, not just at the point itself. This is because the proof uses Taylor's theorem, which itself requires continuity of second partials on a neighborhood (often via the mean value theorem applied along a segment) to control the remainder term. A pointwise-only assumption of twice differentiability at x0\mathbf x_0 is weaker and does not by itself guarantee the Taylor remainder estimate used in the proof, so most rigorous treatments require the full C2C^2 neighborhood hypothesis.

If the Hessian is positive semidefinite everywhere (not just at one point), does that mean ff is convex?

Yes, this is a genuinely useful global fact, though it is a separate theorem from the local Second Derivative Test discussed here. If f∈C2(U)f \in C^2(U) on a convex open set UU and Hf(x)H_f(\mathbf x) is positive semidefinite for every x∈U\mathbf x \in U, then ff is convex on UU; if positive definite everywhere, ff is strictly convex. This upgrades local information (curvature at one point) to a global statement (convexity on the whole domain), which is why Hessian positivity checks are central in convex optimization, but it requires checking the sign condition at every point, not just at critical points.

How does the Second Derivative Test generalize the one-variable test?

When n=1n=1, the "Hessian" is the 1×11\times1 matrix [f′′(x0)][f''(x_0)], and definiteness reduces exactly to the sign of f′′(x0)f''(x_0): positive definite means f′′(x0)>0f''(x_0)>0 (local min), negative definite means f′′(x0)<0f''(x_0)<0 (local max), and there is no possibility of "indefinite" since a 1×11\times1 matrix has only one eigenvalue, which cannot have "mixed signs." The degenerate case f′′(x0)=0f''(x_0)=0 is exactly the familiar inconclusive case from single-variable calculus (e.g. x3x^3 vs. x4x^4 vs. −x4-x^4 at 00), matching case 4 of the multivariable theorem precisely.

Can the Hessian be used to test critical points of functions constrained to a curve or surface, not the whole space?

Not directly with the ordinary Hessian, since a constraint restricts the admissible directions of motion, and a direction that is "bad" in the full space might not be reachable while staying on the constraint set. The natural extension is the bordered Hessian, built from the Lagrangian function in Lagrange Multipliers problems, whose definiteness is checked only on the subspace tangent to the constraint surface rather than on all of Rn\mathbb R^n. The underlying idea — quadratic form controls local behavior — is the same, but the relevant vector space of test directions shrinks to the constraint's tangent space.

Is checking eigenvalue signs the only way to determine definiteness in practice?

No. Sylvester's criterion (checking the signs of the leading principal minors) is often faster by hand for small matrices and avoids computing eigenvalues explicitly, as shown in the worked 3×33\times 3 example above. For 2×22\times2 Hessians, the determinant-and-trace (or determinant-and-fxxf_{xx}) shortcut used throughout this article is the quickest route. For large matrices arising numerically (e.g. in optimization software), definiteness is typically checked via Cholesky factorization: a symmetric matrix is positive definite iff it admits a Cholesky decomposition A=LLTA = LL^{\mathsf T} with real diagonal entries of LL all positive, which is numerically efficient.

What exactly does "saddle point" mean geometrically, and is it always shaped like a horse saddle?

A saddle point is a critical point that is neither a local maximum nor a local minimum: in every neighborhood of it, ff takes both larger and smaller values than f(x0)f(\mathbf x_0). In the classic n=2n=2 indefinite case with distinct-sign eigenvalues, the local picture genuinely resembles a horse saddle or mountain pass, curving up along one principal axis and down along another, which is where the name comes from. In higher dimensions the geometric picture is more complex (the "saddle" can curve up in several directions and down in several others simultaneously), but the defining property — no local extremum, mixed increase/decrease in different directions — persists exactly as proved in the theorem.

Why does the theorem only conclude "local" extrema, and how would one get global information?

The proof works entirely inside a small ball ∥h∥<δ\|\mathbf h\|<\delta where the Taylor remainder is provably small compared to the quadratic term; nothing in the argument controls behavior far from x0\mathbf x_0. To upgrade to a global statement one needs extra global structure, such as ff being convex on its whole domain (which as noted follows from the Hessian being positive semidefinite everywhere, not just at x0\mathbf x_0), or the domain being compact so that a global extremum is guaranteed to exist by the Extreme Value Theorem and can then be identified among the local extrema found via this test.

Before this

Where this leads