A student came to me with the following problem:
(a) Write down the distance between an arbitrary point $(x, y, z)$ and $(1, 1, 0)$.
(b) Use the method of Lagrange multipliers to find the minimum distance between the point $(1, 1, 0)$ and the ellipsoid $x^2 + y^2 + 3z^2 = 1$.
Part (a) is easy:
$$d(x,y,z) = \sqrt{(x-1)^2 + (y-1)^2 + z^2}$$
Part (b) is where I'm getting tripped up.
Define the following functions:
$$f(x,y,z) = (x-1)^2 + (y-1)^2 + z^2$$ $$g(x,y,z) = x^2 + y^2 + 3z^2 - 1$$
The corresponding Lagrange equations are:
$[\mathbf{x_0}] \quad 2(x-1) = 2x \cdot \lambda$
$[\mathbf{y_0}] \quad 2(y-1) = 2y \cdot \lambda$
$[\mathbf{z_0}] \quad 2z = 6z \cdot \lambda$
$[\mathbf{\lambda_0}] \quad x^2 + y^2 + 3z^2 = 1$
Solving $[\mathbf{z_0}]$ we obtain:
$[\mathbf{z_1}] \quad \lambda = 1/3$
Plugging this into $[\mathbf{x_0}]$ we obtain:
$[\mathbf{x_1}]\quad 2(x-1) = 2x \cdot 1/3$
$[\mathbf{x_2}]\quad 6(x-1) = 2x$
$[\mathbf{x_3}]\quad 6x-6 = 2x$
$[\mathbf{x_4}]\quad 4x = 6$
$[\mathbf{x_5}]\quad x = 3/2$
By symmetry we can solve $[\mathbf{y_0}]$ to obtain:
$[\mathbf{y_1}]\quad y = 3/2$
Plugging this into $[\mathbf{\lambda_0}]$ we obtain:
$[\mathbf{\lambda_1}]\quad (3/2)^2 + (3/2)^2 + 3z^2 = 1$
$[\mathbf{\lambda_2}]\quad 3z^2 = 1 - 9/2$
$[\mathbf{\lambda_3}]\quad z^2 = -7/6$
$[\mathbf{\lambda_4}]\quad \mathrm{False}$
Ideas, anyone?
After $2z = 6z \cdot \lambda,$ you concluded that $\lambda = 1/3,$ which is only one of two solutions to that equation. The other solution is $z=0.$
As you discovered, the solution $\lambda = 1/3$ leads to a contradiction later on. So, that solution (to the particular equation $2z = 6z \cdot \lambda$) turns out not to be a solution in the broader context of the problem (i.e., the system of all the equations).
So, you need to explore the other possibility, namely, $z=0.$ If $z=0$ then your system of equations becomes
$$\begin{align*} 2(x-1) &= 2x \cdot \lambda \\ 2(y-1) &= 2y \cdot \lambda \\ x^2 + y^2 &= 1. \end{align*}$$
I'll let you carry it forward from here.
(Hint: I'd recommend using the first two equations above to express $x$ and $y$ in terms of $\lambda,$ and substituting into the third equation to get an equation entirely in terms of $\lambda,$ which you can then solve.)