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.
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$.