Minimal distance from origin to quadric surface How can we find the shortest distance from the origin to the following quadric surface?
$$3x^2+y^2-4xz = 4$$
I see lagrangian multipliers being used, partials and such, but have trouble organizing into a different setting. Thanks.
 A: Minimize $x^2+y^2+z^2$ given $g(x,y,z)=3x^2+y^2-4xz=4$
Let $f(x,y,z,\lambda)=x^2+y^2+z^2+\lambda (3x^2+y^2-4xz-4)$
Now, using Lagrange Multiplier Method, 
$\frac{\partial f}{\partial x}=2x+6\lambda x-4\lambda z=0$
$\frac{\partial f}{\partial y}=2y+2y\lambda = 0$
$\frac{\partial f}{\partial z}=2z-4x\lambda = 0$
Also $3x^2+y^2-4xz=4 $
Solve these four equations in four variables, you will get the nearest point $(x,y,z)$
But, check Hessian also to assure whether point gives minima or maxima or saddle point.
A: You want to minimize the function 
$$f(x,y,z)=x^2+y^2+z^2$$
which represents the distance squared of a point with coordinates $(x,y,z)$ to the origin $(0,0,0)$ provided that point also lies on a quadratic surface with equation
$$g(x,y,z)=3x^2+y^2-4xz=4 \; .$$
Several techniques are possible. You could find an explicit formula for the coordinate $z$ in terms of $(x,y)$:
$$z=\frac{3x^2+y^2-4}{4x}$$
and substitute it into $f(x,y,z)$ which will give you a new function $\tilde{f}(x,y)$ of two variables. You now have to look for the minimum of this function. Also note that by constructing the explicit formula, we divided by $x$ and have excluded potential minima with $x=0$. These have to be handled separately.
The other most common technique is the technique of the Lagrange multipliers. Again, starting from the function and condition, you construct the Lagrangian
$$L(x,y,z,\lambda)=f(x,y,z)-\lambda(g(x,y,z)-4) \; .$$
You know look for the critical points of this Lagrangian by computing the partial derivatives to every variable and then equating the results to 0 each time. You thus obtain a set of 4 equations for 4 variables. The solutions of these equations are candidate minima for the function $f(x,y,z)$ satisfying the constraint $g(x,y,z)=4$. You thus are left with checking which of those are indeed minima.
