Distance from plane to origin via Lagrange multipliers Let's say I have to find the least distance between origin and the plane $$x-2y-2z = 3$$
I know distance from origin to any $x-y-z$ plane is $\sqrt{x^2 + y^2 + z^2}$
so the constraint will be $$g(x, y, z) = x - 2y - 2z -3$$
however, what will my $f(x,y,z)$ be? Why is it possible to remove the sqrt and make it such that
$$
f(x,y,z) = x^2 + y^2 + z^2?
$$

By C-S $$\sqrt{x^2+y^2+z^2}=\frac{1}{3}\sqrt{(1^2+(-2)^2+(-2)^2)(x^2+y^2+z^2)}\geq\frac{1}{3}(x-2y-2z)=1.$$
The equality occurs for $(x,y,z)||(1,-2,-2)$ and $x-2y-2z=3,$ id est, occurs,
which says that we got a minimal value.
