Lagrange Multipliers Intuition ELI5
TLDR
- Lagrange multipliers is a constrained optimization method
- Lagrange multipliers restricts solutions to points that are feasible and stationary
- Key intuitive points:
of our constraint function is normal to the surface. If , the function we want to optimize, is also normal to the surface, it is parallel to - If a point satisfies this parallelism, it is feasible and stationary.
- The lagrangian, that combines the constraints and main function into one function, lets you use calculus to find these stationary points where
, since they are parallel they must be a multiple of one another.
The method of Lagrange multipliers is a constrained optimization technique. I first came across it in my Calculus 3 class, and probably knew less about it after “learning” it.
Motivation
Imagine we want to optimize a function
The canonical and good choice of an example to show is a constraint of a circle.
TODO: figure.
We note two key points about our functions
Convince me
With that in mind, secondly now consider what
What does it mean when it is normal to the surface, and when they are parallel? Well, if we can ONLY move along the feasible region to decrease the function we want to minimize, but the direction of maximal change is normal to the feasible region, we are stuck! This means we have a stationary point.
Convince me
If we are atAnd since we are maximizing/minimizing, what if some of these points were optima - possibly global optima?
We can find them and test them out, using lagrange multipliers.
Shoptalk
We noted that at some feasible points,
What if we created a function that let’s us find where this happens? That’s where our lagrangian function comes into play.
We have moved our constraints into this one function. And when we derive
We take the gradient of our lagrangian function w.r.t each variable, get a system of equations to solve, and come up with variables to plug in.
More to come
- What do we do if our constraint is an inequality? KKT
- Does lagrange multipliers always work?
- More detailed version with all math.