Visual walkthrough — Lagrange multipliers — one and two constraints
4.4.15 · D2· Maths › Multivariable Calculus › Lagrange multipliers — one and two constraints
Step 1 — "Optimize on a constraint" ka matlab kya hai
KYA. Hamare paas ek landscape hai: ek function jo flat plane ke har point par ek height deta hai. Humein bataya gaya hai ki hum sirf ek particular path par khade ho sakte hain — zameen par ek curve bana hua hai, jo equation se describe hota hai. Hum us path par rehte hue reachable sabse zyada (ya kam) height chahte hain.
YEH FRAMING KYU. Bina kisi rule ke, best point wahan hoga jahan poora landscape peak karta hai. Rule zyaadatar zameen ko forbid karta hai. Toh answer badal jaata hai: constrained best usually free best nahi hota.
PICTURE. Figure dekho. Wavy shading hai: jitna bright = utna zyada height. Yellow curve allowed path hai. Hum sirf yellow curve par chalne ki permission hai, aur hum uska highest-brightness point dhundhte hain (red dot).

Related idea: yahan ki shading Level sets and contours ki ek picture hai jo brightness mein flatten ki gayi hai.
Step 2 — Path ko ek moving dot mein badlo: parametrization
KYA. Yellow curve par chalne ki baat karne ke liye, hum apni position ek single dial se describe karte hain (ise time ya distance walked samjho). Har par hum ek point par hote hain
Yahan position vector hai (origin se jahan hum khade hain wahan ka arrow), aur hamare do coordinates hain, dono dial ghoomane par change hote hain.
KYU. Ek constraint ek poori curve hoti hai — infinitely many points. Usse directly optimize karna mushkil hai. Lekin jab hum ek dial se uske saath ride karte hain, toh height ek ordinary one-variable function ban jaata hai, aur hum jaante hain ek one-variable hill ka top kaise dhundhte hain: uski slope zero hoti hai.
PICTURE. Red dot yellow curve par slide karta hai jab badhta hai. Chota green arrow woh direction hai jis taraf hum ja rahe hain — path ka tangent. Yeh hamesha curve ke saath point karta hai, kabhi us se off nahi.

Step 3 — Best spot par, height badalna band ho jaati hai
KYA. Maano woh highest point hai jo hum curve par reach kar sakte hain. Kyunki restricted height ab sirf ek dial ka normal function hai, uska top wahan hoga jahan uski slope vanish hoti hai:
KYU. Yeh plain one-variable fact hai: maximum par graph momentarily flat hota hai — thoda aage ya peeche jao aur tum higher nahi ho. Abhi kuch bhi multivariable nahi; humne sirf woh fact curve par transport kiya.
PICTURE. Map ke neeche hum "elevation profile" plot karte hain — height versus jab tum yellow path par march karte ho. Us profile ka peak directly red dot ke upar map par baitha hai. Peak par profile flat hai: slope .

Step 4 — Chain rule se slope decode karo → gradient se milo
KYA. Jab hum chalte hain toh kaise badlta hai? Do cheezein combine hoti hain: har direction mein kitna steep hai, aur hum kis taraf kadam rakh rahe hain. Chain rule unhe bundle karta hai:
Naye symbol ko unpack karte hain.
"" dot product hai: yeh do arrows ko multiply karta hai aur ek single number return karta hai jo measure karta hai ki wo direction mein kitna agree karte hain. Yeh exactly sahi tool hai kyunki height-change-per-step precisely "mera kitna step uphill jaata hai" hai — jo meri step aur uphill arrow ke beech agreement hai.
KYU dot product aur kuch nahi? Humein ek rule chahiye jo big ho jab main seedha uphill chalu, zero jab main slope ke across chalu, negative jab main downhill chalu. Dot product exactly yahi karta hai: , jahan uphill arrow aur meri step ke beech angle hai. Slope ke along chalo () → → koi height change nahi.
PICTURE. Red dot par hum blue gradient arrow (steepest uphill) aur green step arrow (path ke along) draw karte hain. Unka overlap — ek ka doosre par shadow — hai height change ki rate.

Step 5 — Consequence: path ke perpendicular hona chahiye
KYA. Step 3 (slope ) aur Step 4 (slope ) combine karo:
Do nonzero arrows ka dot product zero hota hai exactly tab jab wo perpendicular hote hain. Toh best point par, uphill arrow hamare step direction ke perpendicular (⟂) hai.
KYU yeh har path ke liye hold karna chahiye. Hum curve par kisi bhi direction mein chal sakte the (forward ya backward ); dono tangent directions hain. Kyunki tangent ke liye, ka curve ke along bilkul koi component nahi hai. Agar uska hota sideways-along-path component, toh hum us taraf step kar ke higher climb kar sakte — "best point" ko contradict karte.
PICTURE. Red dot par, blue arrow yellow curve ke saath clean right angle par khada hai. Hum tiny tangent segment shade karte hain; blue arrow naa aage jhukta hai naa peeche.

Step 6 — Doosre perpendicular arrow se milo:
KYA. Constraint curve set hai. Jab hum ise chalte hain, kabhi nahi badlta (woh rehta hai). Us fact ko path ke along differentiate karo:
Left side hai kyunki poori curve par constant () hai. Toh : ka gradient bhi path ke perpendicular hai.
KYU. us direction mein point karta hai jahan fastest badhta hai — level curve se seedha off, bade ki taraf. Naturally woh curve ke right angles par hota hai, jo woh direction hai jahan constant rehta hai. Yeh exactly "surface ka normal vector" wala idea hai, dekho Tangent planes and normal vectors.
PICTURE. Same red dot, ab red arrow draw hai — yellow curve se directly off point karta hua, uske perpendicular, blue ke saath.

Step 7 — Ek curve ke do perpendiculars parallel hone chahiye: the Lagrange condition
KYA. Plane mein, ek curve ka sirf ek perpendicular direction hota hai (ek single line "off the curve"). Step 5 ne us line par rakha; Step 6 ne us same line par rakha. Ek line par do arrows ek doosre ke scalar multiples hote hain:
Term by term:
- ::: objective ka uphill arrow (path ke along vanish hona chahiye).
- ::: constraint-ke-perpendicular arrow.
- ::: Lagrange multiplier — woh single number jo batata hai ki se match karne ke liye ko kitni baar scale karna hai. Uska sign batata hai ki dono same ya opposite direction mein point karte hain.
Aur hum location equation ko nahi bhool sakte:
KYU koi bhi sign ya zero ho sakta hai.
- : aur same taraf point karte hain.
- : woh opposite taraf point karte hain (dono abhi bhi curve ke perpendicular — perpendicular ke do directions hote hain).
- : , yaani free (unconstrained) critical point happen to curve par hai; constraint "push nahi kar raha". Yeh Unconstrained optimization — critical points ka bridge hai.
PICTURE. Derivation ka finale: optimum par blue aur red arrows collinear hain — same line, possibly alag lengths aur directions. Optimum se off (faint dot) woh aligned nahi hain, aur ka green tangential component dikhata hai ki tum abhi bhi climb kar sakte ho.

Step 8 — Degenerate cases jo tum skip nahi kar sakte
KYA & KYU. Clean picture assume karti thi ki aur curve smooth thi. Jab woh break hota hai, argument break hota hai — toh extrema wahan chhup sakte hain.
- Singular point, . Tab ki koi direction nahi, toh " parallel to " empty hai — equation force karti hai , jo true extremum par hona zaruri nahi. Example: ek curve jisme sharp corner (cusp) hai. Tip max ho sakti hai, phir bhi koi use describe nahi karta. Tumhe yeh points by hand check karne chahiye.
- Level curves tangent ("kissing" view). Optimum par curve , ki ek level curve ke tangent hoti hai — woh cross kiye bina touch karti hain. Agar woh cross karti, toh ek side par higher hoti, toh tum wahan move karte. Tangency same fact hai jaise "gradients parallel", dekha Level sets and contours ke through.
PICTURE. Left: ek cusp jahan aur Lagrange blind hai. Right: ki level curves (faint rings) constraint ko red dot par kiss karti hain — ka geometric twin.

Ek-picture summary
Sab ek saath: shaded landscape , yellow constraint , ki level rings red optimum par use kiss karti hain, aur do collinear arrows curve ke perpendicular khade hain.

Recall Walkthrough ki Feynman retelling
Tum ek hilly field mein ek fenced trail par hiking kar rahe ho. Tum trail chodhe bina sabse oonchi jagah chahte ho. Toh tum bas chalte ho. Jab tak zameen abhi bhi trail ke forward along tilt karti hai, tum chadhte rehte ho. Tum wahan rukते ho jahan remaining tilt sirf sideways across the trail hai — aage chalne se kuch nahi milta. "Uphill trail ke across sideways point karta hai" matlab steepest-uphill arrow () trail ke perpendicular hai. Lekin fence ka apna "straight-off-me" arrow () bhi trail ke perpendicular hai. Flat 2-D mein sirf ek perpendicular line hoti hai, toh dono arrows us par saath lie karte hain — same line, maybe alag lengths: woh scaling number hai. Fence mein kinks ke liye dhyan rakho (sharp corner mein well-defined "off" direction nahi hoti) — wahan tumhe khud dekhna hoga, kyunki arrow trick khamosh ho jaati hai.
Connections
- Lagrange multipliers — one and two constraints — parent result jo yeh page visually derive karta hai.
- Gradient and directional derivative — as steepest ascent, Step 4.
- Tangent planes and normal vectors — as the surface normal, Step 6.
- Level sets and contours — "kissing level curves" view, Step 8.
- Unconstrained optimization — critical points — limiting case, Step 7.
- Dual problem and shadow prices — ka baad mein meaning.