Using Lagrange multiplier to find the shortest distance from the origin to a given Set

287 Views Asked by At

An exercise of an old exam wants me to find the point with the shortest distance to the origin which is in $M=\{(x,y): x^2y=2, x>0\}$.

So I think the function I have to minimize is $f(x,y)=\sqrt{(x^2+y^2)}$ with the condition $g(x,y)=x^2y-2$

Then Lagrange says that $$\nabla f = \lambda\nabla g \to \begin{pmatrix}\frac{x}{\sqrt{x^2+y^2}}\\ \frac{y}{\sqrt{x^2+y^2}}\end{pmatrix} = \lambda\begin{pmatrix}2xy\\x^2 \end{pmatrix}$$ But here is the point I get stuck.

Since the point has to be in $M$ it follows that $y=\dfrac{2}{x^2}$.

so $$\begin{pmatrix}\frac{x}{\sqrt{x^2+y^2}}\\ \frac{y}{\sqrt{x^2+y^2}}\end{pmatrix} = \lambda\begin{pmatrix}\frac{4}{x}\\x^2 \end{pmatrix}$$ But that does not really help me to get any further. Thanks for your help.

2

There are 2 best solutions below

3
On BEST ANSWER

If I were you, I will use a simpler way. Since $y=\frac{2}{x^2}$, the distance is $d(x)^2=x^2+\frac{4}{x^4}$. Applying the AM-GM inequality, we have $$ d(x)^2=\frac{x^2}{2}+\frac{x^2}{2}+\frac{4}{x^4}\geq 3 \sqrt[3]{\frac{x^2}{2}\cdot \frac{x^2}{2}\cdot \frac{4}{x^4}}\geq 3. $$ The identity holds when $x^6=8$ and hence $x=\sqrt{2}$ (since $x>0$). The shortest distance is $\sqrt{3}$.

If you really want to use Lagrange multiplier, let us consider $$ F(x,y)=x^2+y^2 $$ under side condition $$ G(x,y)=x^2y-2. $$ Then we need to find $(x,y,\lambda)$ such that $$ 0=F_x-\lambda G_x= 2x-2\lambda xy \quad 0=F_y-\lambda F_y= 2y-\lambda x^2 $$ and the side condition. The first equation implies $\lambda=1/y$ and hence $2y^2=x^2$ by the second one. Since $y=2/x^2$, we know that $x=\sqrt{2}$.

3
On

The point with minimal distance is the point where the square of the distance is minimal (as you have been told in the comments). So, you get the system$$\left\{\begin{array}{l}2x=2\lambda xy\\2y=\lambda x^2\\x^2y=2.\end{array}\right.$$There is no solution such that $x=0$. Therefore, this system is equivalent to$$\left\{\begin{array}{l}\lambda y=1\\2y=\lambda x^2\\x^2y=2.\end{array}\right.$$Since $\lambda$ cannot be $0$, you can replace $y$ by $\frac1\lambda$ in the second and third equations, getting $x^2=\frac2{\lambda^2}$ and $x^2=2\lambda$. So, $\frac2{\lambda^2}=\lambda$ and therefore $\lambda=1$. So, the solutions are $(x,y)=\pm\left(\sqrt 2,1\right)$. Can you take it from here?