Local coordinates identities Given $(M,g)$ Riemannian manifold, $f \in \mathcal{C}^{\infty}(M)$, I want to prove that the following holds (denoting by $D\,df $ the Hessian of the function $f$ and $\text{grad} f$ its gradient):
$$2D\,df (\text{grad} f,\text{grad} f) = \langle \text{grad}  \,|\text{grad} f|^2, \text{grad} f\rangle$$
I tried doing this:
Start from $$D\,df (\text{grad} f,\text{grad} f) = D_{\text{grad} f}D_{\text{grad} f}(f)$$ Then since we can write in coordinates $\text{grad} f = g^{ij}\frac{\partial f}{\partial x^i} \, \frac{\partial f}{\partial x^j}$ then we have:
$$D_{\text{grad} f} \, (g^{ij}\frac{\partial f}{\partial x^i} D_{\frac{\partial }{\partial x^j}}f)$$
Now, since $f$ is a function, the covaiant derivative of $f$ along $\frac{\partial }{\partial x^j} $ is $ \frac{\partial f}{\partial x^j}$ so we get:
$$D_{g^{ab}\frac{\partial f}{\partial x^a}\frac{\partial f}{\partial x^b}}g^{ij}\frac{\partial f}{\partial x^i}\frac{\partial f}{\partial x^j}$$
getting
$$g^{ab}\frac{\partial f}{\partial x^a}\left[\frac{\partial}{\partial x^b}\left(g^{ij}\frac{\partial f}{\partial x^i}\frac{\partial f}{\partial x^j}\right)\right]$$
In an analogous fashion, if I develop in coordinates this term $\langle \text{grad} f \,|\text{grad} f|^2, \text{grad} f\rangle$ I get:
$$\langle \text{grad} \left( g^{i \alpha}\frac{\partial f}{\partial x^i}\frac{\partial f}{\partial x^\alpha} \right), \text{grad} f\rangle$$ and tracing with the metric we end up with:
$$g^{aA}\frac{\partial f}{\partial x^A}\left[\frac{\partial}{\partial x^a}\left(g^{i\alpha}\frac{\partial f}{\partial x^i}\frac{\partial f}{\partial x^\alpha}\right)\right]$$
First I ask if I am doing the computations correctly, and then why I do not get a $2$, I think I misssed something. Thanks!
 A: The $\textit{Hessian}$ ($\nabla df$) of a differentiable function $f\,:\,M\to \mathbb{R}$ on a Riemannian manifold $M$ is
\begin{equation}
  \nabla df=\left(\frac{\partial^2f}{\partial x^k \partial x^a}-\Gamma^{m}_{ka}\frac{\partial f}{\partial x^m}\right)dx^k\otimes dx^a \tag{1}
\end{equation}
It is easy enough to plug in $\mathrm{grad} f$ as the arguments (and multiply by 2)
\begin{equation}
2\nabla df(\mathrm{grad}f,\mathrm{grad}f)=2\left(\frac{\partial^2f}{\partial x^k \partial x^a}-\Gamma^{m}_{ka}\frac{\partial f}{\partial x^m}\right)\frac{\partial f}{\partial x^b}g^{ab}\frac{\partial f}{\partial x^v}g^{kv}\tag{2}
\end{equation}
Now that we know what we are looking for we move to the right side of the equation
\begin{equation}
|\mathrm{grad}f|^2=g^{ab}\frac{\partial f}{\partial x^a}\frac{\partial f}{\partial x^b} \tag{3}
\end{equation}
\begin{equation}
<\mathrm{grad}|\mathrm{grad}f|^2,\mathrm{grad}f>=g^{kv}\frac{\partial }{\partial x^k}\left(g^{ab}\frac{\partial f}{\partial x^a}\frac{\partial f}{\partial x^b}\right)\frac{\partial f}{\partial x^v} \tag{4}
\end{equation}
Before we evaluate the tedious partial derivatives we remind the reader that an affine connection $\nabla$ is a Riemann connection if it preserves the metric $\nabla g=0$ or equivalently $\nabla_X g=0$ for all vector fields $X$ on $M$. We say that the metric is "compatible" with the connection. In component notation this means that the (partial) covariant derivative of the symmetric nonsingular (2,0) tensor $g^{ab}$ vanishes identically:
\begin{equation}
\nabla_k g^{ab}=\frac{\partial g^{ab}}{\partial x^k}+\Gamma^{a}_{mk}g^{mb}+\Gamma^{b}_{mk}g^{am}=0
\end{equation}
\begin{equation}
\frac{\partial g^{ab}}{\partial x^k}=-\Gamma^{a}_{mk}g^{mb}-\Gamma^{b}_{mk}g^{am}\tag{5}
\end{equation}
notice how $k$ is an index in the above expression, not a vector.
Now we are ready to expand the partial derivatives (and please remember the Leibniz (product) rule).
\begin{equation}
\frac{\partial }{\partial x^k}\left(g^{ab}\frac{\partial f}{\partial x^a}\frac{\partial f}{\partial x^b}\right)=\frac{\partial g^{ab}}{\partial x^k}\frac{\partial f}{\partial x^a}\frac{\partial f}{\partial x^b}+ g^{ab}\frac{\partial^2 f}{\partial x^k \partial x^a}\frac{\partial f}{\partial x^b}+ g^{ab} \frac{\partial f}{\partial x^a}\frac{\partial^2 f}{\partial x^k \partial x^b}\tag{6}
\end{equation}
Obviously the last two terms of $(6)$ are the same and after some dummy index renaming, using $(5)$ and the symmetric property of the metric we end up with
\begin{equation}
\frac{\partial }{\partial x^k}\left(g^{ab}\frac{\partial f}{\partial x^a}\frac{\partial f}{\partial x^b}\right)=2g^{ab}\frac{\partial^2 f}{\partial x^k \partial x^a}\frac{\partial f}{\partial x^b}-2 g^{ab} \frac{\partial f}{\partial x^m}\frac{\partial f}{\partial x^b}\Gamma^m_{ak} \tag{7}
\end{equation}
Putting this back in $(4)$ we have exactly $(2)$
