Closest point to a surface using Lagrange multipliers

calculusfunctionsmultivariable-calculusoptimizationvector analysis

I know how to solve constrained problems if I am given the surface and the restriction. But I'm a little lost on the application of this for finding the closest point.

Using Lagrange multipliers, how could I find the closest points of $z = x^2-y^2+1$ to the origin? What would be the reasoning for it?

What about if the it was the closest from another set, let's say, the closest points from $y = x$ to $y = x^2+2$. What is the reasoning behind solving these kinds of problems using Lagrange's Multipliers?

Best Answer

You want to minimize the distance from a point $p$ that lies on the surface to the origin. First, you have three variables $x$, $y$, $z$, i.e. the three coordinates of the point $p$.

Second, the objective function is $$ f(x,y,z) = (x-0)^2+ (y-0)^2 + (z-0)^2 = x^2+y^2+z^2. $$ Note that we use the distance squared. This is because the distance squared is minimal if and only if the distance is minimal. But the distance squared function makes the calculations easier; there is no square root, so the derivative becomes easier. This is a standard trick.

And finally, the constraint is given by $g(x,y,z) = x^2 - y^2 + 1 - z = 0$, which is basically the equation for the surface. Now you can write down the Lagrangian function $L(x,y,z,\lambda) = f(x,y,z) - \lambda g(x,y,z)$ and proceed to solve the problem.

Your second problem goes as follows: We have two points $p$ and $q$, each lying on a surface. What is their minimal distance? This problem is basically the same, but you have more variables and constraints.

First, you have 6 variables, namely 3 for the point $p=(x_1,y_1,z_1)$ and 3 for the point $q=(x_2,y_2,z_2)$. The objective function now becomes $f(x_1,\ldots,z_2)=(x_1-x_2)^2+(y_1-y_2)^2 + (z_1-z_2)^2$. And finally, there are two constraints, namely $g(x_1,y_1,z_1)=x_1-y_1 = 0$ and $h(x_2,y_2,z_2)=x_2+2 - y_2 = 0$. Now the Lagrangian becomes $$ L(x_1,\ldots,z_2,\lambda,\mu) = f(x_1,\ldots,z_2) - \lambda g(x_1,y_1,z_1) - \mu h(x_2,y_2,z_2).$$

Related Question