Maximize something while staying ON a constraint — the most profit while spending exactly your budget. At the best point, the direction the goal wants to climb (its gradient) points STRAIGHT into the constraint fence — it’s exactly perpendicular, so no sideways move along the fence can improve. Lagrange turns that geometric fact into an equation: ∇f = λ∇g. It’s how constrained optimization is solved everywhere. Slide around the constraint to the tangent point.
To optimize f(x,y) subject to a constraint g(x,y)=k, the maximum along the constraint occurs where the objective’s gradient is PARALLEL to the constraint’s: ∇f=λ∇g. Geometrically, at the optimum the objective’s level curve is TANGENT to the constraint — any move along the constraint is perpendicular to ∇f, so it can’t change f to first order. The multiplier λ is the SHADOW PRICE: how much the optimum improves per unit relaxation of the constraint. For max xy on x+y=10, ∇f=(y,x)=λ(1,1) forces x=y=5, f=25. It generalizes (KKT conditions) to inequalities and underlies constrained ML, economics, and physics. A fail-loud self-check throws unless the tangency point is (5,5). ◆ real optimization, node-verified.
∇f=λ∇g is a NECESSARY condition (stationary point) — you still check it’s a max not a min/saddle, and it needs a constraint qualification (∇g≠0). The tangency geometry and shadow-price meaning are exact.