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