Recipe
Verify convexity of a multivariable function via its Hessian
Use when: you have a twice continuously differentiable f on a convex domain S and need to know whether f is convex on S, not just classify one critical point
Goal: a convex / not-convex / convex-only-on-a-sub-region verdict for the whole domain, from one Hessian computation
Taught in The second-order (Hessian) characterization of convexity
Quick recipe
-
1
Find every second partial derivative f_{x_ix_j} and assemble them into the Hessian H(x) — the same object Chapter 2's critical-point classification used.
Example
For f(x,y)=x^2+xy+y^2+2: f_{xx}=2,\ f_{yy}=2,\ f_{xy}=f_{yx}=1, so H=\begin{bmatrix}2&1\\1&2\end{bmatrix} — the SAME matrix at every (x,y), since every second partial here is a constant.
Why: convexity is defined directly in terms of H's definiteness, so the whole check starts from having H(x) in hand.
-
2
Find H's eigenvalues (by trace and determinant for a 2\times2, or straight off the diagonal when H has no cross terms — Step 3) and confirm none is negative, at EVERY x\in S, not only at one point.
Example
Continuing with H=\begin{bmatrix}2&1\\1&2\end{bmatrix}: \operatorname{tr}H=4, \det H=4-1=3, so \lambda^2-4\lambda+3=0\implies(\lambda-1)(\lambda-3)=0\implies\lambda=1,3, both positive — and since H never changes, this single computation covers every point of the domain at once.
- every second partial is a plain number (no x or y in it), so H never changes — one eigenvalue computation certifies the whole domain at once.
- H genuinely varies with x — check the eigenvalue signs as a function of x, since PSD can hold on part of the domain and fail on another.
Why: the theorem requires PSD-ness at every point of S, not just at one point the way Chapter 2's local test did — checking a single point would prove nothing about the function overall.
-
3
When f is separable (f=\sum_ig_i(x_i)), H comes out diagonal, and a diagonal matrix's eigenvalues are exactly its diagonal entries — check each g_i''\ge0 on its own piece instead of solving a characteristic equation.
Example
For f(x,y)=x^3+y^2: f_{xx}=6x,\ f_{yy}=2,\ f_{xy}=0, so H(x,y)=\begin{bmatrix}6x&0\\0&2\end{bmatrix} is already diagonal, with eigenvalues exactly 6x and 2 — no characteristic equation needed.
⚡ Shortcut
This is the same diagonal-eigenvalue shortcut Chapter 2 used for classifying one critical point, applied here across the whole domain instead of a single point.
Why: building and solving a characteristic equation is wasted work whenever the Hessian happens to have no cross terms — the diagonal entries already are the eigenvalues.
-
4
State the verdict from Step 2's result.
Example
6x\ge0 only when x\ge0 (while 2>0 always), so at x=-1: H(-1,y)=\begin{bmatrix}-6&0\\0&2\end{bmatrix} has a negative eigenvalue. So H is PSD exactly on \{(x,y):x\ge0\}: f(x,y)=x^3+y^2 is convex on that half-plane only, not on all of \mathbb R^2.
- PSD holds at every x\in S — f is convex on all of S.
- PSD fails somewhere in S — f is convex only on the largest sub-region where it does hold, and not convex on all of S.
Why: convexity is a domain-dependent claim, not a bare property of the formula alone — a negative eigenvalue found anywhere in S rules out convexity on all of S, but says nothing about a genuinely smaller sub-region.
Common mistakes
- Checking positive semidefiniteness at only one point (such as a critical point) and concluding convexity for the whole domain.
- Confusing this test with Chapter 2's second-order SUFFICIENT condition for a local minimum, which needs positive DEFINITE at one critical point, not PSD everywhere.
- Treating a negative eigenvalue found at one point as ruling out convexity everywhere, instead of narrowing the domain to where PSD genuinely holds.
- Solving a full characteristic equation for a diagonal Hessian instead of reading the eigenvalues straight off the diagonal.