Hessian of a function on a Riemannian manifold. I know this question has been asked on this site before, but due to the huge variety of notations in differential geometry, my confusion still remains.
In the homework I have been working on, the following definition of Hessian was given:
Hess$f:=\nabla^2f:=\nabla$d$f$
But, in the solutions, the following identity was used:
Hess$f(X,Y)=X(Y(f))-$d$f(\nabla_XY)$
A similar identity (with different notation) was also given in the wikipedia page for Hessian. My question: is the following derivation of the given identity correct?
$X(Y(f))=\nabla_X($d$f(Y))\underline{=\nabla_X\nabla f(Y)+\nabla_XY(\nabla f)}=\nabla_X\nabla f(Y)+\nabla_XY($d$ f)=\nabla\nabla f(X,Y)+$d$f(\nabla_XY)$
I feel like something is not right. I have used the product rule on the underlined term, as "it felt right" although I can't find anything about it (d$f$(Y) is a vector field and covector field applied onto eachother such that the result is a function, but I can't find anything on the Internet about the variation of the Leibnitz rule in this specific case.).
 A: The Leibniz rule says that if $\alpha$ is a $1$-form and $X$, $Y$ are vector fields, then $X(\alpha(Y)) = (\nabla_X\alpha)(Y) + \alpha(\nabla_XY)$.
(Side note: It is also true with Lie derivatives, for instance $X(\alpha(Y)) = (L_X\alpha)(Y) + \alpha(L_XY)$.
More generally, this is usually how we define the action of derivations to other tensors than vector fields.)
Apply this to $\alpha = df$: this yields
$$
X(Yf) = (\nabla_Xdf)(Y) + df(\nabla_XY).
$$
To conclude, note that $(\nabla_Xdf)(Y) = (\nabla df)(X,Y)$ is just a matter of notations.
Alternatively, you can use the equivalent idea: $df(Y) = c(Y\otimes df)$ where $c$ is the contraction, and $\nabla_X$ commutes with contractions.
It follows from the Leibniz rule on tensors products $\nabla_X(T\otimes S) = (\nabla_XT)\otimes S + T\otimes (\nabla_XS)$ that
$$
X(Yf) = \nabla_X \left(c(Y\otimes df)\right) = c \left( \nabla_X(Y\otimes df)\right)=c (\nabla_XY\otimes df + Y\otimes \nabla_Xdf).  
$$
Now, you can conclude by linearity of the contraction.
