Lagrange Multipliers/System of Equations?

  • Thread starter scoobiedoober
  • Start date
  • Tags
    Lagrange
In summary, the conversation discusses using Lagrange multipliers to find all extrema of a function subject to a given constraint. The process involves setting the gradient of the function equal to the gradient of the constraint multiplied by a Lagrange multiplier. However, the conversation highlights the importance of considering different scenarios, such as when the Lagrange multiplier or one of the variables is equal to 0. It is suggested to restart the process multiple times, solving for different variables, to ensure all possible solutions are found.
  • #1
scoobiedoober
7
0

Homework Statement


I seem to be struggling a bit to understand how my prof solved this problem...I think it might be my diminishing system of equation skills, so forgive me if this doesn't belong in the calc section.

Use Lagrange multipliers to find all extrema of the function subject to the given constraint:

[tex]f(x,y)=y-x^2[/tex]

subject to:

[tex]g(x,y)=x^2+y^2=1[/tex]

Homework Equations



The local extrema should exist where the gradient of the function is equal to the gradient of the constraint, multiplied by a value (the Lagrange multiplier):

[tex]\nabla f = \lambda\nabla g[/tex]

The Attempt at a Solution



Solving for gradient f and g was no prob:

[tex]\nabla f = <-2x,1>[/tex]
[tex]\nabla g = <2x,2y>[/tex]

And this helps me setup a system of equations:

[tex]1) -2x = 2\lambda x[/tex]
[tex]2) 1 = 2\lambda y[/tex]
[tex]3) x^2+y^2 = 1[/tex]

Now at this point my professor "intuited" that with equation 1, to satisfy the equation, either x=0 or lambda = -1. I agree with it but I don't remember having to "intuit" things in a system of equations, I always remember it being a procedural solution. He takes these two conditions and runs with it and ends up finding the answers...

Now I'm sitting here trying to do it old-school procedurally, so I think equation 2 looks good:

[tex]2) y=\frac{1}{2\lambda}[/tex]

plug into 3

[tex]3) x^2 + (\frac{1}{2\lambda})^2 = 1[/tex]

solve for x:

[tex]x = +/-\sqrt{1-\frac{1}{4(\lambda)^2}}[/tex]

putting the positive version in equation 1:

[tex]1) -2(x) = 2 \lambda x[/tex]
[tex]1) -2 = 2 \lambda[/tex]
[tex]1) \lambda = -1[/tex]

I get the same answer with the positive version of x

[tex]1) \lambda = -1[/tex]

I go back to equation 2 to solve for Y:

[tex] 2) 1 = -2 y[/tex]
[tex] 2) -\frac{1}{2}=y[/tex]

Plugging lambda into my x = sqrt equation for x:

[tex]x = +/- \sqrt{\frac{3}{4}}[/tex]

So now I feel all warm and fuzzy, because I have my extrema locations:

[tex](-\sqrt{\frac{3}{4}}, -\frac{1}{2}); (\sqrt{\frac{3}{4}}, -\frac{1}{2})[/tex]

But looking back at my notes...the x=0 intuition that my professor deduced ended up being another extrema, which ended up leading to the ACTUAL maximum.

Did I screw something up? Is that "intuition" thing actually what I need to do to solve these things? Are there certain conditions that always require this kind of thinking? Is there an even better way to truly find all the solutions?
 
Physics news on Phys.org
  • #2
Hi scoobiedoober! :smile:

Things look good, but there are a few subtleties:

scoobiedoober said:

Homework Statement


I seem to be struggling a bit to understand how my prof solved this problem...I think it might be my diminishing system of equation skills, so forgive me if this doesn't belong in the calc section.

Use Lagrange multipliers to find all extrema of the function subject to the given constraint:

[tex]f(x,y)=y-x^2[/tex]

subject to:

[tex]g(x,y)=x^2+y^2=1[/tex]

Homework Equations



The local extrema should exist where the gradient of the function is equal to the gradient of the constraint, multiplied by a value (the Lagrange multiplier):

[tex]\nabla f = \lambda\nabla g[/tex]

The Attempt at a Solution



Solving for gradient f and g was no prob:

[tex]\nabla f = <-2x,1>[/tex]
[tex]\nabla g = <2x,2y>[/tex]

And this helps me setup a system of equations:

[tex]1) -2x = 2\lambda x[/tex]
[tex]2) 1 = 2\lambda y[/tex]
[tex]3) x^2+y^2 = 1[/tex]

Now at this point my professor "intuited" that with equation 1, to satisfy the equation, either x=0 or lambda = -1. I agree with it but I don't remember having to "intuit" things in a system of equations, I always remember it being a procedural solution. He takes these two conditions and runs with it and ends up finding the answers...

Now I'm sitting here trying to do it old-school procedurally, so I think equation 2 looks good:

[tex]2) y=\frac{1}{2\lambda}[/tex]

This only holds if [itex]\lambda\neq 0[/itex] (indeed, if it is 0, then you divide by 0!). So you must solve the case [itex]\lambda=0[/itex] separately.

So you end up with two systems, one where lambda is 0 and one where it is not.

plug into 3

[tex]3) x^2 + (\frac{1}{2\lambda})^2 = 1[/tex]

solve for x:

[tex]x = +/-\sqrt{1-\frac{1}{4(\lambda)^2}}[/tex]

putting the positive version in equation 1:

[tex]1) -2(x) = 2 \lambda x[/tex]
[tex]1) -2 = 2 \lambda[/tex]
[tex]1) \lambda = -1[/tex]

In the first step you divided both sides by x. This is only allowed if x is nonzero (otherwise you divide by 0!)! So you'll have to treat the case x=0 separately.

I get the same answer with the positive version of x

[tex]1) \lambda = -1[/tex]

I go back to equation 2 to solve for Y:

[tex] 2) 1 = -2 y[/tex]
[tex] 2) -\frac{1}{2}=y[/tex]

Plugging lambda into my x = sqrt equation for x:

[tex]x = +/- \sqrt{\frac{3}{4}}[/tex]

So now I feel all warm and fuzzy, because I have my extrema locations:

[tex](-\sqrt{\frac{3}{4}}, -\frac{1}{2}); (\sqrt{\frac{3}{4}}, -\frac{1}{2})[/tex]

But looking back at my notes...the x=0 intuition that my professor deduced ended up being another extrema, which ended up leading to the ACTUAL maximum.

Did I screw something up? Is that "intuition" thing actually what I need to do to solve these things? Are there certain conditions that always require this kind of thinking? Is there an even better way to truly find all the solutions?
 
  • #3
Alrighty, thanks! I guess my system-of-equation solving skills were always limited to linear systems. I'll just have to keep my eyes peeled for these "what if" scenarios in the future. Or maybe if I just restart the whole process multiple times with me starting by solving a different variable in every equation I will be safe.

for example: if I started solving equation (1) for x, I would see that x = 0, then I could run with that and get all the solutions I can. Then solve equation (1) for lambda, getting lambda = 1...and so on until I've expired every "starting" situation...It probably wouldn't be THAT much more work than doing these "what if" scenarios, because I imagine I would ultimately run into a bunch of repeated solutions in which I could stop at that point.
 
  • #4
scoobiedoober said:
Alrighty, thanks! I guess my system-of-equation solving skills were always limited to linear systems. I'll just have to keep my eyes peeled for these "what if" scenarios in the future. Or maybe if I just restart the whole process multiple times with me starting by solving a different variable in every equation I will be safe.

for example: if I started solving equation (1) for x, I would see that x = 0, then I could run with that and get all the solutions I can. Then solve equation (1) for lambda, getting lambda = 1...and so on until I've expired every "starting" situation...It probably wouldn't be THAT much more work than doing these "what if" scenarios, because I imagine I would ultimately run into a bunch of repeated solutions in which I could stop at that point.

It's not that hard really. Just solve the system first like you want to solve it. Then check your solution again to see if you didn't do anything illegal (like dividing by zero) and take these illegal values as special values for which you solve the system again...
 
  • #5
One generally good method of solving systems of equations that result from the Lagrange multiplier method is to first eliminate [itex]\lambda[/itex] by dividing one equation by another.

Here, your equations are [itex]−2x=2\lambda x[/itex] and [itex]1=2\lambda y[/itex]. If you divide the second by the first, [itex]-2x/1= -2x= (2\lambda x)/(2\lambda y)[/tex] or [itex]-2x= x/y[/tex] which gives either x= 0 or y= -1/2. Since you also have the condition that [itex]x^2+ y^2= 1[/itex], we have x= 0 and [itex]y= \pm 1[/itex] or y= -1/2 and [itex]x= \pm\sqrt{3}/2[/itex].
 
  • #6
scoobiedoober said:

Homework Statement


I seem to be struggling a bit to understand how my prof solved this problem...I think it might be my diminishing system of equation skills, so forgive me if this doesn't belong in the calc section.

Use Lagrange multipliers to find all extrema of the function subject to the given constraint:

[tex]f(x,y)=y-x^2[/tex]

subject to:

[tex]g(x,y)=x^2+y^2=1[/tex]

Homework Equations



The local extrema should exist where the gradient of the function is equal to the gradient of the constraint, multiplied by a value (the Lagrange multiplier):

[tex]\nabla f = \lambda\nabla g[/tex]

The Attempt at a Solution



Solving for gradient f and g was no prob:

[tex]\nabla f = <-2x,1>[/tex]
[tex]\nabla g = <2x,2y>[/tex]

And this helps me setup a system of equations:

[tex]1) -2x = 2\lambda x[/tex]
[tex]2) 1 = 2\lambda y[/tex]
[tex]3) x^2+y^2 = 1[/tex]

Now at this point my professor "intuited" that with equation 1, to satisfy the equation, either x=0 or lambda = -1. I agree with it but I don't remember having to "intuit" things in a system of equations, I always remember it being a procedural solution. He takes these two conditions and runs with it and ends up finding the answers...

Now I'm sitting here trying to do it old-school procedurally, so I think equation 2 looks good:

[tex]2) y=\frac{1}{2\lambda}[/tex]

plug into 3

[tex]3) x^2 + (\frac{1}{2\lambda})^2 = 1[/tex]

solve for x:

[tex]x = +/-\sqrt{1-\frac{1}{4(\lambda)^2}}[/tex]

putting the positive version in equation 1:

[tex]1) -2(x) = 2 \lambda x[/tex]
[tex]1) -2 = 2 \lambda[/tex]
[tex]1) \lambda = -1[/tex]

I get the same answer with the positive version of x

[tex]1) \lambda = -1[/tex]

I go back to equation 2 to solve for Y:

[tex] 2) 1 = -2 y[/tex]
[tex] 2) -\frac{1}{2}=y[/tex]

Plugging lambda into my x = sqrt equation for x:

[tex]x = +/- \sqrt{\frac{3}{4}}[/tex]

So now I feel all warm and fuzzy, because I have my extrema locations:

[tex](-\sqrt{\frac{3}{4}}, -\frac{1}{2}); (\sqrt{\frac{3}{4}}, -\frac{1}{2})[/tex]

But looking back at my notes...the x=0 intuition that my professor deduced ended up being another extrema, which ended up leading to the ACTUAL maximum.

Did I screw something up? Is that "intuition" thing actually what I need to do to solve these things? Are there certain conditions that always require this kind of thinking? Is there an even better way to truly find all the solutions?

Let me use the symbol u instead of [itex]\lambda[/itex]. Either x = 0 or [itex] x \neq 0[/itex]. If x = 0, what does eq.(3) say about y? What does eq.(2) say about u? If x is not zero, what does eq.(1) say about u? Then, what does eq.(2) say about y? Then, what does eq.(3) give you?

RGV
 

Related to Lagrange Multipliers/System of Equations?

1. What is the purpose of using Lagrange multipliers in a system of equations?

Lagrange multipliers are used to optimize a function subject to constraints. In a system of equations, they help find the maximum or minimum value of a function while satisfying the given constraints.

2. How do you know when to use Lagrange multipliers in a system of equations?

Lagrange multipliers are used when there are constraints present in the system of equations. These constraints can be in the form of equations or inequalities and must be satisfied in order to find the optimal solution.

3. Can Lagrange multipliers be used for both single-variable and multivariable functions?

Yes, Lagrange multipliers can be used for both single-variable and multivariable functions. In the case of single-variable functions, only one Lagrange multiplier is needed, while for multivariable functions, multiple Lagrange multipliers may be required depending on the number of constraints.

4. How do you find the optimal solution using Lagrange multipliers in a system of equations?

In order to find the optimal solution, the gradient of the objective function and the constraints are set equal to each other. This creates a system of equations that can be solved simultaneously to find the Lagrange multipliers, which can then be substituted into the objective function to obtain the optimal solution.

5. Are there any limitations to using Lagrange multipliers in a system of equations?

One limitation of using Lagrange multipliers is that they can only be used for constrained optimization problems. Additionally, the method may become computationally complex for systems with a large number of constraints or variables.

Similar threads

  • Calculus and Beyond Homework Help
Replies
8
Views
502
  • Calculus and Beyond Homework Help
Replies
10
Views
487
  • Calculus and Beyond Homework Help
Replies
4
Views
859
  • Calculus and Beyond Homework Help
Replies
6
Views
884
  • Calculus and Beyond Homework Help
Replies
16
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
575
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
424
  • Calculus and Beyond Homework Help
Replies
18
Views
1K
Back
Top