Skip to content

Variational Derivatives and Field Equations

Scrollable formula. Use Left and Right arrow keys to reveal hidden content.

Scrollable table. Use Left and Right arrow keys to reveal additional columns.

Scrollable figure. Use Left and Right arrow keys to inspect hidden content.

Symbolic variation is valuable not because it hides integrations by parts, but because it can expose every one of them in a checkable form. For a gravitational action the desired output is a pair: a bulk Euler–Lagrange tensor and a boundary current. Returning only the familiar field equation loses information needed to decide whether the stated boundary-value problem is differentiable.

Required background. Connections and Covariant Derivatives supplies the derivative identities and integrations by parts, while Curvature supplies the metric variation of curvature.

Helpful background. Formulations of General Relativity develops the continuum field equations and their formulations; Ordinary Differential Equations supports reductions of those equations; and Spacetime Symmetries and Killing Fields provides the symmetry transformations behind Noether identities.

Variation as a bulk–boundary decomposition

Section titled “Variation as a bulk–boundary decomposition”

Take the independent variable to be gabg^{ab} and consider

S[g]=116πG∫Md4x −g (R−2Λ).S[g]=\frac{1}{16\pi G}\int_{\mathcal M}d^4x\, \sqrt{-g}\,(R-2\Lambda).

With the site curvature convention, a direct variation has the structure

δS=116πG∫Md4x −g[(Gab+Λgab)δgab+∇aΘa],\delta S=\frac{1}{16\pi G}\int_{\mathcal M}d^4x\,\sqrt{-g} \left[(G_{ab}+\Lambda g_{ab})\delta g^{ab}+\nabla_a\Theta^a\right],

where one convenient representative is

Θa=gbc∇aδgbc−∇bδgab.\Theta^a=g_{bc}\nabla^a\delta g^{bc}-\nabla_b\delta g^{ab}.

Adding the divergence of an antisymmetric tensor changes the representative without changing the integrated boundary term. This ambiguity must not be confused with losing the term altogether. The covariant decomposition of a Lagrangian variation into equations of motion and a symplectic-potential current is stated precisely in Iyer and Wald 1994, § III, Eqs. 20–24.

To reconstruct the result, write hab=δgabh^{ab}=\delta g^{ab} and use

δ−g=−12−g gabhab,δgab=−gacgbdhcd.\delta\sqrt{-g}=-\frac12\sqrt{-g}\,g_{ab}h^{ab}, \qquad \delta g_{ab}=-g_{ac}g_{bd}h^{cd}.

The Palatini identity is δRab=∇cδΓcab−∇bδΓcac\delta R_{ab}=\nabla_c\delta\Gamma^c{}_{ab}-\nabla_b\delta\Gamma^c{}_{ac}, so metric compatibility gives

δR=Rabhab+∇a ⁣(gbc∇ahbc−∇bhab).\delta R=R_{ab}h^{ab} +\nabla_a\!\left(g_{bc}\nabla^ah^{bc}-\nabla_bh^{ab}\right).

Combining this with the determinant variation produces Rab−12RgabR_{ab}-\tfrac12Rg_{ab} in the bulk; varying −2Λ−g-2\Lambda\sqrt{-g} adds +Λgab+\Lambda g_{ab}. This derivation makes both the inverse-metric sign and the boundary current independently visible.

An algorithm that keeps discarded terms visible

Section titled “An algorithm that keeps discarded terms visible”

A safe symbolic implementation introduces a fresh symmetric tensor hab=δgabh^{ab}=\delta g^{ab} and a formal variation operator obeying the product rule. It varies the determinant, inverse metric, connection, and curvature before canonicalization. Covariant derivatives are moved off habh^{ab} one at a time, with each integration by parts adding an explicit divergence node. Only after the bulk coefficient of habh^{ab} and the boundary current have been separated should tensor symmetries and Bianchi identities simplify them.

The software environment must pin the computer-algebra system, tensor and variational packages, dimension, signature, curvature sign, choice of gabg^{ab} rather than gabg_{ab} as the independent field, and the rule used for total derivatives. An automated variational derivative may intentionally discard divergences; the xTras implementation and its field-theory operators are described in Nutma 2014, §§ 2–3 and Appendix A. Such an operator is suitable for the bulk coefficient only if a separate pass retains the discarded current.

The benchmark uses three checks that probe different failure modes. First, the coefficient of habh^{ab} must be symmetric and equal to Gab+ΛgabG_{ab}+\Lambda g_{ab}. Second, diffeomorphism invariance requires the off-shell identity

∇a(Gab+Λgab)=0,\nabla^a(G_{ab}+\Lambda g_{ab})=0,

after the differential Bianchi identity and constant Λ\Lambda are declared. Third, let MM be the physical Schwarzschild mass, so GMGM is its geometrized length in the inherited c=1c=1 units, and substitute the solution with Λ=0\Lambda=0 on r>2GMr\gt 2GM. Every bulk component must vanish, while an independently constructed curvature pipeline still gives RabcdRabcd=48(GM)2/r6R_{abcd}R^{abcd}=48(GM)^2/r^6. This prevents a rule that simply sets all curvature to zero from passing.

For a finite region, test variations that obey the proposed boundary data but whose normal derivatives remain nonzero. Fixing the induced metric sets tangential metric variations to zero on a non-null boundary; it does not set their normal derivatives to zero. The bare Einstein–Hilbert action can therefore retain the integral of Θa\Theta^a even for an allowed variation, and needs the appropriate boundary term for the usual Dirichlet problem. Merely choosing a variation that violates the fixed boundary data would not establish that failure. This negative test catches an engine that always drops total derivatives. Iyer and Wald’s later construction of the Noether current makes the dependence on the potential current explicit; see Iyer and Wald 1994, Eqs. 40, 43, and 62.

A fully specified rerun sequence starts a clean kernel, declares the manifold and metric, loads pinned package versions, constructs the Lagrangian density, varies with respect to gabg^{ab}, exports every pre-integration-by-parts term, separates bulk and divergence pieces, canonicalizes them, and evaluates the three checks above. The machine-readable output should include the action, field choice, assumptions, simplification rules, bulk residual, divergence current, Bianchi residual, Schwarzschild substitution, package versions, and command sequence. This is a specification for a rerun, not a claim that repository code has executed it.

Exact algebra has no mesh convergence, but the validation sequence has a meaningful refinement hierarchy. Run first with only one-term tensor symmetries, then add derivative commutators, then the Bianchi identity; record which residual becomes zero at each stage. For numerical spot checks of the Schwarzschild components, raise working precision and demand decreasing discrepancy below a declared tolerance. Failure occurs if the result depends on a dummy-index name, if a boundary term vanishes only after an unstated boundary condition, or if varying gabg_{ab} is mixed with formulas for varying gabg^{ab}.

A program returns Gab+ΛgabG_{ab}+\Lambda g_{ab} exactly from the action, and its Bianchi residual vanishes. It discarded every total derivative at the start. Has it verified the action principle on a region with boundary?

Solution

No. Those checks validate the bulk Euler–Lagrange tensor, but not differentiability of the action. Recompute while retaining the divergence current, specify the allowed boundary variations, and include or derive the required boundary term. The missing information cannot be reconstructed from the bulk equation alone.

  • Iyer, V., and Wald, R. M. (1994), “Some Properties of Noether Charge and a Proposal for Dynamical Black Hole Entropy,” Physical Review D 50, 846–864. arXiv.
  • Nutma, T. (2014), “xTras: A Field-Theory Inspired xAct Package for Mathematica,” Computer Physics Communications 185, 1719–1738. arXiv.
  • MacCallum, M. A. H. (2018), “Computer Algebra in Gravity Research,” Living Reviews in Relativity 21, 6. DOI.