# Einstein–Hilbert action

General relativity :
$G_{\mu \nu }+\Lambda g_{\mu \nu }={\kappa }T_{\mu \nu }$ :
Introduction
HistoryTimelineTests
Mathematical formulation :
Fundamental concepts
Equivalence principle
Special relativity
World line
Pseudo-Riemannian manifold :
Phenomena
Kepler problem
Gravitational lensing
Gravitational redshift
Gravitational time dilation
Gravitational waves
Frame-dragging
Geodetic effect
Event horizon
Singularity
Black hole
Spacetime
Spacetime diagrams
Minkowski spacetime
Einstein–Rosen bridge :
EquationsFormalisms
Equations
Linearized gravity
Einstein field equations
Friedmann
Geodesics
Mathisson–Papapetrou–Dixon
Hamilton–Jacobi–Einstein
Formalisms
ADM
BSSN
Post-Newtonian
Advanced theory
Kaluza–Klein theory
Quantum gravity :
Solutions
Schwarzschild (interior)
Reissner–Nordström
Einstein–Rosen waves
Wormhole
Gödel
Kerr
Kerr–Newman
Kerr–Newman–de Sitter
Kasner
Lemaître–Tolman
Taub–NUT
Milne
Robertson–Walker
Oppenheimer–Snyder
pp-wave
van Stockum dust
Weyl−Lewis−Papapetrou
Hartle–Thorne :
Scientists
Einstein
Lorentz
Hilbert
Poincaré
Schwarzschild
de Sitter
Reissner
Nordström
Weyl
Eddington
Friedmann
Milne
Zwicky
Lemaître
Oppenheimer
Gödel
Wheeler
Robertson
Bardeen
Walker
Kerr
Chandrasekhar
Ehlers
Penrose
Hawking
Raychaudhuri
Taylor
Hulse
van Stockum
Taub
Newman
Yau
Thorne
others :
Physics portal
 Category :
vte :
The Einstein–Hilbert action in general relativity is the action that yields the Einstein field equations through the stationary-action principle. With the (− + + +) metric signature, the gravitational part of the action is given as
    $S={1 \over 2\kappa }\int R{\sqrt {-g}}\,\mathrm {d} ^{4}x,$
where $g=\det(g_{\mu \nu })$ is the determinant of the metric tensor matrix, $R$ is the Ricci scalar, and $\kappa =8\pi Gc^{-4}$ is the Einstein gravitational constant ($G$ is the gravitational constant and $c$ is the speed of light in vacuum). If it converges, the integral is taken over the whole spacetime. If it does not converge, $S$ is no longer well-defined, but a modified definition where one integrates over arbitrarily large, relatively compact domains, still yields the Einstein equation as the Euler–Lagrange equation of the Einstein–Hilbert action. The action was proposed by David Hilbert in 1915 as part of his application of the variational principle to a combination of gravity and electromagnetism.$^{:119}$

## Discussion

Deriving equations of motion from an action has several advantages. First, it allows for easy unification of general relativity with other classical field theories (such as Maxwell theory), which are also formulated in terms of an action. In the process, the derivation identifies a natural candidate for the source term coupling the metric to matter fields. Moreover, symmetries of the action allow for easy identification of conserved quantities through Noether's theorem.
In general relativity, the action is usually assumed to be a functional of the metric (and matter fields), and the connection is given by the Levi-Civita connection. The Palatini formulation of general relativity assumes the metric and connection to be independent, and varies with respect to both independently, which makes it possible to include fermionic matter fields with non-integer spin.
The Einstein equations in the presence of matter are given by adding the matter action to the Einstein–Hilbert action.

## Derivation of Einstein field equations

Suppose that the full action of the theory is given by the Einstein–Hilbert term plus a term ${\mathcal {L}}_{\mathrm {M} }$ describing any matter fields appearing in the theory.
| $S=\int \left[{\frac {1}{2\kappa }}R+{\mathcal {L}}_{\mathrm {M} }\right]{\sqrt {-g}}\,\mathrm {d} ^{4}x$. | (1) |
The stationary-action principle then tells us that to recover a physical law, we must demand that the variation of this action with respect to the inverse metric be zero, yielding
    ${\begin{aligned}0&=\delta S\\&=\int \left[{\frac {1}{2\kappa }}{\frac {\delta \left({\sqrt {-g}}R\right)}{\delta g^{\mu \nu }}}+{\frac {\delta \left({\sqrt {-g}}{\mathcal {L}}_{\mathrm {M} }\right)}{\delta g^{\mu \nu }}}\right]\delta g^{\mu \nu }\,\mathrm {d} ^{4}x\\&=\int \left[{\frac {1}{2\kappa }}\left({\frac {\delta R}{\delta g^{\mu \nu }}}+{\frac {R}{\sqrt {-g}}}{\frac {\delta {\sqrt {-g}}}{\delta g^{\mu \nu }}}\right)+{\frac {1}{\sqrt {-g}}}{\frac {\delta \left({\sqrt {-g}}{\mathcal {L}}_{\mathrm {M} }\right)}{\delta g^{\mu \nu }}}\right]\delta g^{\mu \nu }{\sqrt {-g}}\,\mathrm {d} ^{4}x\end{aligned}}$.
Since this equation should hold for any variation $\delta g^{\mu \nu }$, it implies that
| ${\frac {\delta R}{\delta g^{\mu \nu }}}+{\frac {R}{\sqrt {-g}}}{\frac {\delta {\sqrt {-g}}}{\delta g^{\mu \nu }}}=-2\kappa {\frac {1}{\sqrt {-g}}}{\frac {\delta ({\sqrt {-g}}{\mathcal {L}}_{\mathrm {M} })}{\delta g^{\mu \nu }}}$ | (2) |
is the equation of motion for the metric field. The right hand side of this equation is (by definition) proportional to the stress–energy tensor,
    $T_{\mu \nu }:={\frac {-2}{\sqrt {-g}}}{\frac {\delta ({\sqrt {-g}}{\mathcal {L}}_{\mathrm {M} })}{\delta g^{\mu \nu }}}=-2{\frac {\delta {\mathcal {L}}_{\mathrm {M} }}{\delta g^{\mu \nu }}}+g_{\mu \nu }{\mathcal {L}}_{\mathrm {M} }$.
To calculate the left hand side of the equation we need the variations of the Ricci scalar $R$ and the determinant of the metric. These can be obtained by standard textbook calculations such as the one given below, which is strongly based on the one given in Carroll (2004).

### Variation of the Ricci scalar

The variation of the Ricci scalar follows from varying the Riemann curvature tensor, and then the Ricci curvature tensor.
The first step is captured by the Palatini identity
    $\delta R_{\sigma \nu }\equiv \delta {R^{\rho }}_{\sigma \rho \nu }=\nabla _{\rho }\left(\delta \Gamma _{\nu \sigma }^{\rho }\right)-\nabla _{\nu }\left(\delta \Gamma _{\rho \sigma }^{\rho }\right)$.
Using the product rule, the variation of the Ricci scalar $R=g^{\sigma \nu }R_{\sigma \nu }$ then becomes
    ${\begin{aligned}\delta R&=R_{\sigma \nu }\delta g^{\sigma \nu }+g^{\sigma \nu }\delta R_{\sigma \nu }\\&=R_{\sigma \nu }\delta g^{\sigma \nu }+\nabla _{\rho }\left(g^{\sigma \nu }\delta \Gamma _{\nu \sigma }^{\rho }-g^{\sigma \rho }\delta \Gamma _{\mu \sigma }^{\mu }\right),\end{aligned}}$
where we also used the metric compatibility $\nabla _{\sigma }g^{\mu \nu }=0$, and renamed the summation indices $(\rho ,\nu )\rightarrow (\mu ,\rho )$ in the last term.
When multiplied by ${\sqrt {-g}}$, the term $\nabla _{\rho }\left(g^{\sigma \nu }\delta \Gamma _{\nu \sigma }^{\rho }-g^{\sigma \rho }\delta \Gamma _{\mu \sigma }^{\mu }\right)$ becomes a total derivative, since for any vector $A^{\lambda }$ and any tensor density ${\sqrt {-g}}\,A^{\lambda }$, we have
    ${\sqrt {-g}}\,A_{;\lambda }^{\lambda }=\left({\sqrt {-g}}\,A^{\lambda }\right)_{;\lambda }=\left({\sqrt {-g}}\,A^{\lambda }\right)_{,\lambda }$ or ${\sqrt {-g}}\,\nabla _{\mu }A^{\mu }=\nabla _{\mu }\left({\sqrt {-g}}\,A^{\mu }\right)=\partial _{\mu }\left({\sqrt {-g}}\,A^{\mu }\right)$.
By Stokes' theorem, this only yields a boundary term when integrated. The boundary term is in general non-zero, because the integrand depends not only on $\delta g^{\mu \nu },$ but also on its partial derivatives $\partial _{\lambda }\,\delta g^{\mu \nu }\equiv \delta \,\partial _{\lambda }g^{\mu \nu }$; see the article Gibbons–Hawking–York boundary term for details. However, when the variation of the metric $\delta g^{\mu \nu }$ vanishes in a neighbourhood of the boundary or when there is no boundary, this term does not contribute to the variation of the action. Thus, we can forget about this term and simply obtain
| ${\frac {\delta R}{\delta g^{\mu \nu }}}=R_{\mu \nu }$. | (3) |
at events not in the closure of the boundary.

### Variation of the determinant

Jacobi's formula, the rule for differentiating a determinant, gives:
    $\delta g=\delta \det(g_{\mu \nu })=gg^{\mu \nu }\delta g_{\mu \nu }$,
or one could transform to a coordinate system where $g_{\mu \nu }$ is diagonal and then apply the product rule to differentiate the product of factors on the main diagonal. Using this we get
    $\delta {\sqrt {-g}}=-{\frac {1}{2{\sqrt {-g}}}}\delta g={\frac {1}{2}}{\sqrt {-g}}\left(g^{\mu \nu }\delta g_{\mu \nu }\right)=-{\frac {1}{2}}{\sqrt {-g}}\left(g_{\mu \nu }\delta g^{\mu \nu }\right)$
In the last equality we used the fact that
    $g_{\mu \nu }\delta g^{\mu \nu }=-g^{\mu \nu }\delta g_{\mu \nu }$
which follows from the rule for differentiating the inverse of a matrix
    $\delta g^{\mu \nu }=-g^{\mu \alpha }\left(\delta g_{\alpha \beta }\right)g^{\beta \nu }$.
Thus we conclude that
| ${\frac {1}{\sqrt {-g}}}{\frac {\delta {\sqrt {-g}}}{\delta g^{\mu \nu }}}=-{\frac {1}{2}}g_{\mu \nu }$. | (4) |

### Equation of motion

Now that we have all the necessary variations at our disposal, we can insert (3) and (4) into the equation of motion (2) for the metric field to obtain
| $R_{\mu \nu }-{\frac {1}{2}}g_{\mu \nu }R={\frac {8\pi G}{c^{4}}}T_{\mu \nu }$, | (5) |
which is the Einstein field equations, and
    $\kappa ={\frac {8\pi G}{c^{4}}}$
has been chosen such that the non-relativistic limit yields the usual form of Newton's gravity law, where $G$ is the gravitational constant (see here for details).

## Cosmological constant

When a cosmological constant Λ is included in the Lagrangian, the action:
    $S=\int \left[{\frac {1}{2\kappa }}(R-2\Lambda )+{\mathcal {L}}_{\mathrm {M} }\right]{\sqrt {-g}}\,\mathrm {d} ^{4}x$
Taking variations with respect to the inverse metric:
    ${\begin{aligned}\delta S&=\int \left[{\frac {\sqrt {-g}}{2\kappa }}{\frac {\delta R}{\delta g^{\mu \nu }}}+{\frac {R}{2\kappa }}{\frac {\delta {\sqrt {-g}}}{\delta g^{\mu \nu }}}-{\frac {\Lambda }{\kappa }}{\frac {\delta {\sqrt {-g}}}{\delta g^{\mu \nu }}}+{\sqrt {-g}}{\frac {\delta {\mathcal {L}}_{\mathrm {M} }}{\delta g^{\mu \nu }}}+{\mathcal {L}}_{\mathrm {M} }{\frac {\delta {\sqrt {-g}}}{\delta g^{\mu \nu }}}\right]\delta g^{\mu \nu }\mathrm {d} ^{4}x\\&=\int \left[{\frac {1}{2\kappa }}{\frac {\delta R}{\delta g^{\mu \nu }}}+{\frac {R}{2\kappa }}{\frac {1}{\sqrt {-g}}}{\frac {\delta {\sqrt {-g}}}{\delta g^{\mu \nu }}}-{\frac {\Lambda }{\kappa }}{\frac {1}{\sqrt {-g}}}{\frac {\delta {\sqrt {-g}}}{\delta g^{\mu \nu }}}+{\frac {\delta {\mathcal {L}}_{\mathrm {M} }}{\delta g^{\mu \nu }}}+{\frac {{\mathcal {L}}_{\mathrm {M} }}{\sqrt {-g}}}{\frac {\delta {\sqrt {-g}}}{\delta g^{\mu \nu }}}\right]\delta g^{\mu \nu }{\sqrt {-g}}\,\mathrm {d} ^{4}x\end{aligned}}$
Using the action principle:
    $0=\delta S={\frac {1}{2\kappa }}{\frac {\delta R}{\delta g^{\mu \nu }}}+{\frac {R}{2\kappa }}{\frac {1}{\sqrt {-g}}}{\frac {\delta {\sqrt {-g}}}{\delta g^{\mu \nu }}}-{\frac {\Lambda }{\kappa }}{\frac {1}{\sqrt {-g}}}{\frac {\delta {\sqrt {-g}}}{\delta g^{\mu \nu }}}+{\frac {\delta {\mathcal {L}}_{\mathrm {M} }}{\delta g^{\mu \nu }}}+{\frac {{\mathcal {L}}_{\mathrm {M} }}{\sqrt {-g}}}{\frac {\delta {\sqrt {-g}}}{\delta g^{\mu \nu }}}$
Combining this expression with the results obtained before:
    ${\begin{aligned}{\frac {\delta R}{\delta g^{\mu \nu }}}&=R_{\mu \nu }\\{\frac {1}{\sqrt {-g}}}{\frac {\delta {\sqrt {-g}}}{\delta g^{\mu \nu }}}&={\frac {-g_{\mu \nu }}{2}}\\T_{\mu \nu }&={\mathcal {L}}_{\mathrm {M} }g_{\mu \nu }-2{\frac {\delta {\mathcal {L}}_{\mathrm {M} }}{\delta g^{\mu \nu }}}\end{aligned}}$
We can obtain:
    ${\begin{aligned}{\frac {1}{2\kappa }}R_{\mu \nu }+{\frac {R}{2\kappa }}{\frac {-g_{\mu \nu }}{2}}-{\frac {\Lambda }{\kappa }}{\frac {-g_{\mu \nu }}{2}}+\left({\frac {\delta {\mathcal {L}}_{\mathrm {M} }}{\delta g^{\mu \nu }}}+{\mathcal {L}}_{\mathrm {M} }{\frac {-g_{\mu \nu }}{2}}\right)&=0\\R_{\mu \nu }-{\frac {R}{2}}g_{\mu \nu }+\Lambda g_{\mu \nu }+\kappa \left(2{\frac {\delta {\mathcal {L}}_{\mathrm {M} }}{\delta g^{\mu \nu }}}-{\mathcal {L}}_{\mathrm {M} }g_{\mu \nu }\right)&=0\\R_{\mu \nu }-{\frac {R}{2}}g_{\mu \nu }+\Lambda g_{\mu \nu }-\kappa T_{\mu \nu }&=0\end{aligned}}$
With κ=8πG/c$^4$ {\textstyle \kappa ={\frac {8\pi G}{c^{4}}}}, the expression becomes the field equations with a cosmological constant:
    $R_{\mu \nu }-{\frac {1}{2}}g_{\mu \nu }R+\Lambda g_{\mu \nu }={\frac {8\pi G}{c^{4}}}T_{\mu \nu }.$