The book / chapter 14
CHAPTER 14

Deriving Einstein’s equation

Curvature changes. Volume changes. Together they produce Einstein’s field equation.

1 worked example in this chapter
Before you begin
THE QUESTION

How does one scalar action produce the full tensor equation?

BRING WITH YOU

By the end: Follow the Einstein–Hilbert variation, including its boundary term.

The Einstein–Hilbert action integrates scalar curvature over spacetime volume. We will vary both the curvature and the volume, then combine their changes with the matter response derived in Chapter 13.

Our dynamical variable will be the inverse metric gμνg^{\mu\nu}. The connection is its Levi-Civita connection, not an independent field in this derivation. Matter fields are collectively denoted ψ\psi.

14.1 Choosing the gravitational action#

Take

S[g,ψ]=c316πGNMd4xg(R2Λ)+Sm[g,ψ]+Sboundary.\boxed{ S[g,\psi]= \frac{c^3}{16\pi G_N} \int_{\mathcal M}d^4x\,\sqrt{-g}\,(R-2\Lambda) +S_m[g,\psi]+S_{\rm boundary}. }

Why this structure? An action should not depend on arbitrary coordinate labels, so integrate a scalar using invariant volume. A constant scalar gives a cosmological term. The simplest nontrivial scalar built from a metric and its curvature at two-derivative order is RR.

This is a choice of theory with substantial motivation, not a proof that other terms are forbidden. Scalars such as R2R^2 and RμνRμνR_{\mu\nu}R^{\mu\nu} are also coordinate invariant; Chapter 23 explains why a modern effective theory expects higher-order terms. Here we derive the dynamics of the Einstein–Hilbert choice.

The coefficient is already calibrated by the Newtonian limit. With x0=ctx^0=ct,

[c3GN]=kg/s,[d4xgR]=m2,\left[\frac{c^3}{G_N}\right]=\mathrm{kg/s}, \qquad \left[\int d^4x\sqrt{-g}\,R\right]=\mathrm{m^2},

so SS has units kgm2/s=Js\mathrm{kg\,m^2/s}=\mathrm{J\,s}. Under an actual coordinate change from x0=ctx^0=ct to tt, the invariant action keeps its c3c^3 prefactor: the transformed metric has gtt=c2g00g_{tt}=c^2g_{00} and its determinant contributes g(t)=cg(x0)\sqrt{-g_{(t)}}=c\sqrt{-g_{(x^0)}}. Some presentations factor that cc out of the determinant and write a c4c^4 prefactor with a reduced determinant convention. These are consistent bookkeeping choices. Do not transplant their prefactor into our x0=ctx^0=ct formula.

The boundary term specifies part of the variational problem. For deriving the local bulk equations, we may initially choose variations supported strictly inside the region. For a finite-region variational problem that fixes the boundary geometry, an additional boundary action will be required.

14.2 Varying curvature and volume#

Write A=c3/(16πGN)A=c^3/(16\pi G_N) and vary the gravitational bulk term:

δSg=Ad4x[gδR+(R2Λ)δg].\delta S_g=A\int d^4x\left[ \sqrt{-g}\,\delta R+(R-2\Lambda)\delta\sqrt{-g} \right].

Here Λ\Lambda is a fixed parameter, so δΛ=0\delta\Lambda=0. Since R=gμνRμνR=g^{\mu\nu}R_{\mu\nu}, the product rule gives

δR=Rμνδgμν+gμνδRμν.\delta R=R_{\mu\nu}\delta g^{\mu\nu} +g^{\mu\nu}\delta R_{\mu\nu}.

The first term comes from changing the inverse metric used to take the trace. The second comes from changing curvature itself. Substituting the volume identity,

δSg=Ag[(Rμν12Rgμν+Λgμν)δgμν+gμνδRμν]d4x.\delta S_g=A\int\sqrt{-g}\left[ \left(R_{\mu\nu}-\frac12Rg_{\mu\nu}+\Lambda g_{\mu\nu}\right) \delta g^{\mu\nu} +g^{\mu\nu}\delta R_{\mu\nu} \right]d^4x.

Most of Einstein’s equation is already visible. The trace subtraction came from volume variation, and +Λgμν+\Lambda g_{\mu\nu} came from multiplying 2Λ-2\Lambda by the 1/2-1/2 in that same variation. The remaining term contains the variation of Ricci curvature. We must calculate it before deciding whether it contributes to the interior equation or to the boundary.

14.3 How a changing metric changes the connection#

Set

kμν=δgμν,k=gμνkμν.k_{\mu\nu}=\delta g_{\mu\nu}, \qquad k=g^{\mu\nu}k_{\mu\nu}.

Metric compatibility says λgμν=0\nabla_\lambda g_{\mu\nu}=0. Varying it gives

λkμν=δΓρλμgρν+δΓρλνgμρ.\nabla_\lambda k_{\mu\nu} =\delta\Gamma^\rho{}_{\lambda\mu}g_{\rho\nu} +\delta\Gamma^\rho{}_{\lambda\nu}g_{\mu\rho}.

We have used the fact that varying the covariant derivative also varies its two connection terms. Now write the analogous equations with cyclic permutations of the indices. Add the versions with derivative indices μ\mu and ν\nu, and subtract the version with derivative index σ\sigma. Symmetry of the lower two connection indices makes the unwanted terms cancel. The result is

δΓρμν=12gρσ(μkνσ+νkμσσkμν).\boxed{ \delta\Gamma^\rho{}_{\mu\nu} =\frac12g^{\rho\sigma} \left( \nabla_\mu k_{\nu\sigma} +\nabla_\nu k_{\mu\sigma} -\nabla_\sigma k_{\mu\nu} \right). }

It resembles the Christoffel formula, but ordinary derivatives have become covariant derivatives of the metric variation.

Why is this a tensor, when a connection is not? Two connections transform with the same inhomogeneous coordinate term, so their difference transforms tensorially. δΓ\delta\Gamma is an infinitesimal difference of connections. Its covariant derivative therefore follows the (1,2)(1,2) tensor rule from Chapter 6.

This comparison holds the coordinate identification of the underlying manifold fixed. A separate coordinate transformation is a different operation, even though both can be written with small parameters.

14.4 The Palatini identity: curvature variation becomes a derivative#

Start with our Ricci convention:

Rμν=ρΓρνμνΓρρμ+ΓρρλΓλνμΓρνλΓλρμ.R_{\mu\nu} =\partial_\rho\Gamma^\rho{}_{\nu\mu} -\partial_\nu\Gamma^\rho{}_{\rho\mu} +\Gamma^\rho{}_{\rho\lambda}\Gamma^\lambda{}_{\nu\mu} -\Gamma^\rho{}_{\nu\lambda}\Gamma^\lambda{}_{\rho\mu}.

Vary every connection. The first two terms give derivatives of δΓ\delta\Gamma; the product terms each give two terms containing one Γ\Gamma and one δΓ\delta\Gamma. Those product terms are exactly the connection corrections required to turn the derivatives into covariant derivatives:

δRμν=ρδΓρνμνδΓρρμ.\boxed{ \delta R_{\mu\nu} =\nabla_\rho\delta\Gamma^\rho{}_{\nu\mu} -\nabla_\nu\delta\Gamma^\rho{}_{\rho\mu}. }

This is the Palatini identity. A clean way to verify the algebra is to choose normal coordinates for the unvaried metric at one point. There Γ=0\Gamma=0, all the product-variation terms vanish at that point, and the identity reduces to varying the two ordinary derivative terms. Both sides are tensors, so equality established that way holds in every chart. Normal coordinates simplify a tensor calculation; they do not make curvature vanish.

Contract with gμνg^{\mu\nu}. Because g=0\nabla g=0, the inverse metric moves through the derivatives:

gμνδRμν=ρVρ,g^{\mu\nu}\delta R_{\mu\nu}=\nabla_\rho V^\rho,

where

Vρ=gμνδΓρμνgρμδΓννμ.\boxed{ V^\rho=g^{\mu\nu}\delta\Gamma^\rho{}_{\mu\nu} -g^{\rho\mu}\delta\Gamma^\nu{}_{\nu\mu}. }

Substitute the connection variation to make its content more explicit:

Vρ=μkμρρk.V^\rho=\nabla_\mu k^{\mu\rho}-\nabla^\rho k.

If qμν=δgμνq^{\mu\nu}=\delta g^{\mu\nu} and q=gμνqμνq=g_{\mu\nu}q^{\mu\nu}, then kμν=qμνk^{\mu\nu}=-q^{\mu\nu} and k=qk=-q, so equivalently

Vρ=ρqμqμρ.\boxed{V^\rho=\nabla^\rho q-\nabla_\mu q^{\mu\rho}.}

This is the key structural result. The remaining variation of curvature contributes a total divergence, rather than an additional bulk field equation.

The Einstein–Hilbert integrand contains second derivatives of the metric. Nevertheless its bulk Euler–Lagrange equations contain only second derivatives, not generic fourth derivatives: for an action linear in RR, the terms containing derivatives of the metric variation combine into this boundary divergence. Curvature-squared actions do not generally share that simplification.

14.5 Obtaining the field equation#

We have established

δSg=AMg(Gμν+Λgμν)δgμνd4x+AMgρVρd4x.\delta S_g=A\int_{\mathcal M}\sqrt{-g} (G_{\mu\nu}+\Lambda g_{\mu\nu})\delta g^{\mu\nu}\,d^4x +A\int_{\mathcal M}\sqrt{-g}\,\nabla_\rho V^\rho\,d^4x.

For a variation supported inside the region, the second integral vanishes by the divergence theorem. Add the matter variation:

δSm=12cMgTμνδgμνd4x.\delta S_m=-\frac1{2c}\int_{\mathcal M}\sqrt{-g}\, T_{\mu\nu}\delta g^{\mu\nu}\,d^4x.

Therefore

δS=Mg[c316πGN(Gμν+Λgμν)12cTμν]δgμνd4x.\delta S= \int_{\mathcal M}\sqrt{-g} \left[ \frac{c^3}{16\pi G_N}(G_{\mu\nu}+\Lambda g_{\mu\nu}) -\frac1{2c}T_{\mu\nu} \right]\delta g^{\mu\nu}\,d^4x.

The ten symmetric metric variations can be chosen arbitrarily in the interior, so their coefficient vanishes:

c316πGN(Gμν+Λgμν)=12cTμν.\frac{c^3}{16\pi G_N}(G_{\mu\nu}+\Lambda g_{\mu\nu}) =\frac1{2c}T_{\mu\nu}.

Multiply by 16πGN/c316\pi G_N/c^3:

Gμν+Λgμν=8πGNc4Tμν.\boxed{ G_{\mu\nu}+\Lambda g_{\mu\nu} =\frac{8\pi G_N}{c^4}T_{\mu\nu}. }

The geometry and matter equations arise by independent variations of the metric and matter fields. When varying the metric to derive this equation, matter fields are held fixed as field variables; when varying matter, the metric is held fixed. A physical solution must satisfy both resulting sets of equations.

We have now derived the field equation in words as well as symbols: change the metric, account for the changed trace of curvature, account for the changed spacetime volume, separate a divergence from the curvature variation, measure the matter response by its stress tensor, and require the total first-order response to vanish.

In mechanics with a first-derivative Lagrangian, fixing δq=0\delta q=0 at the endpoints makes the integration-by-parts boundary term zero. Here VρV^\rho contains derivatives of δg\delta g. Fixing the metric on a boundary does not fix its normal derivative there.

The one-dimensional analogy is a function satisfying f(0)=0f(0)=0 while f(0)f'(0) is completely arbitrary. The function can meet the wall at any slope. A fixed boundary metric likewise does not prevent its variation from changing immediately away from the boundary.

There are two different legitimate problems:

  1. To derive local bulk equations, use compactly supported variations. No boundary term survives.
  2. To define a finite-region Dirichlet variational principle, fix the induced boundary geometry and add a term cancelling normal derivatives of its variation. “Dirichlet” means fixing the field values at the boundary; here those values specify its geometry.

The second problem is solved, for smooth non-null boundaries, by the Gibbons–Hawking–York term.

Fixing the value does not fix the slopeA variation vanishes at both endpoints while having nonzero slopes there. The scalar graph is an analogy for each metric variation component along a normal direction. It explains why the Einstein–Hilbert action needs appropriate boundary treatment even when the boundary metric is fixed.22 / FIXING THE VALUE DOES NOT FIX THE SLOPEcoordinate normal to boundaryallowed variationZero value at the boundaryDoes not imply zero normal derivative.A boundary term may therefore survive.The variational problem needs a boundary policy.
22 /
Fixing the value does not fix the slope. The scalar graph is an analogy for each metric variation component along a normal direction. It explains why the Einstein–Hilbert action needs appropriate boundary treatment even when the boundary metric is fixed.

14.7 Induced geometry and the Gibbons–Hawking–York term#

Let nμn^\mu be the outward-directed unit normal to a smooth boundary segment. Set

s=nμnμ={+1,spacelike normal, timelike boundary,1,timelike normal, spacelike boundary.s=n_\mu n^\mu=\begin{cases} +1,&\text{spacelike normal, timelike boundary},\\ -1,&\text{timelike normal, spacelike boundary}. \end{cases}

We use ss for this sign so it cannot be confused with energy density ϵ\epsilon. Define a tensor that removes the normal direction:

hμν=gμνsnμnν.h_{\mu\nu}=g_{\mu\nu}-s n_\mu n_\nu.

It obeys hμνnν=0h_{\mu\nu}n^\nu=0; raising its first index gives the tangent projector. In boundary coordinates yay^a with tangent vectors eaμ=xμ/yae_a^\mu=\partial x^\mu/\partial y^a, the induced metric is

hab=gμνeaμebν.h_{ab}=g_{\mu\nu}e_a^\mu e_b^\nu.

It measures distances and, for a timelike boundary, times along the boundary. Its determinant gives the surface measure hd3y\sqrt{|h|}\,d^3y.

The extrinsic curvature is

Kab=eaμebνμnν,K=habKab.K_{ab}=e_a^\mu e_b^\nu\nabla_\mu n_\nu, \qquad K=h^{ab}K_{ab}.

It describes how the normal changes as one moves along the boundary: how the boundary bends within spacetime. This differs from its intrinsic curvature. A cylindrical surface, for example, can have nonzero extrinsic curvature even while its two-dimensional intrinsic geometry is locally flat.

With this definition of KK and outward normals, the appropriate term is

SGHY=c38πGNMshKd3y.\boxed{ S_{\rm GHY}=\frac{c^3}{8\pi G_N} \int_{\partial\mathcal M}s\sqrt{|h|}\,K\,d^3y. }

Sum over boundary segments when needed. The Lorentzian divergence theorem in these conventions uses

dΣμ=snμhd3y,d\Sigma_\mu=s n_\mu\sqrt{|h|}\,d^3y,

so the Einstein–Hilbert boundary variation is AshnρVρd3yA\int s\sqrt{|h|}n_\rho V^\rho d^3y. Defining KK with an overall minus sign, or choosing different normal orientations, changes the displayed boundary-action signs. Always compare definitions before comparing formulas.

We can see the cancellation explicitly. Construct Gaussian normal coordinates by launching geodesics perpendicular to the boundary. Keep the boundary labels yay^a fixed along each such geodesic and use signed proper distance, or proper time multiplied by cc, as rr. Choose increasing rr outward. Sufficiently near the boundary these coordinates give

ds2=sdr2+hab(r,y)dyadyb,n=r,Kab=12rhab.ds^2=s\,dr^2+h_{ab}(r,y)dy^a dy^b, \qquad n=\partial_r, \qquad K_{ab}=\frac12\partial_rh_{ab}.

For variations preserving this coordinate form near the boundary, with δhab=0\delta h_{ab}=0 on the boundary itself,

δK=12habrδhab,nρVρ=habrδhab=2δK.\delta K=\frac12h^{ab}\partial_r\delta h_{ab}, \qquad n_\rho V^\rho=-h^{ab}\partial_r\delta h_{ab}=-2\delta K.

Thus

δSg,boundary=2AshδKd3y,\delta S_{g,\rm boundary} =-2A\int s\sqrt{|h|}\,\delta K\,d^3y,

whereas, because fixed habh_{ab} also means δh=0\delta\sqrt{|h|}=0 there,

δSGHY=+2AshδKd3y.\delta S_{\rm GHY} =+2A\int s\sqrt{|h|}\,\delta K\,d^3y.

They cancel. This local coordinate check isolates precisely the normal-derivative terms that made the original variation problematic.

More generally, for a smooth non-null boundary, the remaining metric boundary variation takes the form

AMsh(KabKhab)δhabd3y,A\int_{\partial\mathcal M}s\sqrt{|h|} (K_{ab}-Kh_{ab})\delta h^{ab}\,d^3y,

up to boundary-of-boundary contributions and the specified boundary conventions. It vanishes when the induced metric is fixed. The boundary action makes the chosen variational problem well posed; it does not change Einstein’s bulk field equation.

There are deliberate limits to this formula. Corners and joints generally require extra terms. Null boundaries have no unit normal and a degenerate induced metric, so the displayed GHY formula cannot simply be applied to them. Their boundary and joint terms require additional choices, including the normalization or parametrization of null generators. A detailed primary treatment is Lehner, Myers, Poisson, and Sorkin, “Gravitational action with null boundaries”.

Two variations make one field equationA two-branch flowchart separates the variation of scalar curvature from the variation of the invariant volume. The boundary divergence requires its own treatment. After that treatment, the bulk coefficient of the arbitrary inverse-metric variation is the Einstein tensor.21 / TWO VARIATIONS MAKE ONE FIELD EQUATIONThe product rule behind Einstein’s equationCurvature changesVolume changesRicci + a boundary divergenceTogether: the Einstein tensor
21 /
Two variations make one field equation. The boundary divergence requires its own treatment. After that treatment, the bulk coefficient of the arbitrary inverse-metric variation is the Einstein tensor.
WORKED EXAMPLE

A boundary term that refuses to disappear

What does fixing a boundary value fail to fix?

See the idea

We can test the boundary argument with a one-dimensional action containing a second derivative. Its endpoint values stay fixed, while the slopes at those endpoints can change. Calculating the variation shows exactly which data a boundary term must account for.

Work it out
  1. Integrate a deliberately simple action

    Take S[q]=01q(x)dx=q(1)q(0)S[q]=\int_0^1 q''(x)dx=q'(1)-q'(0). Under qq+ϵηq\to q+\epsilon\eta, its variation is the difference of endpoint derivatives of η\eta.

    δS=η(1)η(0).\delta S=\eta'(1)-\eta'(0).

    Why this step works The fundamental theorem of calculus exposes what the action actually depends on.

  2. Use an allowed fixed-value variation

    Choose η=x(1x)\eta=x(1-x). It vanishes at x=0 and x=1, so both endpoint values of q stay fixed. But η=12x\eta'=1-2x, giving δS=2\delta S=-2.

    η(0)=η(1)=0,δS=2.\eta(0)=\eta(1)=0,\qquad \delta S=-2.

    Why this step works Endpoint values do not constrain endpoint derivatives.

  3. Match the action to the boundary problem

    Adding [q]01-[q']_0^1 cancels this toy action’s entire boundary dependence. There is no bulk dynamics in this deliberately pure-boundary toy. In GR the Einstein–Hilbert action has genuine bulk dynamics as well as a derivative boundary variation; the Gibbons–Hawking–York term cancels the latter under the appropriate fixed induced-metric boundary conditions.

    Stoy[q]01=0.S_{\rm toy}-[q']_0^1=0.

    Why this step works An action’s boundary completion depends on which boundary data the problem holds fixed.

Go deeper

For a concrete GR boundary, take a timelike cylinder r=R in Minkowski spacetime, use c=1 and outward normal n=rn=\partial_r. Its induced metric is hab=diag(1,R2,R2sin2θ)h_{ab}=\operatorname{diag}(-1,R^2,R^2\sin^2\theta). The convention in the next section gives Kab=12rhabK_{ab}=\tfrac12\partial_rh_{ab}, hence K=2/RK=2/R. Over a time interval Δt\Delta t, the cylinder contributes hKd3y=8πRΔt\int\sqrt{|h|}K\,d^3y=8\pi R\Delta t. This computes that boundary segment only; closing the region can require other segments and corner terms. The spacetime is flat even though this boundary has nonzero extrinsic curvature.

Test the idea

FIRST, PREDICT

For an action containing second derivatives, is δq = 0 at the boundary alone sufficient to discard all boundary variations?

Compare the reasoning

The answer depends only on spacetime being curved.

The logical issue already occurs for a function on an ordinary interval.

No. Derivatives of δq can remain.

The toy action provides a fixed-endpoint variation with a nonzero derivative boundary term.

Yes. A boundary value fixes every derivative.

A function can vanish at a point with a nonzero slope there.

A hint

Compute the variation of the supplied total-derivative action.

NOW CHANGE THE EXAMPLE

For η=3x(1x)\eta=3x(1-x), find the variation of S[q]=01qdxS[q]=\int_0^1q''dx.

A hint

Evaluate η(1)η(0)\eta'(1)-\eta'(0).

Work through the solution

η=36x\eta'=3-6x, so δS=33=6\delta S=-3-3=-6.

A boundary term can encode essential information about the question an action is answering.

14.8 Palatini identity versus Palatini variation#

The Palatini identity used above is an identity for the variation of curvature. We used it while the connection was determined by the metric.

The Palatini formulation changes the variational problem: it treats gμνg_{\mu\nu} and a connection Γ~\widetilde\Gamma as independent fields. Assume the independent connection is torsion-free and matter does not couple to it. We will see how its equation recovers the metric connection for the Einstein–Hilbert action in dimension d>2d>2.

Define Hμν=ggμν\mathcal H^{\mu\nu}=\sqrt{-g}\,g^{\mu\nu}. This is a tensor density of weight one: under a coordinate change it transforms like an ordinary (2,0)(2,0) tensor, with an additional factor det(x/x)|\det(\partial x/\partial x')| from the volume density. Its covariant derivative includes a correction for that factor:

~λHμν=λHμν+Γ~μλρHρν+Γ~νλρHμρΓ~ρρλHμν.\begin{aligned} \widetilde\nabla_\lambda\mathcal H^{\mu\nu} ={}&\partial_\lambda\mathcal H^{\mu\nu} +\widetilde\Gamma^\mu{}_{\lambda\rho}\mathcal H^{\rho\nu} +\widetilde\Gamma^\nu{}_{\lambda\rho}\mathcal H^{\mu\rho}\\ &-\widetilde\Gamma^\rho{}_{\rho\lambda}\mathcal H^{\mu\nu}. \end{aligned}

The final term differentiates the volume-density factor. For a weight-one vector density, contraction makes its connection terms cancel, so its covariant divergence equals its ordinary divergence. That allows integration by parts with these densities.

Hold the metric fixed and vary the independent connection in HμνR~μνddx\int\mathcal H^{\mu\nu}\widetilde R_{\mu\nu}\,d^dx. The Palatini identity gives derivatives of δΓ~\delta\widetilde\Gamma. Integrating them by parts and collecting the symmetric variations δΓ~λμν\delta\widetilde\Gamma^\lambda{}_{\mu\nu} gives

~λHμν+δλ(μ~ρHν)ρ=0.-\widetilde\nabla_\lambda\mathcal H^{\mu\nu} +\delta^{(\mu}_{\lambda} \widetilde\nabla_\rho\mathcal H^{\nu)\rho}=0.

Set λ=μ\lambda=\mu and sum. The result is (d1)~ρHνρ/2=0(d-1)\widetilde\nabla_\rho\mathcal H^{\nu\rho}/2=0. Substituting this back yields

~λ(ggμν)=0.\widetilde\nabla_\lambda(\sqrt{-g}\,g^{\mu\nu})=0.

To see why this implies metric compatibility, put qλ=~λg/gq_\lambda=\widetilde\nabla_\lambda\sqrt{-g}/\sqrt{-g}. The product rule says ~λgμν=qλgμν\widetilde\nabla_\lambda g^{\mu\nu}=-q_\lambda g^{\mu\nu}. Contract with gμνg_{\mu\nu} to obtain dqλ-d q_\lambda. Independently, the determinant identity gives

2qλ=gμνλgμν2Γ~ρρλ=gμν~λgμν.2q_\lambda=g^{\mu\nu}\partial_\lambda g_{\mu\nu} -2\widetilde\Gamma^\rho{}_{\rho\lambda} =g^{\mu\nu}\widetilde\nabla_\lambda g_{\mu\nu}.

Differentiating the inverse-metric identity makes gμν~λgμν=2qλg_{\mu\nu}\widetilde\nabla_\lambda g^{\mu\nu}=-2q_\lambda. Thus (d2)qλ=0(d-2)q_\lambda=0. For d>2d>2, qλ=0q_\lambda=0 and ~g=0\widetilde\nabla g=0. Together with zero torsion, this selects the Levi-Civita connection by Chapter 7’s uniqueness result.

This equivalence uses the stated action and matter assumptions. Changing the curvature action, allowing matter to couple to the independent connection, or allowing torsion changes the variational equations and requires a separate analysis.

The idea to keep

Varying RR gives Ricci plus a divergence; varying the volume element gives the trace subtraction. Boundaries are part of the variational problem.

Does setting δg=0\delta g=0 on the boundary automatically set its normal derivative to zero?

No. A function can vanish on a surface while having a nonzero normal derivative there. The Einstein–Hilbert boundary variation must be handled with suitable terms and conditions.

Figure detail

Scroll to explore at full resolution. Colors follow your reading theme.