3.1 Constrained Optimization
Lagrange multipliers, the primal, and the dual.
These notes walk through the lecture slides. The original deck is unchanged; use (slides) on the course hub if you want that PDF.
The figures follow Deisenroth, Faisal, and Ong, Mathematics for Machine Learning.
1. Extra conditions on
Unconstrained: with . Constrained: the same min, plus real-valued that must obey,
The feasible set can mix equalities and inequalities:
and the need not be convex. The LP and QP notes take the convex case.
A box is already a constraint set. The unconstrained min can fall outside the box. The constrained min is then on the boundary (the star, not the circle).

2. The primal
The primal is the original problem in : minimize subject to . Its solution is the feasible you actually want, and the optimal . Direct search can be ugly once the constraints or are messy.
Why turn it into an unconstrained problem in more variables?
| Reason | What you get |
|---|---|
| Simplicity | Most solvers are written for unconstrained maps |
| Algorithms | You can use methods from Week 2 |
| Theory | Stationarity and convergence statements are cleaner |
| Hard problems | Nonlinear / nonconvex constraints become a Lagrangian you can differentiate |
3. The Lagrangian
For inequalities ,
with multipliers . (Sign conventions differ across books; stay consistent with the slide that introduced .)
Stationarity of the Lagrangian:
A multiplier is the rate of change of if you nudge the corresponding constraint. It is the price of that constraint.
4. The dual
Minimize in first (when that min is easy). What remains is a function of :
The Lagrange dual is
| What the dual gives you | Why it matters |
|---|---|
| A lower bound on the primal min | You can score a candidate |
| Multipliers as sensitivities | How much moves if a constraint moves |
| Sometimes a cheaper solve | Dual decomposition, cutting planes; vs can flip which problem is small |
5. SVM as a constrained problem
Soft-margin SVM is already in this shape:

Form the Lagrangian, pass to the dual, and the multipliers become the story of which points sit on the margin. Notes 3.2 and 3.3 write the same move for an LP and a QP. Week 5 returns to this primal.
6. Practice
-
What does a Lagrange multiplier charge you for?
-
In the box-constraint picture, why can the star (constrained min) differ from the circle (unconstrained min)?
-
Why might you solve the dual instead of the primal, even though the primal is the problem you stated?