MethodMath
Ask
Join
HomeTopicsAskAlerts
Profile

© 2026 MethodMath. Built for mathematical knowledge sharing.

AboutContactGuidelinesPrivacyTermsCookies
Liam Henderson
Apr 21, 2026

How to solve constrained optimization problems using Lagrange multipliers?

I'm studying multivariable calculus and I need to understand the method of Lagrange multipliers for constrained optimization.

I understand that to find the extrema of f(x,y)f(x,y)f(x,y) subject to g(x,y)=0g(x,y) = 0g(x,y)=0, we solve:

\ablaf=λ\ablag\abla f = \lambda \abla g\ablaf=λ\ablag
g(x,y)=0g(x,y) = 0g(x,y)=0

But why does this work? What is the geometric intuition behind setting the gradients proportional? And how do I apply it to a concrete problem like maximizing f(x,y)=xyf(x,y) = xyf(x,y)=xy subject to x2+y2=1x^2 + y^2 = 1x2+y2=1?

Also, how do I determine whether the critical point is a maximum or minimum?

1 answers265 views

1 Answer

3
Aisha Mohammed
Apr 22, 2026
Accepted
**Geometric Intuition:** At a constrained extremum, the level curve of $f$ must be tangent to the constraint curve $g(x,y) = 0$. The gradient $\ abla f$ is perpendicular to level curves of $f$, and $\ abla g$ is perpendicular to the constraint. At tangency, these normals are parallel: $\ abla f = \lambda \ abla g$. The scalar $\lambda$ (the Lagrange multiplier) tells you how sensitive the optimal value is to changes in the constraint. **Applied to $f(x,y) = xy$ with $x^2 + y^2 = 1$:** **Step 1:** Compute gradients: $$\ abla f = (y, x), \quad \ abla g = (2x, 2y)$$ **Step 2:** Set $\ abla f = \lambda \ abla g$: \begin{align*} y &= 2\lambda x \\ x &= 2\lambda y \end{align*} **Step 3:** Multiply the first by $x$ and the second by $y$: $$xy = 2\lambda x^2, \quad xy = 2\lambda y^2$$ Thus $2\lambda x^2 = 2\lambda y^2$, so either $\lambda = 0$ or $x^2 = y^2$. If $\lambda = 0$, then $y = 0$ and $x = 0$, which fails $x^2 + y^2 = 1$. So $x^2 = y^2$ which means $y = \pm x$. **Step 4:** Substitute into $x^2 + y^2 = 1$: - If $y = x$: $2x^2 = 1 \Rightarrow x = \pm 1/\sqrt{2}, y = \pm 1/\sqrt{2}$ - If $y = -x$: $2x^2 = 1 \Rightarrow x = \pm 1/\sqrt{2}, y = \mp 1/\sqrt{2}$ **Step 5:** Evaluate $f$: - $f(1/\sqrt{2}, 1/\sqrt{2}) = 1/2$ (maximum) - $f(-1/\sqrt{2}, -1/\sqrt{2}) = 1/2$ (maximum) - $f(1/\sqrt{2}, -1/\sqrt{2}) = -1/2$ (minimum) - $f(-1/\sqrt{2}, 1/\sqrt{2}) = -1/2$ (minimum) To classify max vs min without evaluating $f$, you can use the **bordered Hessian** or simply compare function values. The method extends to multiple constraints: $\ abla f = \sum \lambda_i \ abla g_i$.
2 comments
Raj Patel
Raj PatelMay 12, 2026

The tangency intuition is brilliant — the gradient alignment condition finally makes geometric sense to me.

Liam HendersonApr 22, 2026
Exactly, the level curve of $f$ must be tangent to $g = 0$ at any constrained extremum. This is one of the most beautiful ideas in multivariable calculus.
Still unsure? Join to comment or ask a follow-up.
Login or Register to post your answer

Suggested questions

Do I need Calculus 3 before learning Fourier series?

3494

Does 1+2+3+4+... really equal -1/12? Math explained

25.6k

I asked ChatGPT to solve this integral and it gave a wrong answer. Can you check it?

21k

Why does 0 factorial equal 1 instead of 0? Simple proof

31.4k

Does the Banach-Steinhaus theorem hold for non-complete normed spaces?

31.1k