Let $\nabla$ be a Riemannian connection, $\Delta$ be the Laplacian defined as $\text{tr}_g \nabla^2$. The equation I want to show is $$ \Delta\nabla_i f = \nabla_i\Delta f + \sum_{j} Ric_{ij} \nabla_jf $$ where $Ric$ is the Ricci curvature tensor, $f$ is a smooth function. The proof my text gives is (they use the convention that basically $g_{ij} = \delta_{ij}$ which I am not using)
$$ \Delta \nabla_i f = \nabla_j\nabla_i\nabla_j f = \nabla_i\nabla_j\nabla_j f - R_{jijk} \nabla_k f $$
...which I understand 0% about it. My guess is that the first interchange $$ \begin{align*} \Delta\nabla_i f &= \sum_{j,k}g^{jk}\nabla_j\nabla_k\nabla_i f = \sum_{j,k}g^{jk}\nabla_j\nabla_i\nabla_k f \end{align*} $$ is free since $\nabla_i\nabla_j f = \nabla_j \nabla_if$ and $\nabla$ has no torsion. But what about the second one (i.e. how do we interchange $\nabla_j$ and $\nabla_i$?)
Edit: so I've found and use the Ricci identity for 1-forms
$$ (\nabla_i \nabla_j - \nabla_j \nabla_i) w(\partial_k) = w(R(\partial_j,\partial_i)\partial_k) = \sum_{l} w^l R_{jik}^l $$ put $w = \nabla f$ says $$ (\nabla_i \nabla_j - \nabla_j \nabla_i) \nabla f(\partial_k) = (\nabla_i \nabla_j - \nabla_j \nabla_i) \nabla_k f = \sum_{l} (\nabla f)^l R_{jik}^l $$ and I don't know how to proceed to get $Ric$.