<s>[INST] Lagrange multiplier - find minima of a function satisfying a condition I am supposed to find the points (x,y,z) satisfying the condition $x^2+2y^2-z^2-1=0$ that are the closest to origin (0,0,0).
So basically, the idea was to find the minima of
$$\Lambda(x,y,z,\lambda) = \sqrt{x^2+y^2+z^2}+\lambda(x^2+2y^2-2z^2-1)$$
For that I determined
$$\Lambda_x(x,y,z,\lambda) = \frac{x}{\sqrt{x^2+y^2+z^2}} + 2\lambda x$$
$$\Lambda_y(x,y,z,\lambda) = \frac{y}{\sqrt{x^2+y^2+z^2}} + 4\lambda y$$
$$\Lambda_z(x,y,z,\lambda) = \frac{z}{\sqrt{x^2+y^2+z^2}} - 2\lambda z$$
But that would mean for $\lambda \neq 0$
$$\lambda_1 = -\frac{1}{2\sqrt{x^2+y^2+z^2}}$$
$$\lambda_2 = -\frac{1}{4\sqrt{x^2+y^2+z^2}}$$
$$\lambda_3 = \frac{1}{2\sqrt{x^2+y^2+z^2}}$$
Since $\lambda_1 \neq \lambda_2 \neq \lambda_3$ doesn't that mean that this function doesn't have any minima? I'm probably having a huge misunderstanding somewhere, but I just can't figure out where I went wrong, so please help me with this.
 [/INST] The problem with your reasoning is that it assumes that neither $x$, $y$ or $z$ is $0$, but this is false!
It's easier to solve this problem using the square of distance instead. The distance is always positive, so if you minimize the square of distance, you'll minimize the distance too.
We have:
$$\Lambda(x,y,z,\lambda) = x^2+y^2+z^2 + \lambda(x^2+2y^2-z^2-1)$$
Therefore:
\begin{align*}
\Lambda_x(x,y,z,\lambda) &= 2x + 2\lambda x &= 0 \\
\Lambda_y(x,y,z,\lambda) &= 2y + 4\lambda y &= 0 \\
\Lambda_z(x,y,z,\lambda) &= 2z - 2\lambda z &= 0 \\
\Lambda_\lambda(x,y,z,\lambda) &= x^2+2y^2-z^2-1 &= 0
\end{align*}
Or:
\begin{align*}
(1+\lambda)x &= 0 \\
(1+2\lambda)y &= 0 \\
(1-\lambda)z &= 0 \\
x^2+2y^2-z^2-1 &= 0
\end{align*}
For each of the first three equations use: If $a \cdot b = 0$, then $a = 0$ or $b = 0$. It'll enable you to find $(x, y, z)$ that minimizes the distance.
Also, notice that $x^2+2y^2-z^2-1 = 0$ is a hyperboloid of one sheet. Look at its plot and try to guess the points that minimize the distance. Compare with your answer above.
</s>