Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Lagrange multiplier
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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>.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Lagrange multiplier
(section)
Add topic