# Related Methods: Lagrange Multipliers

It really pains me to ask this question, but I was working on an optimization problem and wanted to show a friend how we could also use Lagrange Multipliers to solve it.

I was considering the standard problem of finding the maximum area of a rectangle under a parabola. Let the parabola be given by, $f(x)=4-x^2$ and the area of the rectangle is given by $A(x,y) = 2xy$.

I make a new function and look at it's zero level surface namely, $h(x,y) = y-4+x^2 =0$. Now, $\nabla h(x,y) = (2x,1), \nabla A(x,y) = (y,x)$. I want, $(2x,1) = \xi (y,x)$.\

Can someone tell me where I am going wrong? This is also a result of me using legrange multipliers for the first time.

-
I think the area should be $2xy$ – TylerHG Jun 29 '14 at 4:50
Doesn't matter. You'll just end up dividing out by it in the end. – Mr.Fry Jun 29 '14 at 4:50

The function we want to maximize $f(x,y)=2xy$, the constraint function is $g(x,y)=y+x^2-4=0$. The condition that must be satisfied is $\nabla f=-\lambda\nabla g$. This gives us two equations:

$$\left(\begin{array}\\2y\\2x \end{array}\right)=-\lambda\left(\begin{array}\\2x\\1 \end{array}\right)$$

$$y=-\lambda x ; 2x=-\lambda$$ $$\lambda=-\frac{y}{x}$$

Then:

$$x^2=\frac{y}{2}$$

Now we plug this into $g$ to find that $y=8/3$. Then putting that into our $x^2$ equation we find that $x=\frac{2}{\sqrt{3}}$. You will obtain the same results by plugging the parabola equation into the area function and then differentiating and setting it equal to zero. This answer is not $3$.

-
Why is lamda negative? – Mr.Fry Jun 29 '14 at 5:35
It's just convention. I'm guessing because the differential equation system $\nabla f+\lambda\nabla g=0$ looks prettier that way. @Rod – TylerHG Jun 29 '14 at 5:41

From $$(y,x)=\lambda(2x,1)$$ you get $(x,y)=(\lambda,2\lambda^2)$. Since this point must lie on the parabola, $y=4-x^2$ must hold, so: $$2\lambda^2 = 4-\lambda^2,\quad \lambda^2=\frac{4}{3}$$ and the maximum value for the area is $2xy=4\lambda^3=\frac{32}{9}\sqrt{3}.$

We double-check this. The maximum for $$g(x) = x(4-x^2)$$ is attained when $g'(x)=4-3x^2=0$, hence at $x=\frac{2}{\sqrt{3}}$, ok.

-
Thanks a lot. .... – Mr.Fry Jun 29 '14 at 5:35

If you want to use Lagrange multipliers for this problem, your function is $$F=x y+a(y-4+x^2)$$ Now compute the partial derivatives and impose them to be equal to zero $$F'_x=2ax+y=0$$ $$F'_y=a+x=0$$ $$F'_a=y-4+x^2=0$$ Using successive eliminations leads to two possible solutions $$\left\{\left\{x\to -\frac{2}{\sqrt{3}},y\to \frac{8}{3},a\to \frac{2}{\sqrt{3}}\right\},\left\{x\to \frac{2}{\sqrt{3}},y\to \frac{8}{3},a\to -\frac{2}{\sqrt{3}}\right\}\right\}$$ and so $A=\frac{2}{\sqrt{3}} \times \frac{8}{3}=\frac{16}{3 \sqrt{3}}$.

Not using Lagrange multipliers, $y$ can be eliminated from the constraint and then $$A=xy=x(4-x^2)$$. So, $A'_x=4-3 x^2$ which cancels for $x=\frac{2}{\sqrt{3}}$ which in turn gives $y=\frac{8}{3}$ and $A=\frac{16}{3 \sqrt{3}}$.

-
Thanks a lot. I was being dumb. – Mr.Fry Jun 29 '14 at 5:36