Finding Max and Min values using Lagrange Multipliers

2.8k Views Asked by At

So I am given the function $x^2 + y^2$ and the constraint $x^2 -2x +y^2 -4y=0$. Must find max and min values (answers are $f(0,0)$ is a min and $f(2,4)$ is a max.) I use $\nabla f = \lambda \nabla g$. and get $x= \lambda(x-1)$ and $y=\lambda(y-2)$. Not sure if I messed up there or what, but I haven't been able to get to the answers once I plug $x$ and $y$ into the constraint. Any help at all is appreciated.

3

There are 3 best solutions below

2
On BEST ANSWER

The system that you should get is$$\left\{\begin{array}{l}x=\lambda(x-1)\\y=\lambda(y-2)\\x^2-2x+y^2-4y=0.\end{array}\right.$$From the first equation you get that $x=\frac\lambda{\lambda-1}$ and from the second equation you get that $y=\frac{2\lambda}{\lambda-1}$. Now, replace these values of $x$ and $y$ in the third equation in order to get $\lambda$:

0
On

You got the right equations, you should just explicit $x$ and $y$. If you do it then plug them into the constraint you get $$\frac{\lambda^2}{(\lambda-1)^2}-\frac{2\lambda(\lambda-1)}{(\lambda-1)^2}+\frac{4\lambda^2}{(\lambda-1)^2}-4\frac{2\lambda(\lambda-1)}{(\lambda-1)^2}=0, $$ hence $$-5\lambda(\lambda-2)=0, $$ so $\lambda = 0$ or $\lambda =2$, which fits with the answers you give.

0
On

Everything you did is perfectly fine.

Plug $ \,x=\dfrac{\lambda}{\lambda - 1}$ and $ y=\dfrac{2\,\lambda}{\lambda - 1}$ into the constraint.

You will get: $$\dfrac{5\,\lambda\,(2-\lambda)}{(\lambda-1)^2} = 0 \,\,\mbox{ where} \,\, \lambda\neq 1$$ So:
$$\lambda = 0\,,\,x=0\,,\,y=0$$ $$\lambda = 0\,,\,x=2\,,\,y=4$$ That all for your problem.
But be careful when working with tricky constraints, such as: $y-x^2 +4 = 0$
You will get: $$2x = \lambda\,(2x)$$ $$2y = \lambda$$ So: $$\lambda = -1$$ $$y = -0.5$$ Plugging back into the constraint: $-0.5 - x^2 +4 = 0$ $$ x\pm\sqrt{3.5}$$ The minima would be located at $ (\pm\sqrt{3.5},-0.5)$ for the constraint I gave you
But make sure to check for the boundaries as my constraint is not a circle like yours is.