# **Intuition** behind Lagrange Multipliers

Why does this method actually work?I learnt that a while ago and have been using it ever since. I apply it to almost every optimisation problem. This method just seemed too good to be true. Now, I wonder why this works. (The answer does not need to be rigorous, an intuitive sketch will work just fine for me.)

• Sep 29, 2016 at 18:56
• @arkeet I did not understand the answer to that post :(
– user369582
Sep 29, 2016 at 19:00

In the simplest case, there is a constraint curve $C:g(x,y)=0$ in the $xy$-plane. Above it is a surface $z=f(x,y)$. If all the points on $C$ are plugged into $f$, then you get some sort of path wondering around the hills and valleys of the surface. In a Lagrange problem, you want to find the highest (or lowest) elevation on that path.
If you look down at the $xy$-plane, you can see $C$ and also a bunch of concentric(-ish) level curves $k=f(x,y)$. Now you want find the level curve of $f$ with the largest $k$ that intersects $C$. So pick out a level curve and notice that it intersects $C$ a couple times. Now start increasing $k$. At some point, there will be a very last level curve that intersects $C$. In my mind the level curves are shrinking with increasing $k$ until that last curve is just touching $C$ and any larger $k$ gives a curve that misses $C$.
If these curves are smooth (the level curves and $C$) then the last time they touch, they are tangent to each other. Which means their slopes in the $xy$-plane are the same. Which means their normal vectors are parallel. Which means the gradients of the 2-variable parent functions are parallel. So we write $\nabla f = \lambda \nabla g$.
• @krazykode101 We don't assume $f$ takes a local maximum tangent to $g$, we assume the new curve given by $g(x,y)=0$ and $z=f(x,y)$ takes a local maximum. In regards to your second question, there are many such cases where the contour of $f$ intersects $g$ and they are not tangent, we just don't care about them since they don't represent an extreme point. Mar 2, 2023 at 18:49