[Math] How to find the shortest distance between $z^2 -xy = 1$ and the origin using Lagrange multiplier

lagrange multipliermultivariable-calculus

My task is this:

Find the points on the surface $z^2 -xy = 1$ with the shortest distance to the origin.

My work so far:

Let $f(x,y,z) = x^2 + y^2 + z^2$ and $g(x,y,z)=z^2 -xy -1$ then we have to solve:

$\nabla f = \lambda\nabla g \to \begin{pmatrix}2x\\2y\\2z\end{pmatrix} = \lambda\begin{pmatrix}-y\\-x\\2z \end{pmatrix}$, if $z = 0$ then I get the points $(\pm \sqrt{2}, \pm \sqrt{2}, 0)$ which are not even on the graph. If $z \neq 0$ then $\lambda = 1 \to x= -y/2, y = -x/2$. Substituting this into our constraint we get:

$z = \pm\sqrt{1- y^2/2}$ or $z = \pm \sqrt{1 -x^2/2}$. Im stuck here and need some help. Any hints or better approach would be appriciated!

Best Answer

If $z=0$ you have: $$ \begin{aligned} 2x&=-\lambda y\\ 2y&=-\lambda x\\ xy&=-1 \end{aligned} $$ and the first two of these imply that $\lambda^2=4$ and that $x=y$ or $x=-y$ and the first of these is incompatible with $x$ and $y$ being real and satisfying the third equation. So you are left with $x=-y$ and $xy=-1$...

If $z \ne 0$ we have $\lambda=1$ and so: $$ \begin{aligned} 2x&=- y\\ 2y&=- x\\ \end{aligned} $$ which force $x=y=0$ and so to satisy the constraint $z^2=1$ ...

... and to cut a long story short the case $z\ne 0$ gives the points of minimum distance from the origin, and that distance is $1$