Calculating the laplacian of the scalar curvature Given a Riemannian manifold $(M, g)$, the scalar curvature of the metric $g$ is $g^{i j} Ric_{i j}$ in local coordinates. Now I want to calculate the laplacian of the scalar curvature in local coordinates and did something like $g^{i j} \nabla_{i} \nabla_{j} g^{p q}Ric_{pq} = g^{i j} \nabla_{i} (g^{pq} \nabla_{j} Ric_{pq}) = g^{i j} g^{p q}\nabla_{i} \nabla_{j} Ric_{pq}$. Is this correct? I have two concerns

*

*$\nabla_{i} \nabla_{j}$ should not be interpreted as $\nabla_{i}(\nabla_{j} g^{p q}Ric_{pq})$ because it is actually the $(i, j)$-th component of $\nabla \nabla$. However my impression is that when we are doing this kind of calculation, you do calculate first $\nabla_{j}g^{pq}Ric_{pq}$, why?

*I am using the fact that $\nabla_{j} g^{pq} = 0$, which presumably is derived from the fact that $\nabla g = 0$. $\nabla g = 0$ means that when you take the covariant derivative of a (0, 2) two tensor you get 0, but in the expression of the scalar curvature I do not think that $g^{pq}$ can be interpreted as the component of a (0, 2) tensor. To put it another way, the product rule works for covariant derivative on tensor products by definition but how do we interpret $g^{pq}Ric_{pq}$ as a tensor product?

 A: The Laplacian of a scalar function $u$ on a Riemannian manifold $(M, g)$ is defined to be
$$
\Delta u = \text{tr}(\text{Hess}(u)).
$$
I am using the notation Hess$(u)$ to denote the Hessian of $u$, which is a 2-covariant symmetric tensor field on $M$ defined by
$$
\text{Hess}(u)(X, Y) = (\nabla_X (du))(Y) \hspace{5mm} \forall X, Y \in T_p M.
$$
This is sometimes written as $\nabla^2 u$. A headache can arise from this notation in general; as alluded to in the previous answer/comments, $\nabla_X \nabla_Y u \neq (\nabla^2 u)(X, Y)$, as long as the left hand side is interpreted as $\nabla_X (\nabla_Y u)$. (A quick way to see that this equality does not hold in general is to note that the left hand side is not tensorial in $Y$, but the right hand side is.)
One can compute in arbitrary local coordinates $(x^\alpha)$ to see that
$$
\text{Hess}(u)_{\alpha\beta} = \partial_\alpha \partial_\beta u - \Gamma_{\alpha\beta}^\gamma \partial_\gamma u.
$$
Thus in general the Hessian on a Riemannian manifold has a first-order term which does not appear in flat space (!)
The trace of a 2-tensor $T$ is the contraction of $T$ with the  metric, i.e. $\text{tr}(T) = g^{\alpha\beta}T_{\alpha\beta}$. Thus,
$$
\Delta u = g^{\alpha\beta}\text{Hess}(u)_{\alpha\beta} = g^{\alpha\beta}\partial_\alpha \partial_\beta u - g^{\alpha\beta}\Gamma_{\alpha\beta}^\gamma \partial_\gamma u.
$$
One then proceeds with $u = R$, the scalar curvature.
More to your questions:

*

*I have seen the expression $\nabla_i \nabla_j T$ used tensorially, i.e. to mean the $i, j$ component of $\nabla^2 T$. To my mind, this is not typical; see e.g. the Wikipedia article https://en.wikipedia.org/wiki/Second_covariant_derivative. However, one can in general stop worrying about all of this by choosing at the point of computation a frame $e_i$ such that $\nabla_i e_j|_p = 0$. Then $\nabla_i \nabla_j T = \nabla^2_{i,j} T$.


*The expression $g^{ij}\text{Ric}_{ij}$ is the contraction of the tensor product $g^{-1} \otimes \text{Ric}$. Then one can use the tensor product Leibniz rule (as well as the fact that the connection commutes with contractions, and that $\nabla g = 0$) to obtain $\nabla_X (g^{ij}\text{Ric}_{ij}) = g^{ij}\nabla_X \text{Ric}_{ij}$. In practice to verify this one can introduce (cumbersome) notation like $C_{i,j}$ for contraction in indices $i, j$ and write $g^{ij}\text{Ric}_{ij}$ as $C_{1, 3} C_{2, 4}g^{-1} \otimes \text{Ric}$... This can be a pain, but is one way of verifying the manipulations common to this subject.
Also, brief remark that was already addressed in the previous answer: $\nabla g = 0$ is saying only that the covariant derivative of the metric tensor $g$ is zero, not of any 2-tensor; also, $g^{ij}$ is the component of a 2 (contravariant) tensor, namely $g^{-1}$.
A: First question: The expressions $\nabla_i\nabla_jg^{pq}R_{pq}$ and $(\nabla \nabla g^{pq}R_{pq})_{ij}$ are the same. The use of $\nabla_j$ in the first place is already a slight abuse of notation, i.e, what is typically written as $\nabla_ju^i$ is just a notational shorthand for the more precise $(\nabla u)^i{}_j$, the $(i,j)$ component of the covariant derivative of $u$. So the first object is just shorthand for the second one. The operator $\nabla \nabla$ is quite literally the covariant derivative composed with itself, taking them sequentially, with $\nabla_j$ first and $\nabla_i$ second, is exactly what you should do.
Second question: "means that when you take the covariant derivative of a $(0,2)$ tensor you get $0$" NO! The covariant derivative of a general $(0,2)$ tensor is not zero. But, the covariant derivative of the metric is zero, if you are using a torsion-free (Levi-Civita) connection.
Finally: Index gymnastics are really useful and save a lot of writing. Learn them. The notation is simplified greatly:
$$\Delta R=\nabla^j\nabla_j R^i{}_i$$
You can continue to expand this if you want:
$$=\nabla^j\partial_jR= g^{kj}\nabla_k\partial_jR\\ =g^{kj}\left(\partial_k\partial_lR-\Gamma^l_{kj}\partial_jR\right) \\ =\partial^j\partial_jR-g^{kj}\Gamma^l_{kj}\partial_l R$$
Not much you can do with the first term but, I believe there are some known answers for the contraction of the metric with the Christoffel symbols. See here
