Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Lagrange multiplier
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Example 1 === [[Image:Lagrange very simple.svg|thumb|right|300px|Illustration of the constrained optimization problem '''1''']] Suppose we wish to maximize <math>\ f(x,y) = x+y\ </math> subject to the constraint <math>\ x^2 + y^2 = 1 ~.</math> The [[Candidate solution|feasible set]] is the unit circle, and the [[level set]]s of {{mvar|f}} are diagonal lines (with slope β1), so we can see graphically that the maximum occurs at <math>\ \left(\tfrac{1}{\sqrt{2}}, \tfrac{1}{\sqrt{2}}\right)\ ,</math> and that the minimum occurs at <math>\ \left(-\tfrac{1}{\sqrt{2}}, -\tfrac{1}{\sqrt{2}}\right) ~.</math> For the method of Lagrange multipliers, the constraint is <math display="block"> g(x,y) = x^2 + y^2-1 = 0\ ,</math> hence the Lagrangian function, <math display="block">\begin{align} \mathcal{L}(x, y, \lambda) &= f(x,y) + \lambda \cdot g(x,y) \\[4pt] &= x + y + \lambda (x^2 + y^2 - 1)\ , \end{align}</math> is a function that is equivalent to <math>\ f(x,y)\ </math> when <math>\ g(x,y)\ </math> is set to {{math|0}}. Now we can calculate the gradient: <math display="block">\begin{align} \nabla_{x,y,\lambda} \mathcal{L}(x , y, \lambda) &= \left( \frac{\partial \mathcal{L}}{\partial x}, \frac{\partial \mathcal{L}}{\partial y}, \frac{\partial \mathcal{L}}{\partial \lambda} \right ) \\[4pt] &= \left ( 1 + 2 \lambda x, 1 + 2 \lambda y, x^2 + y^2 -1 \right) \ \color{gray}{,} \end{align}</math> and therefore: <math display="block">\nabla_{x,y,\lambda} \mathcal{L}(x , y, \lambda)=0 \quad \Leftrightarrow \quad \begin{cases} 1 + 2 \lambda x = 0 \\ 1 + 2 \lambda y = 0 \\ x^2 + y^2 -1 = 0 \end{cases}</math> Notice that the last equation is the original constraint. The first two equations yield <math display="block"> x = y = - \frac{1}{2\lambda}, \qquad \lambda \neq 0 ~.</math> By substituting into the last equation we have: <math display="block"> \frac{1}{4\lambda^2} + \frac{1}{4\lambda^2} - 1 = 0\ ,</math> so <math display="block"> \lambda = \pm \frac{1}{\sqrt{2\ }}\ ,</math> which implies that the stationary points of <math>\mathcal{L}</math> are <math display="block">\left(\tfrac{\sqrt{2\ }}{2}, \tfrac{\sqrt{2\ }}{2}, -\tfrac{1}{\sqrt{2\ }}\right), \qquad \left(-\tfrac{\sqrt{2\ }}{2}, -\tfrac{\sqrt{2\ }}{2}, \tfrac{1}{\sqrt{2\ }} \right) ~.</math> Evaluating the objective function {{mvar|f}} at these points yields <math display="block">f\left(\tfrac{\sqrt{2\ }}{2}, \tfrac{\sqrt{2\ }}{2}\right) = \sqrt{2\ }\ , \qquad f\left(-\tfrac{\sqrt{2\ }}{2}, -\tfrac{\sqrt{2\ }}{2} \right) = -\sqrt{2\ } ~.</math> Thus the constrained maximum is <math>\ \sqrt{2\ }\ </math> and the constrained minimum is <math>-\sqrt{2}</math>.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)