Unconstrained Optimization and the Second-Order Test
Finding and classifying critical points with the gradient and the Hessian, and why convexity makes it global.
Leads to: The Hessian test previews the definiteness ideas of Phase 4 and the convex programs of Phase 10.
Learning Objectives
Click a status chip to cycle: Not started → In progress → Studied → Practiced → Needs review → Mastered.
- Locate critical points by solving \(\nabla f=0\).
- Classify critical points using the Hessian’s definiteness (second-order test).
- Explain why a convex objective’s stationary point is a global minimum.
- Interpret gradient descent as a discrete step toward a critical point.
Key Vocabulary
- Critical point
- A point where \(\nabla f=0\) (or the gradient fails to exist); a candidate extremum.
- Positive definite
- A symmetric matrix with \(x^\top Hx\gt 0\) for all \(x\neq 0\); equivalently all eigenvalues positive.
- Saddle point
- A critical point that is a min in some directions and a max in others; the Hessian is indefinite.
- Second-order test
- Classifies a critical point by the definiteness of the Hessian there.
- Convex function
- One whose graph lies below its chords; equivalently \(H\succeq 0\) everywhere for twice-differentiable \(f\).
- Global minimizer
- A point \(x^*\) with \(f(x^*)\le f(x)\) for all feasible \(x\).
Intuition & Motivation
The decisive property is convexity. If the Hessian is positive semidefinite everywhere, the bowl has no false bottoms: any point where the gradient vanishes is the global minimum. This single fact is why convex problems are the tractable heart of quantitative optimization.
First-order condition
At an interior extremum every partial must vanish, so \(\nabla f(x^*)=0\). This is necessary, not sufficient: maxima, minima, and saddles all satisfy it. Solving the system \(\nabla f=0\) yields the candidate list.
Second-order test via the Hessian
In two variables there is a compact form. With \(H=\begin{bmatrix}f_{xx}&f_{xy}\\ f_{xy}&f_{yy}\end{bmatrix}\) let \(D=\det H=f_{xx}f_{yy}-f_{xy}^2\). Then:
- \(D\gt 0\) and \(f_{xx}\gt 0\) → local minimum;
- \(D\gt 0\) and \(f_{xx}\lt 0\) → local maximum;
- \(D\lt 0\) → saddle point;
- \(D=0\) → inconclusive.
Convexity makes it global
This is the reason a quadratic risk objective \(f(w)=\tfrac12 w^\top\Sigma w\) with covariance \(\Sigma\succeq 0\) is so friendly: solving \(\nabla f=\Sigma w=0\) (with constraints, next lesson) lands on the true optimum, no local traps.
Interactive: descend to the minimum
Steepest descent takes steps \(x_{k+1}=x_k-\eta\nabla f(x_k)\). On a well-conditioned bowl it heads almost straight in; raise the condition number and it zig-zags, motivating the preconditioning and Newton methods of Phase 10 (which multiply the gradient by \(H^{-1}\)).
- Declaring a critical point a minimum from \(D\gt 0\) alone - you also need \(f_{xx}\gt 0\) to rule out a maximum.
- Treating \(\nabla f=0\) as sufficient; saddles satisfy it too.
- Forgetting that \(D=0\) (semidefinite Hessian) is inconclusive; higher-order terms decide.
- Assuming a local minimum is global without convexity - non-convex objectives have many basins.
- Compute the Hessian once symbolically; for quadratics it is constant and the test is immediate.
- Definiteness = eigenvalue signs. In 2-D the \((D,f_{xx})\) shortcut avoids eigenvalues entirely.
- If your objective is a sum of a convex quadratic and a convex penalty, it is convex - a stationary point is the global optimum.
Knowledge Check
Practical Exercise
Let \(f(x,y)=x^2+y^2-xy-3x\) (a stylized convex cost). Find all critical points and classify them with the second-order test. Is the minimizer global?
Gradient: \(\nabla f=(2x-y-3,\ 2y-x)\). Set to zero: from the second equation \(x=2y\); substitute into the first: \(4y-y-3=0\Rightarrow y=1\), so \(x=2\). Single critical point \((2,1)\).
So \((2,1)\) is a strict local minimum. Since \(H\) is constant and positive definite (eigenvalues \(1\) and \(3\)), \(f\) is strictly convex, and the minimizer is the unique global minimum, with value \(f(2,1)=4+1-2-6=-3\).
Lesson Summary
Formula Sheet Additions
Retrieval Practice
Close the lesson and answer from memory before checking. This is deliberate, effortful recall - the single highest-yield study action.
A: D=f_xx f_yy - f_xy^2 > 0 and f_xx > 0.
A: A PSD Hessian everywhere means no false bottoms, so any stationary point is the global minimum (unique if strictly convex).
Completion Checklist
- I can explain the core ideas in my own words
- I worked the derivations/examples by hand
- I completed the interactive workbench(es)
- I passed the knowledge check
Source References
This lesson synthesizes and paraphrases concepts from the sources below. No copyrighted text, problem sets, or solutions are reproduced. Return to the originals for full depth.
- Calculus, Vol. II (Tom Apostol, 2nd ed., 1969) foundational - Ch. 9 - Vol. II, Ch. 9: extrema of functions of several variables and the second-derivative test.
- Additional Exercises for Convex Optimization (Boyd & Vandenberghe, 2016) current - Ch. 3-9 exercises - Convexity, definiteness of the Hessian, and global optimality of stationary points.