Find the maximum and minimum values of $f(x, y) = x^2 + y^2$
subject to the constraint $x^2 − 2x + y^2 − 4y = 0$
So I have to use lagrange multipliers
$ \nabla f(x,y) = \lambda\nabla g(x,y) $
$$ \nabla f(x,y)= <2x,2y> $$
$$ \lambda\nabla g(x,y) = \lambda<2x-2,2y-4> $$
making x and y the subjects gives:
$$ x = x\lambda - \lambda$$ $$ y = y\lambda - 2\lambda$$
I need to plug these x and y's back into the original constraint ($x^2 − 2x + y^2 − 4y = 0$), but I'm not sure how to go about it without having a very big equation. Any help here would be much appreciated.
You can divide one equation by the other. For this purpose we assume, for the moment, that the denominators are unequal $0$.
$\frac{x}{y}=\frac{x-1}{y-2}$
Multipliying both sides by $y$ and $y-2$
$x(y-2)=y(x-1)$
$xy-2x=yx-y$
Substracting xy on both sides.
$-2x=-y$
$2x=y$
Plugging in the term for y into the constraint.
$x^2-2x+(2x)^2-4\cdot 2x=0$
$5x^2=10x$
$x_1=2$ and $x_2=0$
Thus $y_1=4$ and $y_2=0$
This are the two critical points. Now you can use the bordered Hessian to determine if one is a maximum or a minimum.
The bordered Hessian is
H = $\left( \begin{array}{} 0 & g_{x} & g_{y} \\ g_{x} & L_{xx} & L_{yy} \\ g_{y} & L_{yx} & L_{yy}\end{array}\right)$
with $g=x^2-2x+y^2-4y$
And $L=x^2+y^2+\lambda(x^2-2x+y^2-4y)$
For example $L_{xx}=2+2\lambda$. You differentiate $L$ twice w.r.t. $x$. Thus you have to calculte $\lambda_1$ and $\lambda_2$ for the two different critical points. When you have calculated all values of H then you calculate the determinant of H.
If $det \ H(x_0,y_0) >0 \Rightarrow \texttt{it´s a (local) maximum}$
If $det \ H(x_0,y_0) <0 \Rightarrow \texttt{it´s a (local) minimum}$