Field Equations from the Einstein-Hilbert Action
Statement
Requiring the total action \(S=\frac{1}{2\kappa}\int R\sqrt{-g}\,d^4x + S_M\), with \(\kappa=8\pi G/c^4\), to be stationary under arbitrary variations of the inverse metric \(g^{\mu\nu}\) (with the variation vanishing on the boundary) yields the Einstein field equations \(R_{\mu\nu}-\tfrac12 R\,g_{\mu\nu}=\kappa\,T_{\mu\nu}\), where the matter source is identified as \(T_{\mu\nu}=-\dfrac{2}{\sqrt{-g}}\dfrac{\delta S_M}{\delta g^{\mu\nu}}\).
Why it matters
This is the variational foundation of general relativity: it shows that the entire dynamics of spacetime curvature follows from a single scalar Lagrangian, the Ricci scalar \(R\), the simplest generally-covariant density built from the metric and its derivatives. The field equations are not postulated but derived as the Euler–Lagrange equations of that action.
The construction fixes the coupling constant \(\kappa=8\pi G/c^4\) by demanding the Newtonian limit, unifies the geometric and matter sectors through one metric variable, and makes local energy–momentum conservation \(\nabla^\mu T_{\mu\nu}=0\) an automatic consequence of the contracted Bianchi identity rather than an independent assumption. It is the template for every modified-gravity theory.
Assumptions
Derivation
Result
Reading. Spacetime curvature (the Einstein tensor on the left, a specific combination of the Ricci tensor and scalar) is sourced by the local energy, momentum, and stress of matter (the stress-energy tensor on the right). The proportionality constant \(8\pi G/c^4\) is tiny in SI units, so it takes enormous energy densities to curve spacetime measurably. Because \(\nabla^\mu G_{\mu\nu}=0\) identically, the equation enforces \(\nabla^\mu T_{\mu\nu}=0\): geometry itself conserves energy–momentum.
Units check. \(G_{\mu\nu}\) has dimensions of curvature, \([\text{length}]^{-2}=\text{m}^{-2}\). The coupling \(\kappa=8\pi G/c^4\) has units \(\dfrac{\mathrm{m^3\,kg^{-1}\,s^{-2}}}{\mathrm{m^4\,s^{-4}}}=\mathrm{s^2\,kg^{-1}\,m^{-1}}\), and \(T_{\mu\nu}\) is an energy density, \(\mathrm{J\,m^{-3}=kg\,m^{-1}\,s^{-2}}\). Their product is \(\mathrm{(s^2\,kg^{-1}\,m^{-1})(kg\,m^{-1}\,s^{-2})=m^{-2}}\), matching the left side. Numerically \(\kappa=2.08\times10^{-43}\ \mathrm{s^2\,kg^{-1}\,m^{-1}}\).
Limiting cases
- Vacuum (\(T_{\mu\nu}=0\)): taking the trace gives \(R=0\), so \(R_{\mu\nu}=0\) — the vacuum Einstein equations, satisfied by Schwarzschild and gravitational-wave spacetimes.
- Weak, slow, static field: \(g_{00}\approx-(1+2\Phi/c^2)\), \(|T|\ll\rho c^2\) dominated by \(T_{00}=\rho c^2\); the \(00\)-component reduces to the Poisson equation \(\nabla^2\Phi=4\pi G\rho\), fixing \(\kappa=8\pi G/c^4\).
- Trace-reversed form: contracting with \(g^{\mu\nu}\) in \(D=4\) gives \(R=-\kappa T\), so equivalently \(R_{\mu\nu}=\kappa\!\left(T_{\mu\nu}-\tfrac12 T g_{\mu\nu}\right)\).
- Cosmological constant: adding \(-\tfrac{1}{\kappa}\Lambda\sqrt{-g}\) to the action shifts the result to \(G_{\mu\nu}+\Lambda g_{\mu\nu}=\kappa T_{\mu\nu}\), equivalent to a vacuum energy \(\rho_\Lambda=\Lambda c^2/(8\pi G)\).
Breaks when
- Boundary term is not controlled. On a manifold with boundary where \(\delta g^{\mu\nu}\) is not fixed, the Palatini surface term survives; without the Gibbons–Hawking–York counterterm the variational problem is ill-posed and the bulk equations are not the honest stationary condition (crucial for black-hole thermodynamics and any action-based energy definition).
- Higher-derivative or non-minimal matter coupling. If \(S_M\) depends on \(\nabla g\), on curvature, or on \(R\) itself (e.g. \(f(R)\) gravity, scalar–tensor theories), the metric variation produces extra terms; the equations become fourth-order and \(T_{\mu\nu}\) as defined here is no longer the full source.
- Planck-scale / quantum-gravity regime. The classical action assumes a smooth metric; near \(l_P\sim10^{-35}\,\mathrm m\) or at curvature singularities the effective-field-theory expansion breaks down and higher-curvature counterterms (\(R^2,\,R_{\mu\nu}R^{\mu\nu}\)) become comparable, so the pure Einstein–Hilbert action is only the leading term.
- Signature / dimension change. The trace step \(R=-\kappa T\) used \(g^{\mu\nu}g_{\mu\nu}=D=4\); in \(D\ne4\) the trace relation and the Newtonian coupling both change, and in \(D=2\) the Einstein tensor vanishes identically so the action is purely topological.
Failure modes
- Dropping the \(\delta\sqrt{-g}\) term. Forgetting Jacobi's formula loses the \(-\tfrac12 R g_{\mu\nu}\) piece and yields \(R_{\mu\nu}=\kappa T_{\mu\nu}\), which is not divergence-free and contradicts \(\nabla^\mu T_{\mu\nu}=0\).
- Treating \(g^{\mu\nu}\delta R_{\mu\nu}\) as generally zero. It is a total covariant divergence, not identically zero; it only integrates away as a boundary term. Confusing "total divergence" with "vanishes locally" is a common slip.
- Sign/placement of \(T_{\mu\nu}\). Writing \(T_{\mu\nu}=+\tfrac{2}{\sqrt{-g}}\delta S_M/\delta g^{\mu\nu}\) or using \(\delta g_{\mu\nu}\) instead of \(\delta g^{\mu\nu}\) flips the sign, producing a negative energy density.
- Varying \(g_{\mu\nu}\) and \(g^{\mu\nu}\) as independent while also imposing metricity. One must pick a variable; mixing conventions double-counts and gives wrong index positions.
- Assuming \(\delta g^{\mu\nu}\) is symmetric-traceless "for simplicity." It is symmetric but has a trace; restricting it illegitimately would only give the traceless part of the equations.
Discussion
The derivation is a striking instance of the power of symmetry and simplicity. Lovelock's theorem sharpens this: in four dimensions, the only divergence-free symmetric two-tensor built from the metric and up to its second derivatives, and linear in those second derivatives, is \(a\,G_{\mu\nu}+b\,g_{\mu\nu}\). So the Einstein tensor plus a cosmological term is essentially forced once you demand a metric theory with second-order field equations — the Einstein–Hilbert action is not a lucky guess but the unique minimal choice.
The identification of \(T_{\mu\nu}\) as the response of the matter action to a metric variation is deeper than the flat-space canonical tensor from Noether's theorem. The Hilbert tensor is automatically symmetric and gauge-invariant, whereas the canonical Noether tensor generally is neither and must be repaired by a Belinfante–Rosenfeld improvement term. On a curved background the metric variation is the natural, coordinate-free definition, and it is exactly the object that couples to gravity.
The automatic conservation \(\nabla^\mu T_{\mu\nu}=0\) is a manifestation of Noether's second theorem: the diffeomorphism invariance of the total action implies an identity (the contracted Bianchi identity on the geometry side) that forces the matter source to be conserved on-shell. Local energy–momentum conservation in GR is thus a consequence of general covariance, not a separate postulate — geometry and conservation are two faces of the same symmetry.
The Palatini (first-order) formulation, in which metric and connection are varied independently, is instructive: varying the connection yields the metricity condition \(\nabla_\sigma g_{\mu\nu}=0\), so the Levi-Civita connection emerges dynamically rather than being assumed, and the boundary term is milder. For pure Einstein–Hilbert the two formulations coincide, but they diverge for \(f(R)\) actions, which is why the distinction matters in modified gravity. The boundary story also underlies the Gibbons–Hawking–York term, whose value on a horizon reproduces the Bekenstein–Hawking entropy — the same surface term that had to be cancelled to make the variational problem well-posed carries the thermodynamic content of the theory.
Common misconceptions. The field equations do not say "mass tells space how to curve" in a simple algebraic way — they are ten coupled nonlinear PDEs for the metric, with the source \(T_{\mu\nu}\) itself depending on the geometry. Also, \(\nabla^\mu T_{\mu\nu}=0\) is not a global conservation law: there is no coordinate-independent notion of total energy in a general curved spacetime, only local balance.
Worked examples
Example 1 — Trace-reversed form and the vacuum equations.
Reading. Emptiness forces the Ricci tensor to zero, but not the full Riemann tensor — vacuum spacetimes can still curve (Schwarzschild, gravitational waves). The trace-reversed form is the version actually used to solve for metrics.
Units check. \(R_{\mu\nu}\sim\mathrm{m^{-2}}\); the tidal-curvature estimate \(4.4\times10^{-24}\,\mathrm{m^{-2}}\) carries the right dimension.
Example 2 — Newtonian limit fixes \(\kappa\), and a numeric Poisson source.
Reading. Demanding that GR reproduce Newtonian gravity for weak, slow, static sources is precisely what pins the coupling constant; the "8π" is the price of the trace-reversal factor. The numeric source term \(1.18\times10^{-6}\,\mathrm{s^{-2}}\) is the Laplacian of the potential at solar mean density.
Units check. \([4\pi G\rho]=\mathrm{(m^3kg^{-1}s^{-2})(kg\,m^{-3})=s^{-2}}\), matching \([\nabla^2\Phi]=\mathrm{(m^2s^{-2})/m^2=s^{-2}}\).
Problems
- Trace in general dimension. Contract \(G_{\mu\nu}=\kappa T_{\mu\nu}\) in \(D\) spacetime dimensions and find \(R\) in terms of \(T\). Where does the four-dimensional result break?
Solution
Contracting: \(g^{\mu\nu}G_{\mu\nu}=R-\tfrac12 R\,D=R(1-\tfrac{D}{2})\). So \(R\,\frac{2-D}{2}=\kappa T\Rightarrow R=\dfrac{2\kappa T}{2-D}\). For \(D=4\): \(R=\dfrac{2\kappa T}{-2}=-\kappa T\), recovering the earlier result. For \(D=2\) the coefficient \((2-D)/2\to0\): the equation degenerates because \(G_{\mu\nu}\equiv0\) identically in two dimensions (the Einstein–Hilbert action is a topological invariant, the Euler characteristic), so there is no dynamical field equation. - Cosmological constant from the action. Add a term \(-\dfrac{1}{2\kappa}\int 2\Lambda\sqrt{-g}\,d^4x\) to \(S_{\text{EH}}\) and vary. Derive the modified field equations and the equivalent vacuum energy density for \(\Lambda=1.1\times10^{-52}\,\mathrm{m^{-2}}\).
Solution
Only the \(\sqrt{-g}\) variation contributes to the new term: \(\delta(-2\Lambda\sqrt{-g})=-2\Lambda\cdot(-\tfrac12\sqrt{-g}g_{\mu\nu}\delta g^{\mu\nu})=\Lambda\sqrt{-g}g_{\mu\nu}\delta g^{\mu\nu}\). Adding to step 8 gives \(\frac{1}{2\kappa}(G_{\mu\nu}+\Lambda g_{\mu\nu})=\tfrac12 T_{\mu\nu}\), i.e. \(G_{\mu\nu}+\Lambda g_{\mu\nu}=\kappa T_{\mu\nu}\). Moving \(\Lambda\) to the right, \(\Lambda g_{\mu\nu}=-\kappa\rho_\Lambda c^2 g_{\mu\nu}\)-type identification gives \(\rho_\Lambda=\dfrac{\Lambda c^2}{8\pi G}=\dfrac{(1.1\times10^{-52})(8.99\times10^{16})}{8\pi(6.674\times10^{-11})}\approx\dfrac{9.89\times10^{-36}}{1.677\times10^{-9}}\approx5.9\times10^{-27}\,\mathrm{kg\,m^{-3}}\), a few hydrogen atoms per cubic metre — consistent with the observed dark-energy density. - Conservation from Bianchi. Using the contracted Bianchi identity \(\nabla^\mu G_{\mu\nu}=0\), show that the field equations force \(\nabla^\mu T_{\mu\nu}=0\), and explain why this is not an extra assumption.
Solution
Apply \(\nabla^\mu\) to \(G_{\mu\nu}=\kappa T_{\mu\nu}\): the left side is \(\nabla^\mu G_{\mu\nu}=0\) by the (twice-contracted) Bianchi identity, a geometric identity holding for any metric. Since \(\kappa\) is constant, \(0=\kappa\nabla^\mu T_{\mu\nu}\Rightarrow\nabla^\mu T_{\mu\nu}=0\). It is not an independent postulate because it follows from the diffeomorphism invariance of the action (Noether's second theorem): general covariance of \(S\) is what makes \(G_{\mu\nu}\) divergence-free, so conservation is built into the variational structure. - Perfect-fluid trace and radiation. For \(T_{\mu\nu}=\left(\rho+\dfrac{p}{c^2}\right)u_\mu u_\nu+p\,g_{\mu\nu}\) with \(u^\mu u_\mu=-c^2\), compute the trace \(T\). Evaluate it for a radiation fluid with equation of state \(p=\rho c^2/3\).
Solution
\(T=g^{\mu\nu}T_{\mu\nu}=\left(\rho+\tfrac{p}{c^2}\right)u^\mu u_\mu+p\,g^{\mu\nu}g_{\mu\nu}=\left(\rho+\tfrac{p}{c^2}\right)(-c^2)+p(4)=-\rho c^2-p+4p=-\rho c^2+3p\). For radiation \(p=\rho c^2/3\): \(T=-\rho c^2+3(\rho c^2/3)=-\rho c^2+\rho c^2=0\). A traceless stress-energy is the hallmark of conformally invariant (massless) fields; via \(R=-\kappa T\) it means a pure-radiation universe has \(R=0\) even though \(R_{\mu\nu}\ne0\). - Coupling magnitude and nuclear density. Compute \(\kappa=8\pi G/c^4\) numerically, then estimate the curvature scale \(G_{00}\sim\kappa\rho c^2\) sourced by nuclear-matter density \(\rho=2.3\times10^{17}\,\mathrm{kg\,m^{-3}}\), and give the corresponding length scale \(L=G_{00}^{-1/2}\).
Solution
\(\kappa=\dfrac{8\pi(6.674\times10^{-11})}{(2.998\times10^8)^4}=\dfrac{1.677\times10^{-9}}{8.078\times10^{33}}=2.08\times10^{-43}\,\mathrm{s^2\,kg^{-1}\,m^{-1}}\). Energy density \(T_{00}=\rho c^2=(2.3\times10^{17})(8.99\times10^{16})=2.07\times10^{34}\,\mathrm{J\,m^{-3}}\). Then \(G_{00}\sim\kappa T_{00}=(2.08\times10^{-43})(2.07\times10^{34})=4.3\times10^{-9}\,\mathrm{m^{-2}}\), giving \(L=G_{00}^{-1/2}=(4.3\times10^{-9})^{-1/2}\approx1.5\times10^{4}\,\mathrm m\approx15\,\mathrm{km}\). This is the characteristic curvature radius inside a neutron star — comparable to the star's actual radius, confirming that neutron stars are strongly relativistic objects.