# Minimizing a function using lagrange multipliers.

We need to minimize $f(x,y) = x^{2}+y^{2}$ with subject to $xy=1$ using lagrange multipliers.

What I did :

We solve the equations $f_x = \lambda g_x$ and $f_y = \lambda g_y$ simultaneously where $g(x,y)=xy-1$.

$=> 2x=\lambda y$ and $2y=\lambda x$ , solving these gives , either $x=0$ or $\lambda^{2}-4=0$ , Since $x$ can't be zero as it would not satisfy $xy=1$ when $x=0$ , $=> \lambda^{2}-4=0$ which gives , $\lambda = -2 , 2$ , using this $\lambda$ we get $x=y$ or $x=-y$ ,

Using this , our main function becomes $f(x) = x^{2}+x^{2}$ , so , $f^{'}(x)=4x$ , equating to zero again gives $x=0$ which can't be a solution.

Whereas , directly substituting $y= \dfrac{1}{x}$ in $f(x,y)=x^{2} +y^{2}$ , gives the required solution and hence gives $2$ as its minimum value..

My point is , why does the lagrange multiplier technique fails here ? Or am I doing something wrong ? Could anyone help ?

• The mistake you are doing is that after finding $x=\pm y$ as a solution for the optimizer, you are again differentiating the function $f(x,y)$. Actually $x=\pm y$ fixes the values of $x,y$ through the condition $xy=1$, so you cannot differentiate at this stage. Sep 19, 2015 at 6:48

To solve for $x$ and $y$, you have to plug the result you got after solving for $\lambda$ into the constraint $xy=1$, not into the function that you're trying to minimize. In effect, what you've done is wandered off of the $xy=1$ curve and instead minimized the function along the line $x=y$.