# Gradient of distance-squared on Riemannian manifold

Problem:

Let $$M$$ be a Riemannian manifold. Consider the function $$f: M \rightarrow \mathbb{R}$$ where $$f(x)=\text{dist}_M^2(p,x)$$, and $$p \in M$$ is fixed. Show that $$\text{grad}(f)=-2\exp^{-1}_x(p)$$ as vectors in $$T_xM$$. (Assuming that $$\exp^{-1}$$ exists and is smooth etc.)

My attempt at a proof:

We must show that $$\langle -2\exp^{-1}_x(p), \cdot \rangle_x = df(\cdot)$$ as 1-forms at $$x$$.

Let $$e_1,\dots,e_n$$ be an orthonormal basis of $$T_pM$$ and introduce normal coordinates at $$p$$: $$x=(x^1,\dots,x^n) \leftrightarrow x=\exp_p(x^i e_i)$$. If $$q=\exp_p(v)$$ then $$\text{dist}_M (p,q)=||v||_p$$ and so $$f(x)=||x^i e_i||^2_p=\sum (x^i)^2$$, where the second equality follows from the fact that the metric is the identity at $$p$$ (in these coordinates).

So $$df=\sum 2x^i dx^i$$. $$(*)$$

On the other hand, the geodesic "from x to p" is the same as the geodesic "from p to x", except that the direction is reversed. It should therefore be true that $$p=\exp_x(-S_{p \rightarrow x}x^i e_i )=\exp_x(-x^i S_{p \rightarrow x} e_i)$$ where $$S_{p \rightarrow x}$$ is the parallel transport from $$p$$ to $$x$$. Hence $$\exp^{-1}_x(p)=-\sum x^i S_{p \rightarrow x} e_i$$. Hence $$\langle -2\exp^{-1}_x(p), \cdot \rangle_x=\langle 2x^i S_{p \rightarrow x}e_i, \cdot \rangle = 2x^i \langle S_{p \rightarrow x} e_i, \cdot \rangle = 2x^i dx_i$$ which gives the result on comparison with $$(*)$$. $$\square$$

My question:

When writing that out, I felt like I was manipulating symbols without really understanding what they mean. For example, when I write $$x^i$$ I'm not sure whether I mean the coordinate function $$x^i$$ or its particular value at the point $$x$$. I was also concerned that when I talk about parallel transport I should really have been talking about the derivative of $$\exp$$. There's a lemma in Do Carmo which states $$\langle (D\exp_p)_v(v),D\exp_p)_v(w)\rangle=\langle v,w \rangle$$ for $$v \in T_pM$$ and $$w \in T_v(T_pM) \simeq T_pM$$. I can see this might be useful, though I'm not sure precisely how.

I would appreciate it very much if you checked to see if this proof is correct and "expand it out", particularly the second half) including more details to make clear what is going on.

• This paper (Foote, "Regularity of the distance function", Proceed. AMS 1984) may help you. – Giuseppe Negro Oct 30 '18 at 16:09

A straightforward computation one could do is : Let $$v\in (TM)_x$$. Let $$x(t)$$ be a curve such that $$x(0)=x$$ and $$x'(0)=v$$. Then $$df(x)(v)= \frac{d}{dt} d(p,x(t))^2|_{t=0}$$. Take a variation of the geodesic $$\gamma_0$$ joining $$p$$ to $$x$$, given by $$H(s,t)=\gamma_t(s)$$, where $$\gamma_t$$ is the geodesic joining $$p$$ to $$x(t)$$. Notice that $$\frac{d}{dt} d(p,x(t))^2|_{t=0}= 2 \frac{d}{dt} E(\gamma_t)|_{t=0}.$$ Use the first variation formula for energy (see for ex. Gallot Hulin Lafontaine) to find that $$\frac{d}{dt} E(\gamma_t)|_{t=0}=g(v,\gamma_0'(d(p,x))),$$ where $$g$$ is the metric. But $$\gamma_0'(d(p,x))$$ is the quantity we wanted to get. It follows now from the definition; $$g_x(\nabla(f),v)=df(x)(v)$$ for all $$v\in (TM)_x$$.