As an application of the principle of least action to the Einstein-Hilbert action, in this short note, we discuss a question: the variation with respect to metric of the scalar curvature.
To calculate the variation of the scalar curvature we calculate first the variation of the Riemann curvature tensor, and then the variation of the Ricci tensor.
The variation of the Riemann curvature tensor. So, the Riemann curvature tensor is defined as,
Since the Riemann curvature depends only on the Levi-Civita connection , the variation of the Riemann tensor can be calculated as,
Now, since is the difference of two connections, it is a tensor and we can thus calculate its covariant derivative,
We can now cleverly observe that the expression for the variation of Riemann curvature tensor above is equal to the difference of two such terms,
The variation of the Ricci tensor. We may now obtain the variation of the Ricci curvature tensor simply by contracting two indices of the variation of the Riemann tensor, that is,
in other words,
The variation of the scalar curvature. The scalar curvature, known as the trace of the Ricci curvature, is defined as
Therefore, its variation with respect to the inverse metric is given by
Here we have used the previously obtained result for the variation of the Ricci curvature and the metric compatibility of the covariant derivative, , to push metric into the round brackets. The last term
is a total derivative and thus by Stokes’ theorem only yields a boundary term when integrated. Hence when the variation of the metric vanishes at infinity, this term does not contribute to the variation of the action. And we thus obtain,