Foundations — Lagrange multipliers for constrained optimization
Right now the symbols and "the curve you're stuck on" are just words. Figure s00 below is the whole page in one picture: a red arrow (, where you'd walk to improve) meeting a black fence-curve (the constraint) head-on. Keep this image in mind — every section below earns one piece of it, and §6–§7 return to exactly this picture.

This page builds every symbol the parent note uses, starting from a dot on paper.
0. A point and its coordinates: ,
Why the topic needs it: everything we optimize — profit, area, distance — is a number that depends on where you stand. No point, nothing to compute.
- The plain (thin) is one coordinate, a single number.
- The bold is the whole point / vector, all coordinates together.
Figure s02 below shows a single point (in red) and the two dashed "walk right then walk up" moves that its coordinates encode — this is the picture behind the bold symbol .

1. A function of two variables: and
The parent writes — same thing, using the bold "whole point" name. In the examples:
- → a bowl, deepest at the origin (this is distance-to-origin, squared).
- → area of a rectangle with sides and .
Why the topic needs it: is the thing we want to make as big or as small as possible — the "objective".
Figure s03 below draws as seen from directly above: each black ring is one height-level of the bowl, and the red dot marks its deepest point . Read it as a mountain map of the objective.

2. Contour lines (level curves)
Why the topic needs it: the whole geometric argument ("gradients must align") is easiest to see on contours. Tight-packed contours = steep hill; spread-out = flat. The rings you already saw in Figure s03 are exactly these contours.
3. The dot product
Before the gradient can be used, we need the tool that measures agreement between two arrows.
Why this particular recipe? Because that number is also , where is the angle between the arrows. So the dot product secretly measures how aligned the arrows are:
- same direction (, ) → as positive as possible,
- opposite (, ) → as negative as possible,
- perpendicular () → exactly zero (because ).
Two facts we lean on hard:
- means "the arrows meet at a right angle."
- For a fixed-length step , the dot product is largest when — i.e. when points the same way as . We use this in §4 to pin down what "steepest" means.
4. The gradient:
Here a real mathematical tool enters. Why the gradient and not something simpler? Because we need a single object that answers: "From where I stand, which way is uphill, and how steep?" A plain derivative gives steepness along one direction; the gradient packages all directions into one arrow.
Notice we defined only by its parts — we have not yet earned the claim that it points uphill. Let's earn it.
Figure s04 below makes this concrete: on one contour ring it draws the red gradient arrow (steepest uphill) and the dashed black tangent direction (along the ring). Notice they meet at — that right angle is the equation .

Why the topic needs it: "the gradient of the objective must point the same way as the gradient of the constraint" is the punchline. Without there is no punchline. This same arrow is what Gradient Descent walks down.
5. The constraint:
Why the topic needs it: "constrained" means trapped on this curve. Off the curve, points are illegal ("infeasible"). is just the fixed number that names which curve.
- ::: the constraint function (another hill).
- ::: the constant that fixes which level curve of is the fence.
6. The tangent step and why
Apply the differential identity from §4 to the constraint function : a legal step keeps unchanged (still equal to ), so . Therefore By §3 a zero dot product means perpendicular — so a legal step is exactly one perpendicular to , i.e. running along the fence. (This needs the fence to have a direction, which is the §5 nondegeneracy condition .)
Now the punchline. At a constrained optimum, no legal step can improve , so for every legal .
7. The multiplier and the Lagrangian
Let's check the packing by actually differentiating — the shortcut skips nothing if we do it once by hand.
Why the topic needs it: is the whole method in one line. is also the shadow price — how much the best value shifts if you move the fence, the quantity that reappears in KT Conditions, Support Vector Machines, and Duality Theory.
- ::: scalar that rescales onto ; also the sensitivity/shadow price.
- ::: objective minus times (constraint − constant).
8. The nabla-with-subscript and
- means "gradient of only with respect to the point coordinates" → this gives the alignment equations (worked above).
- means "derivative treating only as the variable" → this hands back the constraint (also worked above).
Recall Why differentiating in
returns the constraint contains . Nudging changes at rate . Setting that rate to zero means , i.e. . So the "extra" equation is automatically the fence.
Prerequisite map
Equipment checklist
Test yourself — if any line stumps you, re-read its section above.
- What does the bold mean versus the thin ? ::: Bold is the whole point/vector ; thin is one coordinate.
- What picture is ? ::: The height of a hill above the floor point .
- What does "continuously differentiable ()" buy us? ::: A hill with no corners or cliffs nearby, so the gradient exists and the identity holds.
- What is a contour line of ? ::: All points where has the same value — a horizontal slice / map ring.
- How do you compute a dot product , and when is it zero? ::: ; it is zero exactly when the arrows are perpendicular.
- Why does point in the steepest-uphill direction? ::: Because is maximized, over fixed-length steps, when is parallel to ().
- What are the two facts about ? ::: It points in the steepest-uphill direction and is perpendicular to the contour through that point.
- What does measure? ::: The change in when you nudge only and freeze .
- What does represent geometrically? ::: A single level curve of — the fence you are forced to stay on.
- Why must for a legal step? ::: A legal step keeps so ; by the identity , and a zero dot product means perpendicular to (along the fence).
- Why does " every legal step" force ? ::: In 2D the legal steps fill one line; there is only one direction perpendicular to that line, and already points it, so must be a multiple of .
- What nondegeneracy condition must hold, and why? ::: , so the fence has a well-defined tangent direction and is meaningful.
- Which two equations do you get by setting all derivatives of to zero? ::: , and .
- What is the physical meaning of ? ::: The shadow price: how much the optimal value changes if you move the fence () a little.