← Learning roadmap
Step 16 companion · Interactive

Positive Definiteness and Optimization

The objective forms a 3D bowl because its Hessian is positive definite. Rotate the surface, choose a starting point, then follow the negative gradient toward its unique global minimum.

Drag the surface to rotate it. Use the sliders to move the gold point. The green point is x* = (2, 0); the cyan arrow points downhill.

Explore the objective

f(x₁,x₂) = x₁² + x₁x₂ + x₂² − 4x₁ − 2x₂
f(x) ∇f(x) Distance to x* Minimum f(x*)−4.00

Each step uses xnext = x − 0.25∇f(x). The path stays on this strictly convex surface.

1. Check the curvature

The Hessian is H = [[2, 1], [1, 2]]. It is symmetric, with eigenvalues 3 and 1. Both are positive, so vᵀHv > 0 for every nonzero direction v. Equivalently, its leading entry is 2 > 0 and its determinant is 3 > 0.

2. Find the minimum

Set ∇f = (2x₁ + x₂ − 4, x₁ + 2x₂ − 2) = 0. Solving Hx = (4, 2) gives x* = (2, 0). Completing the square gives f(x) = −4 + ½(x − x*)ᵀH(x − x*). Positive definiteness makes every other value strictly larger than −4.

Try it: Start far from (2, 0), take several steps, and watch both the objective value and distance fall. The steeper eigen-direction shrinks faster than the flatter one.
Three-dimensional bowl for the same quadratic objective, with contour curves and its minimum marked at (2, 0), value −4.
Original reference image for this quadratic surface.

← Return to symmetric and positive definite matrices