This is a very good question! Indeed by deriving the action, we can learn a lot about the axiomatic structure of the theory. I do not know why textbooks (including the good ones) shy away from deriving the E-H action? I think it can be done and since it is snowing, I might have just enough time tonight to do for you. I will post the result if I managed to do it.
regards
sam
First: some introduction;
Let us assume that all dynamical properties of our space-time are comprised in the metric tensor, g_{ab}(x), which, at the same time, characterizes the behaviour of measuring apparatus. Thus, in a field-like theory, the metric tensor together with its derivatives to finite order can be taken as “dynamical” type variables provided an appropriate SCALAR “Lagrangian” can be constructed out of them:
\mathcal{L}(x) = \mathcal{L}(g_{ab},g_{ab,c},g_{ab,cd}, \ ...)
We always have in mind the group of general coordinate transformations subject to appropriate differentiability conditions (the manifold mapping group of diffeomorphisms). Since tensors form representations of this group, they are natural objects to serve as the building blocks of a generally covariant physical theory. To ensure the general covariance of the resulting theory, we need to form an invariant “action” integral, so that the statement \delta S[g_{ab}]= 0 is generally covariant, and so also is the dynamics derived from this statement. However, the integral; \int_{D} \ d^{4}x \mathcal{L}(x), over an invariantly fixed domain D, would not be an invariant as long as \mathcal{L}(x) is a scalar quantity, because
\int_{D} d^{4}x \mathcal{L}(x) = \int_{\bar{D}} d^{4}\bar{x}\ J(\frac{x}{\bar{x}}) \bar{\mathcal{L}}(\bar{x}) \neq \int_{\bar{D}} d^{4}\bar{x} \bar{\mathcal{L}}(\bar{x})
when the Jacobian J(x/ \bar{x}) \neq 1. So we need some quantity a(x) such that
\int_{D}d^{4}x a(x) \mathcal{L}(x) = \int_{\bar{D}}d^{4}\bar{x} \bar{a}(\bar{x}) \bar{\mathcal{L}}(\bar{x})
holds, i.e., a(x) needs to be a scalar density transforming as
\bar{a}(\bar{x}) = J(\frac{x}{\bar{x}}) a(x)
Now, by taking the determinants of both sides of the transformation law of the metric tensor, we find
\bar{g}(\bar{x}) = J^{2}(\frac{x}{\bar{x}})g(x)
Since Lorentz signature implies g = \det (g_{ab}) < 0, hence
\sqrt{- \bar{g}} = J(\frac{x}{\bar{x}}) \sqrt{-g},
and our invariant action becomes (a(x) = \sqrt{-g}),
S[g_{ab}] = \int_{D} d^{4}x \sqrt{- g} \mathcal{L}(x)
By varying the action with respect to the metric tensor, we get the following E-L equation of motion;
\frac{\partial \hat{\mathcal{L}}}{\partial g_{ab}} - \partial_{c}\left( \frac{\partial \hat{\mathcal{L}}}{\partial g_{ab,c}}\right) + \partial_{c}\partial_{d}\left( \frac{\partial \hat{\mathcal{L}}}{\partial g_{ab,cd}}\right) - \ ... = 0 \ \ (1)
where \hat{\mathcal{L}} = \sqrt{-g}\mathcal{L}.
Deriving the form of the Lagrangian:
This will be based on the following principles;
1)The principle of equivalence:
“At every point in an arbitrary curved space-time, we can choose a locally inertial frame in which the laws of physics take the same form as in a global inertial frame of flat space-time”; at any point p, one can choose a coordinate system such that g_{ab}(p) = \eta_{ab} and g_{ab,c}(p) = 0. The principle states that in the neighbourhood of this point, the physics is Lorentzian.
2) Prejudice:
“The metric tensor obeys a second order partial differential equation”; since almost all of the differential equations of physics are second order, we may regard the above prejudice as a principle and see what it implies.
3)The principle of general covariance:
“The form of physical laws is invariant under the group of general coordinate transformations”. The covariance (form invariance) means that physical laws must be tensorial. To apply the principle, we need a mathematical representation of it. The obvious choice is;
\eta_{ab} \rightarrow g_{ab}(x)
\partial_{a} \rightarrow \nabla_{a}
So, the principle of general covariance represents a technical way to express the transition from SR to GR.
Notice that we have already used the principle of general covariance when we assumed that \mathcal{L}(x) is some unspecified scalar.
Ok, we are ready to do the job.
First notice that g_{ab}(x) would obey a second order differential equation if \mathcal{L}(x) were a function of g_{ab} and \partial_{c}g_{ab} only. But, the principle of equivalence makes it impossible to have a non-trivial scalar function \mathcal{L}(g_{ab},g_{ab,c}); any such function can be made equal to the constant \mathcal{L}(\eta_{ab},0) because, it is always possible to set g_{ab}=\eta_{ab} and g_{ab,c}=0 at any point by coordinate transformation. The only way out of this is to let \mathcal{L} to depend on g_{ab} and its frist and second derivatives but demand that \frac{\partial \mathcal{L}}{\partial g_{ab,cd}} be a function of g_{ab} only. According to eq(1), g_{ab} will then satisfy a second order differential equation. So, let us put \mathcal{L} in the form;
<br />
\mathcal{L}(g_{ab},g_{ab,c},g_{ab,cd}) = g_{ab,cd}(x)A^{abcd}(g_{ab}) + B(g_{ab},g_{ab,c})<br />
Let us evaluate this Lagrangian in a locally inertial system; At the point x^{a}=0, we choose coordinates such that g_{ab}(0)=\eta_{ab} and g_{ab,c}(0) = 0. Hence
\mathcal{L}(\eta , 0 , \partial^{2} g) = g_{ab,cd}A^{abcd}(\eta) + b \ \ (2)
where b= B(\eta , 0).
In a new coordinate system related to the x-system by a Lorentz transformation x^{a}=\Lambda^{a}{}_{b}\bar{x}^{b}, we still have \bar{g}_{ab}=\eta_{ab} and \bar{g}_{ab,c}=0, but
\bar{g}_{ab,cd} = \Lambda^{m}{}_{a}\Lambda^{n}{}_{b}\Lambda^{p}{}_{c}\Lambda^{q}{}_{d}g_{mn,pq} \ \ (3)
Since \mathcal{L} is a Lorentz scalar, we must have
\bar{g}_{ab,cd}A^{abcd} = g_{ab,cd}A^{abcd} \ \ (4)
Eq(3) and Eq(4) imply that A^{abcd}(\eta) is an invariant Lorentz tensor. In 4-dimensional space-time, the most general rank-4 invariant tensor is
A^{abcd} = a\eta^{ab}\eta^{cd} + a_{1}\eta^{ac}\eta^{bd} + a_{2}\eta^{ad}\eta^{bc} + a_{3}\epsilon^{abcd}
Using the symmetry of g_{ab,cd} in (ab) and (cd), we can write Eq(2) in the form
\mathcal{L} = g_{ab,cd} \left( a \eta^{ab}\eta^{cd} + c \eta^{ac} \eta^{bd}\right) + b
where a and c are constants.
Next, we go to yet another (locally inertial) coordinate system related to the x-system by
<br />
x^{a} = \bar{x}^{a} + (1/6) \eta^{ae}C_{ebcd}\bar{x}^{b}\bar{x}^{c}\bar{x}^{d}<br />
where the constant C_{ebcd} is symmetric in b, c and d. With some boring calculation, one finds, at \bar{x}^{a}=0, that
\bar{g}_{ab,cd} = g_{ab,cd} + C_{abcd} + C_{bacd}
Now, it is easy to see that the invariance of \mathcal{L} under this transformation;
\mathcal{L}(\eta, 0, \bar{g}_{ab,cd}) = \mathcal{L}(\eta, 0, g_{ab.cd}),
implies a = -c.
Thus, our Lagrangian becomes
<br />
\mathcal{L} = c g_{ab,cd}\left(\eta^{ac}\eta^{bd} - \eta^{ab}\eta^{cd}\right) + b
Now comes the most difficult part, we play with the indices and rewrite the first term as
<br />
(c/2)\eta^{bc}\eta^{ae}\partial_{a}\left(g_{be,c} + g_{ce,b} - g_{bc,e}\right) - (c/2)\eta^{ae}\eta^{bc}\partial_{c}\left(g_{be,a} + g_{ae,b} - g_{ba,e}\right)<br />
and, after introducing the connection coefficients, we conclude that in a locally inertial frame our Lagrangian has the form
\mathcal{L}= c \eta^{bc}\left(\partial_{a}\Gamma^{a}_{bc} - \partial_{c}\Gamma^{a}_{ba}\right) + b
Finally, we are in good position to use the principle of general covariance and write an expression for \mathcal{L}(x) which holds true in any (completely arbitrary) reference frame
\mathcal{L}(x) = c R + b \ \ (5)
where R is the (curvature) scalar
<br />
R = g^{ab}\left( \nabla_{c}\Gamma^{c}_{ab} - \nabla_{b}\Gamma^{c}_{ac}\right) <br />
The values of c and b must be determined by experiment. For b = 0, the value of c can be determined by comparing the Newtonian limit of the theory with Newton’s gravity;
c = \frac{1}{16 \pi G}
Thus, for b = \frac{\Lambda}{16\piG} \neq 0, we arrive at the H-E action
S[g_{ab}] = \frac{1}{16\pi G} \int d^{4}x \sqrt{-g} ( R + \Lambda)
So, in spite of all the fuss, general covariance seems to be a powerful and important principle which determines acceptable forms of physical laws.