Formally, given a (pseudo)-Riemannian manifold (M, g) associated with a vector bundle E → M, let ∇ denote the Levi-Civita connection given by the metric g, and denote by Γ(E) the space of the smooth sections of the total space E. Denote by T*M the cotangent bundle of M. Then the second covariant derivative can be defined as the composition of the two ∇s as follows: [1]

For example, given vector fields u, v, w, a second covariant derivative can be written as

by using abstract index notation. It is also straightforward to verify that

Thus

When the torsion tensor is zero, so that
, we may use this fact to write Riemann curvature tensor as [2]

Similarly, one may also obtain the second covariant derivative of a function f as

Again, for the torsion-free Levi-Civita connection, and for any vector fields u and v, when we feed the function f into both sides of
![{\displaystyle \nabla _{u}v-\nabla _{v}u=[u,v]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/26088d24d251dd3a42326d9e9b58f258962606fc)
we find
.
This can be rewritten as

so we have

That is, the value of the second covariant derivative of a function is independent on the order of taking derivatives.