# Lagrange Multipliers

## Homework Statement

Lagrange multipliers to find the maximum and minimum values of f(x,y) = 4x^3 + y^2 subject to the constraint 2x^2 + y^2 = 1. Find points of these extremum.

## The Attempt at a Solution

g(x,y)= 2x^2 + y^2 - 1
f(x,y)= 4x^3 + y^2

Gradient = 4x^3 + y^2 - λ(2x^2 + y^2 - 1)
= [12x^2- λ4x, 2y - 2λy, -2x^2 - y^2 - 1]
12x^2 - λ4x = 0
3x = λ

2y - 2λy = 0
λ= 1

x = 1/3 (Is this correct?)

fx (x,y) = 12x^2 x=0
fy (x,y) = 2y y=0

No minima or maxima is my conclusion but I'm very sure it's wrong. Also is the 3-D representation somewhat like a paraboloid with a ellipsoid constraint?

Thanks!

Related Calculus and Beyond Homework Help News on Phys.org
vela
Staff Emeritus
Homework Helper

## Homework Statement

Lagrange multipliers to find the maximum and minimum values of f(x,y) = 4x^3 + y^2 subject to the constraint 2x^2 + y^2 = 1. Find points of these extremum.

## The Attempt at a Solution

g(x,y)= 2x^2 + y^2 - 1
f(x,y)= 4x^3 + y^2

Gradient = 4x^3 + y^2 - λ(2x^2 + y^2 - 1)
= [12x^2- λ4x, 2y - 2λy, -2x^2 - y^2 - 1]
That's not right. The gradient doesn't equal 4x^3 + y^2 - λ(2x^2 + y^2 - 1), and 4x^3 + y^2 - λ(2x^2 + y^2 - 1) doesn't equal [12x^2- λ4x, 2y - 2λy, -2x^2 - y^2 - 1].

12x^2 - λ4x = 0
3x = λ
You lost a solution by dividing by 0. It's better to divide out the 4 and factor the remaining expression.
$$3x^2 - \lambda x = x(3x-\lambda) = 0$$ This way you can see there are two possible solutions — the one you found, $3x=\lambda$, and the one you didn't, x=0.

2y - 2λy = 0
λ= 1
Again, you missed a solution.

x = 1/3 (Is this correct?)
This is one possibility. To get here, you assumed x≠0, so that you can say that x=λ/3, and y≠0, from which you deduced λ=1. You still need to solve for y and then plug it back into f(x,y).

Then you need to go back and find the other solutions and test those as well.

fx (x,y) = 12x^2 x=0
fy (x,y) = 2y y=0

No minima or maxima is my conclusion but I'm very sure it's wrong. Also is the 3-D representation somewhat like a paraboloid with a ellipsoid constraint?

Thanks!

Thank you for telling me about the factoring method with which I was able to recover a solution.

However, I am a bit confused about the purpose of lambda here - I now have x= lambda/3 , x=0 , y=0, and lambda = 1 as my solutions. How can I plug these in to f (x,y) to check for maxima and minima? Won't it just give me the value of the function in terms of lambda (for two of them)?

vela
Staff Emeritus
Homework Helper
You have three conditions that need to hold:
\begin{align*}
x(3x-\lambda) &= 0 \\
y(\lambda-1) &= 0 \\
2x^2 + y^2 -1 &= 0
\end{align*} and you'll need to consider several different cases. You're looking for combinations of values for x, y, and $\lambda$ that will satisfy all three conditions simultaneously. Primarily, though, you're interested in finding x and y. Their relationship to $\lambda$ may help you find x and y, but you may not need to consider $\lambda$ at all.

To satisfy the first condition, you can have $x=0$, $x=\lambda/3$, or both. To satisfy the second condition, you need $y=0$, $\lambda=1$, or both. Finally, x and y have to satisfy the constraint.

So far, you looked at the case where $x=\lambda/3$ and $\lambda=1$. You want to consider what happens if you assume x=0. Can y=0? Why not? What can y be? Similarly, you want to consider cases where y=0 and you solve for x.

Thank you for explaining that - I was thoroughly confused and I think I understand it a bit better.

So for x= 0, y=+/-1
And for y=0, x= +/- 1/sqrt(2)

When you plug the first solution in to f(x,y) for x=0, you get f(x,y)= 1.
The second solution gives you either f(x,y) = 2/sqrt(2) or -2/sqrt(2)

And then from these values, how do you presume a minima and a maxima? Or am I doing it all wrong?
Thank you.

Never mind I think I got it.

Is the minima at (-1/sqrt(2), 0) and the maxima at (1/sqrt(2), 0)?

Thanks!

vela
Staff Emeritus
Homework Helper
Yes, that's right.

By the way, minima and maxima are, respectively, plurals of minimum and maximum.

HallsofIvy
Homework Helper

## Homework Statement

Lagrange multipliers to find the maximum and minimum values of f(x,y) = 4x^3 + y^2 subject to the constraint 2x^2 + y^2 = 1. Find points of these extremum.

## The Attempt at a Solution

g(x,y)= 2x^2 + y^2 - 1
f(x,y)= 4x^3 + y^2
This was supposed to be "2yj", not "24yj", right?

Don't use "f" and "g" in one place and "F" and "G" in another!

Gradient = 4x^3 + y^2 - λ(2x^2 + y^2 - 1)
What? This is f= λg, not a gradient at all.

= [12x^2- λ4x, 2y - 2λy, -2x^2 - y^2 - 1]
12x^2 - λ4x = 0
3x = λ

2y - 2λy = 0
λ= 1

x = 1/3 (Is this correct?)

fx (x,y) = 12x^2 x=0
fy (x,y) = 2y y=0

No minima or maxima is my conclusion but I'm very sure it's wrong. Also is the 3-D representation somewhat like a paraboloid with a ellipsoid constraint?

Thanks!
Rather than "grad f+ λgrad g= 0", I prefer "grad f= λ grad g", which, of course, is the same thing. From grad f= 12x^2i+ 2yj and grad g= 4xi+2yj, we have 12x^2i+ 2yj= λ(4xi+ 2yj).
Separating the components, 12x^2= 4λx and 2y= 2λy.

I find that often the best way to eliminate λ, which is not part of the solution, is to divide one equation by the other: 12x^2/2y= 4x/2y or 6x^2/y= 2x/y. Multiplying both side by y, 6x^2= x, 6x^2- x= 0, x(6x- 1)= 0 so x= 0 or x= 1/6.

We also have the constraint 2x^2+ y^2= 1. If x= 0 then y= 1 or -1. If x= 1/6 then 1/18+ y^2= 1 so y^2= 17/18.

Ray Vickson
Homework Helper
Dearly Missed
Never mind I think I got it.

Is the minima at (-1/sqrt(2), 0) and the maxima at (1/sqrt(2), 0)?

Thanks!
There are three local maxima and three local minima; of the maxima, one is global and the two others are local; ditto for the minima.

So, you have found two of the six possible solutions to the Lagrange conditions. You can get them all by being very careful when solving the Lagrange optimality equations; in particular, be careful not to discard some values like x = 0 or y = 0, etc.

Another way go gain insight into the problem is to look at the equivalent problem of optimizing
$$F(\theta) = f\left(\frac{\cos(\theta)}{\sqrt{2}},\sin(\theta) \right), \: 0 \leq \theta \leq 2 \pi.$$
This just amounts to switching to polar coordinates for $X = x \sqrt{2}$ and $Y = y$. Also, it may help to note that $F(\theta)$ is a cubic polynomial in $z = \cos(\theta)$ that you need to maximize or minimize for $z \in [-1,1]$. Of course, your instructor may not accept a solution based on this representation (because it does not use the requested Lagrange multiplier approach), but the insights you can get from the new view may help you deal with what is happening in the Lagrangian approach.

Last edited: