Skip to content

Variational and classical-field repair

A field equation does not follow from an action by a formal command to “vary and discard a total derivative.” It follows from a first variation in which the fields, region, allowed variations, and boundary data have all been declared. This focused review rebuilds that calculation for a scalar field and then transfers it to Maxwell theory, where a singular Legendre map introduces constraints.

The goal is practical: given a local action, you should be able to display its bulk and surface terms, explain what makes the surface term vanish or cancel, and separate an interior Euler–Lagrange equation from boundary data and canonical constraints.

Required background. You should be comfortable differentiating functions of several variables, integrating by parts, and tracking upper and lower indices. If the last step is uncertain, begin with Linear and tensor methods. The formulas below inherit the site’s conventions and normalizations.

From a local action to its first variation

Section titled “From a local action to its first variation”

Let ΦA\Phi^A be smooth real field components on a spacetime region Ω\Omega, and consider a first-derivative local action

S[Φ]=ΩddxL ⁣(ΦA,μΦA;x).S[\Phi] = \int_\Omega \mathrm d^d x\, \mathcal L\!\left(\Phi^A,\partial_\mu\Phi^A;x\right).

A variation is a one-parameter family ΦεA=ΦA+εηA\Phi^A_\varepsilon=\Phi^A+\varepsilon\eta^A through admissible configurations. Thus ηA\eta^A has the same tensor and reality properties as ΦA\Phi^A and is tangent to whatever boundary data have been fixed. Before any integration by parts,

δS=Ωddx[LΦAηA+L(μΦA)μηA].\delta S = \int_\Omega \mathrm d^d x\, \left[ \frac{\partial\mathcal L}{\partial\Phi^A}\eta^A + \frac{\partial\mathcal L} {\partial(\partial_\mu\Phi^A)} \partial_\mu\eta^A \right].

Define

PAμL(μΦA).P_A^\mu \equiv \frac{\partial\mathcal L} {\partial(\partial_\mu\Phi^A)}.

One integration by parts gives the decisive decomposition

δS=Ωddx(LΦAμPAμ)ηA+ΩdΣμPAμηA.\begin{aligned} \delta S ={}& \int_\Omega \mathrm d^d x\, \left( \frac{\partial\mathcal L}{\partial\Phi^A} -\partial_\mu P_A^\mu \right)\eta^A \\ &+ \int_{\partial\Omega}\mathrm d\Sigma_\mu\, P_A^\mu\eta^A . \end{aligned}

Here dΣμ\mathrm d\Sigma_\mu is the outward-directed surface element. If the action also contains a boundary functional, its variation must be added to the second line before stationarity is tested.

Compactly supported ηA\eta^A vanish near Ω\partial\Omega. Stationarity for every such variation therefore implies the interior Euler–Lagrange equations

LΦAμL(μΦA)=0.\frac{\partial\mathcal L}{\partial\Phi^A} - \partial_\mu \frac{\partial\mathcal L} {\partial(\partial_\mu\Phi^A)} =0.

That argument says nothing about the boundary. On a finite region, the remaining surface variation must vanish for the allowed boundary variations, or be cancelled or reshaped by a boundary functional. This is a differentiability test for the action, not by itself a theorem about existence, uniqueness, or stability of the resulting differential equation Harlow and Wu 2020, §§1 and 2.2.

Use the same four moves every time:

  1. State the fields, action, region, and data held fixed.
  2. Vary first; do not impose the field equations.
  3. Integrate by parts once and retain every surface contribution.
  4. Classify each resulting condition by its origin and role.

Scalar field: the surface term chooses the problem

Section titled “Scalar field: the surface term chooses the problem”

For one real scalar, take

S[ϕ]=Ωddx[12μϕμϕV(ϕ)].S[\phi] = \int_\Omega\mathrm d^d x\, \left[ \frac12\partial_\mu\phi\,\partial^\mu\phi -V(\phi) \right].

The unintegrated variation and its bulk–boundary split are

δS=Ωddx[μϕμδϕV(ϕ)δϕ]=Ωddx[ϕ+V(ϕ)]δϕ+ΩdΣμμϕδϕ.\begin{aligned} \delta S &= \int_\Omega\mathrm d^d x\, \left[ \partial_\mu\phi\,\partial^\mu\delta\phi -V'(\phi)\delta\phi \right] \\ &= -\int_\Omega\mathrm d^d x\, \left[\Box\phi+V'(\phi)\right]\delta\phi + \int_{\partial\Omega}\mathrm d\Sigma_\mu\, \partial^\mu\phi\,\delta\phi . \end{aligned}

Arbitrary compactly supported variations give

ϕ+V(ϕ)=0.\Box\phi+V'(\phi)=0.

Several different boundary problems can share this same bulk equation:

  • Fixed field value (Dirichlet). If ϕ\phi is fixed on a boundary component, every allowed variation obeys δϕ=0\delta\phi=0 there. The displayed surface term then vanishes without an extra boundary functional.
  • Free field value. If δϕ\delta\phi is arbitrary at a smooth non-null boundary and no boundary functional is added, stationarity produces the natural condition nμμϕ=0n_\mu\partial^\mu\phi=0.
  • Fixed normal flux. Holding pϕ=nμμϕp_\phi=n_\mu\partial^\mu\phi fixed is not the same as leaving ϕ\phi free. A boundary Legendre term ΩdΣϕpϕ-\int_{\partial\Omega}\mathrm d\Sigma\,\phi p_\phi changes the residual variation from pϕδϕp_\phi\delta\phi to ϕδpϕ-\phi\,\delta p_\phi on a fixed boundary geometry.
  • Robin data. A boundary functional depending on ϕ\phi can make a linear combination of ϕ\phi and its normal derivative the natural boundary equation. Its sign must be checked by varying the complete action again.

The full comparison of these choices is developed in Boundaries, variations, and well-posed actions. Notice also that fixing a variation on initial and final time caps for the stationary-action derivation is not the same task as supplying Cauchy data on one time slice and proving that the equations evolve it uniquely.

For the diagnostic potential

V(ϕ)=12m2ϕ2+λ4!ϕ4,V(\phi)=\frac12m^2\phi^2+\frac{\lambda}{4!}\phi^4,

the equation is

(+m2)ϕ+λ3!ϕ3=0.(\Box+m^2)\phi+\frac{\lambda}{3!}\phi^3=0.

Three quick checks are available. Setting λ=0\lambda=0 recovers the free Klein–Gordon equation. With the inherited Fourier convention, p2\Box\mapsto-p^2, so a free plane wave obeys p2=m2p^2=m^2. Finally, in natural units [L]=d[\mathcal L]=d and the kinetic term gives [ϕ]=(d2)/2[\phi]=(d-2)/2, making every term in the equation have the same engineering dimension. The scalar derivation and its assumptions are treated more fully in The action principle and field equations and Schwartz 2014, §3.2.

Equations, constraints, and boundary conditions

Section titled “Equations, constraints, and boundary conditions”

These labels answer different questions; they are not interchangeable.

Kind of conditionHow it is foundWhat it controls
Euler–Lagrange equationCoefficient of an arbitrary interior variationWhich spacetime configurations are on shell
Boundary conditionDeclared boundary data or coefficient of a free boundary variationWhich boundary traces or fluxes are allowed
Primary constraintRelation among fields and canonical momenta caused by a singular velocity HessianWhich points belong to the canonical initial-data surface

Choose a time coordinate and define

πA=LΦ˙A,WAB=2LΦ˙AΦ˙B.\pi_A = \frac{\partial\mathcal L}{\partial\dot\Phi^A}, \qquad W_{AB} = \frac{\partial^2\mathcal L} {\partial\dot\Phi^A\partial\dot\Phi^B}.

If WABW_{AB} is invertible, the velocities can locally be recovered from the momenta. If it has a null direction, the definitions of the momenta instead imply one or more relations among (ΦA,πA)(\Phi^A,\pi_A): primary constraints. A complete constrained-Hamiltonian analysis must then preserve those relations under time evolution, which can generate further constraints Henneaux and Teitelboim 1992, chs. 1–3.

There is an important overlap in terminology. An Euler–Lagrange equation may be an evolution equation after a time split, or it may constrain initial data without solving for a highest time derivative. Maxwell’s Gauss equation is an Euler–Lagrange equation and a canonical constraint. By contrast, the primary relation π0=0\pi^0=0 follows directly from the singular Legendre map. Neither is a boundary condition.

Maxwell theory: variation and the singular Legendre map

Section titled “Maxwell theory: variation and the singular Legendre map”

Let

Fμν=μAννAμ,S[A]=14ΩddxFμνFμν.F_{\mu\nu}=\partial_\mu A_\nu-\partial_\nu A_\mu, \qquad S[A]=- \frac14\int_\Omega\mathrm d^d x\, F_{\mu\nu}F^{\mu\nu}.

Using the antisymmetry of FμνF^{\mu\nu},

δS=ΩddxFμνμδAν=Ωddx(μFμν)δAνΩdΣμFμνδAν.\begin{aligned} \delta S &=-\int_\Omega\mathrm d^d x\, F^{\mu\nu}\partial_\mu\delta A_\nu \\ &= \int_\Omega\mathrm d^d x\, (\partial_\mu F^{\mu\nu})\delta A_\nu - \int_{\partial\Omega}\mathrm d\Sigma_\mu\, F^{\mu\nu}\delta A_\nu . \end{aligned}

Variations of compact support give the vacuum Maxwell equations

μFμν=0.\partial_\mu F^{\mu\nu}=0.

For a finite region, fixing the appropriate pullback of AνA_\nu makes the surface variation vanish; flux-type data require a different boundary test. This boundary choice is independent of the canonical degeneracy below.

Taking AνA_\nu as the configuration variables, the canonical momenta are

πνL(0Aν)=F0ν=Fν0.\pi^\nu \equiv \frac{\partial\mathcal L}{\partial(\partial_0 A_\nu)} =-F^{0\nu} =F^{\nu 0}.

Therefore

π0=0,πi=Fi0.\pi^0=0, \qquad \pi^i=F^{i0}.

No 0A0\partial_0A_0 can be recovered from these definitions, so the velocity Hessian has a null direction and π0=0\pi^0=0 is a primary constraint. The ν=0\nu=0 Euler–Lagrange equation is

iFi0=iπi=0,\partial_iF^{i0}=\partial_i\pi^i=0,

the source-free Gauss constraint. It contains no second time derivative of A0A_0; in the Hamiltonian analysis it arises when the primary constraint is preserved. The spatial ν=i\nu=i equations contain the evolution of the electric field. Meanwhile, a statement such as δAν=0\delta A_\nu=0 on a chosen boundary is boundary data. The origins of all three statements are now visibly different.

This calculation diagnoses the constraint structure; it does not finish the Dirac–Bergmann algorithm or count physical polarizations. Continue to Hamiltonian initial data and phase space or Constraints, Dirac brackets, and symplectic reduction when that fuller analysis is needed.

1. A scalar on an interval with Robin walls

Section titled “1. A scalar on an interval with Robin walls”

On the time slab [ti,tf]×[0,L][t_i,t_f]\times[0,L], consider

S[ϕ]=12titfdt0Ldx[ϕ˙2(ϕ)2m2ϕ2]12titfdt[κ0ϕ(t,0)2+κLϕ(t,L)2].\begin{aligned} S[\phi] ={}&\frac12\int_{t_i}^{t_f}\mathrm dt \int_0^L\mathrm dx\, \left[\dot\phi^2-(\phi')^2-m^2\phi^2\right] \\ &-\frac12\int_{t_i}^{t_f}\mathrm dt\, \left[\kappa_0\phi(t,0)^2+\kappa_L\phi(t,L)^2\right]. \end{aligned}

Set δϕ=0\delta\phi=0 at the time caps but allow it to vary freely at x=0x=0 and x=Lx=L. Derive the bulk equation and both wall equations. Classify each.

Solution

Varying the bulk action before integrating gives

δSbulk=dtdx[ϕ˙δϕ˙ϕδϕm2ϕδϕ].\delta S_{\mathrm{bulk}} = \int\mathrm dt\,\mathrm dx\, \left[ \dot\phi\,\delta\dot\phi -\phi'\delta\phi' -m^2\phi\delta\phi \right].

The fixed time-cap variations remove the temporal endpoint term. Integration by parts in both variables gives

δSbulk=dtdx(ϕ¨ϕ+m2ϕ)δϕ+dt[ϕ(t,0)δϕ(t,0)ϕ(t,L)δϕ(t,L)].\begin{aligned} \delta S_{\mathrm{bulk}} ={}&- \int\mathrm dt\,\mathrm dx\, (\ddot\phi-\phi''+m^2\phi)\delta\phi \\ &+ \int\mathrm dt\, \left[ \phi'(t,0)\delta\phi(t,0) -\phi'(t,L)\delta\phi(t,L) \right]. \end{aligned}

The boundary functional contributes

δSwall=dt[κ0ϕ(t,0)δϕ(t,0)+κLϕ(t,L)δϕ(t,L)].\delta S_{\mathrm{wall}} =- \int\mathrm dt\, \left[ \kappa_0\phi(t,0)\delta\phi(t,0) +\kappa_L\phi(t,L)\delta\phi(t,L) \right].

Arbitrary interior variations give the Euler–Lagrange equation

ϕ¨ϕ+m2ϕ=0.\ddot\phi-\phi''+m^2\phi=0.

Because the wall variations are free, their two coefficients must vanish:

ϕ(t,0)κ0ϕ(t,0)=0,ϕ(t,L)+κLϕ(t,L)=0.\phi'(t,0)-\kappa_0\phi(t,0)=0, \qquad \phi'(t,L)+\kappa_L\phi(t,L)=0.

The opposite signs of the derivatives reflect the opposite outward normals. These are natural Robin boundary equations, not additional bulk Euler–Lagrange equations and not canonical constraints. If the wall values of ϕ\phi had instead been fixed, δϕ\delta\phi would vanish there and these Robin equations would not follow.

Starting from the Maxwell density, compute L/(μAν)\partial\mathcal L/\partial(\partial_\mu A_\nu). Use it to derive the canonical momenta and the ν=0\nu=0 field equation. Then classify π0=0\pi^0=0, iπi=0\partial_i\pi^i=0, and δAνΩ=0\delta A_\nu|_{\partial\Omega}=0.

Solution

Since δL=FμνμδAν\delta\mathcal L=-F^{\mu\nu}\partial_\mu\delta A_\nu,

L(μAν)=Fμν.\frac{\partial\mathcal L}{\partial(\partial_\mu A_\nu)} =-F^{\mu\nu}.

Setting μ=0\mu=0 gives

πν=F0ν=Fν0,\pi^\nu=-F^{0\nu}=F^{\nu0},

so π0=0\pi^0=0 and πi=Fi0\pi^i=F^{i0}. The first relation follows before any equation of motion is imposed and reveals that the Legendre map cannot recover 0A0\partial_0A_0; it is a primary constraint.

The ν=0\nu=0 Euler–Lagrange equation is

μFμ0=iFi0=iπi=0.\partial_\mu F^{\mu0} = \partial_iF^{i0} = \partial_i\pi^i =0.

It is the Gauss equation in the covariant derivation and a constraint on canonical initial data after a time split. In the full Hamiltonian analysis it is generated by preserving π0=0\pi^0=0. Finally, δAνΩ=0\delta A_\nu|_{\partial\Omega}=0 restricts the allowed boundary variations; it is boundary data. It neither follows from the velocity Hessian nor replaces the Gauss equation.

3. A total divergence is boundary data, not zero

Section titled “3. A total divergence is boundary data, not zero”

Replace a scalar density by L=L+μKμ(ϕ)\mathcal L'=\mathcal L+\partial_\mu K^\mu(\phi). Show what changes in the first variation and explain why the bulk equations agree for compactly supported variations but a finite-region variational problem can change.

Solution

The action changes by a surface functional,

SS=ΩdΣμKμ(ϕ).S'-S = \int_{\partial\Omega}\mathrm d\Sigma_\mu\,K^\mu(\phi).

Its variation is

δ(SS)=ΩdΣμKμϕδϕ,\delta(S'-S) = \int_{\partial\Omega}\mathrm d\Sigma_\mu\, \frac{\partial K^\mu}{\partial\phi}\,\delta\phi,

for a fixed boundary geometry. This contribution vanishes for variations of compact support, so the interior Euler–Lagrange equations are unchanged. On a finite region with nonzero boundary variations, however, it changes the surface coefficient and can therefore change the natural boundary equation or the boundary functional needed for fixed data. “Total derivative” means “pure boundary contribution” here, not “identically zero.”

Repeat the variational part of the classical-field and relativity diagnostic with a potential different from the one above, or use Maxwell theory with a boundary choice you state explicitly. Your work is ready to carry forward when it contains:

  • the field content, action, region, and admissible variations;
  • the unintegrated first variation;
  • a checked bulk–boundary split;
  • the interior Euler–Lagrange equations;
  • the exact boundary condition or boundary functional that controls every surface term;
  • the canonical momenta and velocity-Hessian test; and
  • separate labels for primary constraints, any constraint-type field equations, evolution equations, and boundary data.

If every item is explicit and the scalar and Maxwell signs survive a direct recalculation, return to Classical fields, actions, and local dynamics. If the bulk equation is correct but the surface term or Legendre-map argument remains implicit, redo one exercise with changed coefficients before returning. If an integration by parts or index contraction is still blocking the calculation, revisit Field variations and boundary terms or Linear and tensor methods, then repeat the same line rather than restarting the entire route.

  • Daniel Harlow and Jie-qiang Wu, “Covariant Phase Space with Boundaries,” Journal of High Energy Physics 2020, no. 10 (2020): 146, doi:10.1007/JHEP10(2020)146, Open PDF.
  • Marc Henneaux and Claudio Teitelboim, Quantization of Gauge Systems, Princeton University Press, 1992, publisher page.
  • Matthew D. Schwartz, Quantum Field Theory and the Standard Model, Cambridge University Press, 2014, doi:10.1017/9781139540940.