An alternative route to Einstein's equation is through the principle of least action, as we did previously to deduce the geodesic equation in curved spacetime in Geodesic equation from the principle of least action.
In this article, we will therfore go through the process of deriving the Einstein equations in vacuum and then in the presence of matter using the variational approach.
Action in vacuum
The derivation of the action from a set of equations of motion is very hard, not always possible, and there is no systematic way to do it. We therefore will begin by guessing the action and show that it gives the right answer.
So we will first seek an action S for gravitation that leads to the field equations of general relativity in the absence of matter and energy (in vacuum), that is, we will guess something like:
where L is a scalar Lagrange density and d4V is the element of 4-volume. We thus need both a scalar and the 4-volume element.
The 4-volume element is easiest: we recall that in a locally Minkowskian coordinate system xα', the volume element is d4V=dx0'dx1'dx2'dx3'. If there is a positive-determinant Jacobian Jα'β that transforms this to a general coordinate system xβ, we have:
It turns out however that the metric tensor in the general coordinate system is
so that if we define g to be the determinant of the 4x4 gγδ matrix, we then have g=-(det J)2, so that if follows that det J = √-g. We thus see that the 4-volume element is
The simplest Lagrangian L that is a scalar function of the metric gαβ and its derivatives is the Ricci scalar R, which can be obtained from the Riemann tensor, as we know from the previous article Bianchi identity and Ricci tensor
Our Lagrangian then is, L=R and we assume that the Einstein-Hilbert action could be epxressed as:
Remark: This integral is taken over the whole of space-time if it converges, and if not, S can still be made so by integrating over an arbitrarily large but compact region; this will still produce the field equations.
You can find an introduction to the Einstein-Hilbert Action at this end of the following Lenoard Susskind's video, starting from 1:11:00 to the end
By its own admission, Susskind has never been able to complete the entire derivation of the Einstein equation from this action, because it's too 'tedious'. Let's see how to do this.
Derivation of the Einstein equation from the Einstein Hilbert action
As we know from the principle of least action, the action variation then requires δS=0
Knowing from the previous article Variation of the metric determinant that
Setting δS=0, and given that δgμν is totally arbitrary, we get the Einstein field equations in vacuo
if and only if we are able to demonstrate the second member drops off, i.e we have to show that:
Let us first remind us the expression of the Riemann tensor from our article Riemann curvature tensor part II: derivation from the geodesic deviation:
By contracting this tensor on the first and third indices (we set σ=α) we get the Ricci tensor Rμν:
Then varying it it gives,
The first two terms of this expression suggest that it could be the difference between two covariant derivatives. Let us prove that it is the case.
We know from our previous article Covariant differentiation exercise 2: calculation for the Euclidean metric tensor that the covariant derivatives are constructed from the following building blocks:
- - take the partial derivatives of the tensor
- - add a Γαγβ term for each upper index
- - substract a Γγαβ term for each lower index
So that we can write each covariant derivative as the sum of four terms (partial derivative + add one term for the upper index + substract two terms for the two lower indices)
we can thus verify that:
which is known as the Palatini identity.
Remark: a more formal way of demonstrating this identity is exposed in our article Palatini equation
So we can now write by replacing δRμν by its expression
When considering the expression in brackets, we notice that the μ and ν indices cancel out, so that we are left with a tensor rank 1 tensor
So that we are left with the following integral expression:
So we finally get the Einstein field equations in vacuo, i.e that describe a space-time region that is empty of matter and energy:
The full field equations
So far, we have been concerned with the vacuum field equations. If we now consider a spacetime that is not empty but contains matter, we have to add a second action term SM to the Einstein-Hilbert SEH action exposed previoulsly.
This new action could be written as
But we can rewrite the SEH in a slight different form:
so that varying the whole action now gives:
By defining the energy momentum tensor Tμν as
and doing the substitution with k=c4/2(8πG) leads to the familiar Einstein equation which relates the spacetime curvature on the left hand side to the matter energy density on the right hand side
You can follow all the previous demonstration in live in the following excellent youtube tutorial from Robert Davie Variational approach to General Relativity
 Introducing Einstein's relativity, Ray D'Inverno, §11.5 Indirect derivation of the field equations.