# Calculus: Maximum and minimum of two variables function

Determine the shortest distance between the point $P = (2, 1, -1)$ and the plane $x + y - z = 1$. Anyone could help me please? Thank you.

Hint:

For the point $(x_0,y_0,z_0)$ and the equation of the plane ($ax+by+cz+d=0$), we have the shortest distance (length):

$$\displaystyle L = \frac{|ax_0 + by_0 + cz_0 + d|}{\sqrt{a^2 + b^2 + c^2}}$$

• Well done. Very helpful hint! +1 Apr 15 '13 at 0:29

Using inner product (also known as dot product) you can represent the plane as: $$A=\{x\in \mathbb{R}^3 / <x,(1,1,-1)> = 1 \}$$ Where $(1,1,-1)$ is the vector normal to the plane. Then you know that the shortest distance from $P$ to the plane is obtained through a perpendicular line from $P$ to the plane $A$, reaching a point $P_0$. The shortest distance between the plane $A$ and the point $P$ will be $||P-P_0||$, we also know that $P-P_0$ is perpendicular to the plane $A$ and therefore parallel to $(1,1,-1)$: $$P-P_0 = k (1,1,-1)$$

Finally we know that $||P-P_0||^2=<P-P_0,P-P_0>=k^2 ||(1,1,-1)||$, then: $$k^2 ||(1,1,-1)||^2=<P-P_0,P-P_0>=<P-P_0,k(1,1,-1)>$$ $$k^2 ||(1,1,-1)||^2=k<P,(1,1,-1)>-k<P_0,(1,1,-1)>$$ $$k^2 ||(1,1,-1)||^2=k(<P,(1,1,-1)>-<P_0,(1,1,-1)>)$$ We substitute $P=(2,1,-1)$ and since $P_0$ belongs to the plane $A$, we have that $<P_0,(1,1,-1)>=1$. $$k^2 ||(1,1,-1)||^2=k(4-1)$$ $$k^2 (3) = k(3)$$ $$k=1$$ Then $||P-P_0||=||k(1,1,-1)||=(1)\sqrt 3=\sqrt 3$ . (if something's not clear let me know)

If you are being asked to show your method,which leads to the formula in Amzoti's answer, you may use the fact that the shortest distance from a plane to a point not on that plane (an "external point") lies along a line perpendicular to the plane. The direction of that line for a plane $ax + by + cz = d$ is the "normal vector" $< a, b, c >$.

The normal line through the external point $( X, Y, Z )$ is then given in parametric form by $t = (x - X)/a = (y- Y)/b = (z - Z)/c$ . For this problem, the normal line through $( 2, 1, -1 )$ is then $t = (x - 2)/1 = (y - 1)/1 = (z + 1)/[-1]$. Solve for each of the coordinate variables,

$$x = 1 \cdot t + 2 , y = 1 \cdot t + 1 , z = [-1] \cdot t - 1 ,$$

and substitute these into the plane equation to get (t + 2) + (t + 1) + (-t - 1) = 1 . You can then insert the solution for the parameter $t$ into each of the coordinate equations to obtain the coordinates of the point in the plane $x + y - z = 1$ to obtain the point in that plane closest to the external point $(2, 1, -1)$ (you should obtain the result Inquest shows under the "spoiler box"). The "distance formula" will then give the perpendicular and thus shortest distance.

Generalizing this method produces the formula Amzoti posted. The constrained optimization described by Inquest can be used both to prove that the shortest distance to the plane is the "perpendicular distance" and to arrive at the general formula.

\begin{align} \min &(x-2)^2+(y-1)^2+(z+1)^2\\ s.t. \\ x+y-z&=1 \end{align}

You can use constrained nonlinear optimization to solve this.

One Way: \begin{align} L &=(x-2)^2+(y-1)^2+(z+1)^2 - \lambda(x+y-z-1)\\ \partial L&=\begin{pmatrix}2(x-2)\\2(y-1)\\2(z+1)\end{pmatrix}-\lambda\begin{pmatrix}1\\1\\-1\end{pmatrix} =0\\ \text{Thus,}\\2(x-2)-\lambda&=0\\ 2(y-1)-\lambda&=0\\ 2(z+1)+\lambda&=0\\x+y-z&=1\\ \vdots\\ \vdots \end{align} The answer is

$(x,y,z)=(1,0,0)$