# Square of the distance function

I am confused about a certain type of problem.

I was taught that when solving for a point on a plane (must use partial derivatives) say, $x+y+z=1$ that is closest to the origin, we are to minimize the square of the distance function, i.e. minimize $f(x,y)=x^2+y^2+z^2$.

But I don't understand the intuition of why we do this. How could we know that we should minimize the square of the distance formula, and not just the distance formula itself?

Thanks

• Not to mention root functions are algebraically annoying – jameselmore Mar 24 '15 at 17:22

If the square of the distance function is minimized, then the distance function itself is minimized. And the square of the distance function is easier to work with, since it don't have that pesky square root in it.

For proof, for the distance function to be minimized, you need the derivative with respect to each coordinate to be zero. So $$\frac{\partial d}{\partial x}=0$$ But $$\frac{\partial (d^2)}{\partial x}=2d\frac{\partial d}{\partial x}$$ So if $d \neq 0$, the derivative of the square will be zero iff the derivative of the distance is zero.

Suppose we are trying to find the point $(x_0,y_0,z_0)$ that minimizes $h(f(x,y,z))$ where $h$ is a strictly increasing function. This means $h(x) < h(y)$ if $x < y$.

If $(x_0,y_0,z_0)$ minimizes $f$, then $f(x_0,y_0,z_0) \le f(x,y,z)$ for all $(x,y,z)$. Since $h$ is an increasing function, this means:

$$h(f(x_0,y_0,z_0)) \le h(f(x,y,z)).$$

Thus if we find the point that minimizes $f$ we find the point that minimizes $h\circ f$.

This is particularly useful in this case, since it means we don't have to bother with taking the derivative of a square root function and applying the chain rule.

If you are finding the roots of a function's derivative $f'(x)$, the $x$-values of the roots will coincide with those of $g'(f(x))$ if $g$ is strictly monotonic (over the domain of interest).

Can you prove this?