Distance function is not differentiable but square of it is?

493 Views Asked by At

If we define square of the distance from a fixed point $p_0 \in R^3$ by the differentiable function $f(p) = \mid p-p_0 \mid^2, p \in S$, I read that the need for taking the square comes from the fact that the distance $\mid p-p_0 \mid$ is not differentiable at $p=p_0$. How does squaring the distance make a difference?

Thanks.

2

There are 2 best solutions below

0
On BEST ANSWER

It exactly like the absolute value function from $\mathbb R$ into itself. It is not differentiable at $0$, but its square (which is $x\mapsto x^2$) is.

0
On

For a point $p_0=(x_0,y_0,z_0)$ the distance function is defined by

$$f(x,y,z)=\sqrt{(x-x_0)^2+(y-y_0)^2+(z-z_0)^2}$$

we can take, without loss of generality $p_0=(0,0,0)$ then:

$$f(x,y,z)=\sqrt{x^2+y^2+z^2}$$

then:

\begin{align*} \frac{\partial f}{\partial x}(x,y,z)=\frac{x}{\sqrt{x^2+y^2+z^2}}\\ \frac{\partial f}{\partial y}(x,y,z)=\frac{y}{\sqrt{x^2+y^2+z^2}}\\ \frac{\partial f}{\partial z}(x,y,z)=\frac{z}{\sqrt{x^2+y^2+z^2}}\\ \end{align*}

Clearly at $(0,0,0)$ is not defined, so $f$ is not differentiable at $p_0$ (as you know the square root is not differentiable at 0).

But $f^2((x,y,z))=x^2+y^2+z^2$ and $\frac{\partial f}{\partial x}(x,y,z)=2x$ $\frac{\partial f}{\partial y}(x,y,z)=2y$ $\frac{\partial f}{\partial z}(x,y,z)=2z$