Confusion about covariant derivatives I have the following confusion about covariant derivatives. Let $(M,g)$ be a Riemannian manifold with Levi-Civita connection $\nabla$ and let $f$ be a scalar function on $M$. The Hessian of $f$, denoted by $\nabla^2f$, is by definition a rank 2 tensor. However, I'm wondering whether $\nabla_{X}\nabla_{Y}f$ is the same as $\nabla^2f(X,Y)$ for vector fields $X,Y$ on $M$. If not, then what would be the interpretation of $\nabla_{X}\nabla_{Y}f$? Obviously, we are not evaluating $\nabla_{Y}f$ and $\nabla_{X}(\nabla_{Y}f)$ sequentially, since otherwise we would get the usual partial derivatives.
 A: Given a tensor $T$ of type $(0,q)$ and given a vector field $X$, the covariant derivative $\nabla_XT$ is still a tensor of type $(0,q)$, which can be made  explicit as follows:
$$(\nabla_XT)(Y_1,...,Y_q)= X(T(Y_1,...,Y_q))-\sum_i T(Y_1,\dots,\nabla_XY_i,\dots,Y_q)$$
(note that $T(Y_1,...,Y_q)$ is a function $\varphi$ on $M$, so $X(\varphi)=d\varphi(X)$ is well-defined and equals $\nabla_X\varphi$).
This expression is tensorial in $X$. Thus, given a Tensor $T$ of type $(0,q)$, we can define $\nabla T$, a tensor $(0,q+1)$,  as follows:
$$(\nabla T)(X,V_1,...,V,q)=(\nabla_XT)(V_1,...,V_q)$$
In this way $\nabla$ is seen as an operator from tensors $(0,q)$ to tensors $(0,q+1)$. We can therefore consider $\nabla^2=\nabla\circ\nabla$ from $(0,q)$-tensors to $(0,q+2)$ tensor. (And all this remains true also for tensors $(p,q)$).
Now, if $f$ is a function (a $(0,0)$ tensor), then its $(0,2)$ Hessian is just $$Hess(f):=\nabla\nabla f.$$
Let's compute it explicitly:
$Hess(f)(X,Y)=(\nabla\nabla f)(X,Y)$. Now we set $T=\nabla f$, that is to say $T(Y)=\nabla_Yf=Y(f)$, and we apply the above formula. We get:
$(\nabla\nabla f)(X,Y)=(\nabla T)(X,Y)=(\nabla_X T)(Y)=X(T(Y))-T(\nabla_XY)=\nabla_X(\nabla_Yf)-\nabla_{\nabla_XY}f$
So $$\nabla^2f(X,Y)=X(Y(f))-\nabla_{\nabla_XY}f$$
So, coming back to your questions:

*

*$\nabla_X(\nabla_Yf))=X(Y(f))$, denotes indeed usual derivatives: first along $Y$ and then along $X$; and


*$\nabla^2f(X,Y)$ is different from $\nabla_X\nabla_Yf$, the difference being the term $\nabla_{\nabla_XY}f$.
All these calculations generalise when $f$ is a tensor and not just a function.
A: Given $X,Y$ arbitrary vector fields, we define the hessian of $f$ as the $(0,2)$ tensor given by
$$
H_f(X,Y)=X(Yf)-(\nabla_X Y)(f).
$$
The expression in coordinates takes the form $(H_f)_{ij}=f_{;ij}$, where $f_{;ij}=\partial_{j}\partial_{i}f - \Gamma_{ji}^k \partial_{k}f$, and in particular in a normal chart $f_{;ij}=\partial_{j}\partial_{i}f$.
We can take the $(1,1)$ tensor relative to $H_f$, which I denote by $h_f$ and is the unique operator that
$$
g(h_f(X),Y)=H_f(X,Y).
$$
In fact, $h_f(X)=\nabla_X \nabla f$ (where $\nabla f$ is the gradient of $f$) and in a normal chart we can write $(h_f)_i^j=(H_f)_{ik}g^{jk}$.
Furthermore, due to $(\nabla_X df)(Y)=X(df(Y))-df(\nabla_X Y)=X(Yf)-(\nabla_X Y)(f)$, we can rewrite the hessian as $H_f=\nabla (df)$.
