Physics[LagrangeEquations] - compute the Lagrange equations or the EnergyMomentum tensor corresponding to a given Lagrangian
Calling Sequence
LagrangeEquations(L, F)
Parameters
L
-
any algebraic expressions representing a Lagrangian; there are no restrictions to the differentiation order of the derivatives of the coordinates or fields
F
a name indicating the coordinate, without the coordinate's dependency, or a set or list of them in the case of a system with many degrees of freedom. NOTE : F can also be EnergyMomentum, with or without two spacetimeindices. If so, the output is the conserved energy-momentum tensor of the physical model represented by L
Description
LagrangeEquations receives an expression representing a Lagrangian L and returns a sequence of Lagrange equations, of the form expression=0, with as many equations as coordinates are indicated in the list or set F. In the case of only one degree of freedom (one coordinate), F can also be the coordinate itself, and the output consists of a single Lagrange equation. While the coordinates in L are functions, the coordinates in F shall be passed as names, without their dependency. For example, in the case of one single parameter t and a coordinate q⁡t, pass q. It is expected that these names appear in the Lagrangian consistently, always with the same functionality.
In addition to handling Lagrangians with standard functions and their derivatives, LagrangeEquations handles Lagrangians involving tensors and vectors of the Physics package, as well as derivatives using vectorial and tensorial differential operators (see Nabla, d_ and D_).
LagrangeEquations operates by constructing the action as the integral of L over a closed region Ω of the space spanned by the n parameters x,
S=∫ΩLⅆxn
and equating to 0 its functional derivative with respect to each qi
δ Sδ qⅈ=0
It is assumed that δ qⅈ=0 on the boundary of Ω. The functional derivative is computed using Fundiff, so LagrangeEquations automatically handles 1st and higher derivatives of the coordinates qi in the Lagrangian.
The output of LagrangeEquations in the classical case where the Lagrangian depends on 1st order derivatives of qi and there is only one parameter t is thus the same as
∂L∂qi−ⅆⅆt∂L∂q.i=0
where ∂L∂q.i represents the derivative of L with respect to the ith velocity q.__i. Note that in more general cases the number of parameters can be many. For example, in electrodynamics, the "coordinate" is a tensor field Aμ⁡x,y,z,t, representing four coordinates, one for each of the values of the index μ, and there are four parameters x,y,z,t.
In a realistic model, the action integral S is invariant under coordinate transformations. For that, L must be a scalar, and when there is more than one parameter, a scalar density. This condition on L is particularly relevant in general relativity, where the "coordinate" of the model is the metric field gμ,ν, the space and time coordinates are the parameters and the spacetime is curved. Hence, L has the factor − g involving the determinant of the metric g , represented in Maple using the inert metric command %g_[determinant]. Likewise, for any model, additional requirements concerning the invariance properties of the coordinates or fields involved restrict the classes of admissible Lagrangians. The LagrangeEquations command does not check these invariance conditions and the equations returned assume all those conditions are satisfied.
In the case of general relativity, as discussed in Chapter 8 of ref.[3], the conditions on L mentioned in the previous paragraph restrict the dependence of the Lagrangian to derivatives of the metric of order not greater than two. When L depends only on 1st order derivatives of the metric (this can sometimes be achieved by adding a total derivative to a Lagrangian originally depending on 2nd order derivatives, see the Examples section), constructing the action integral and taking the functional derivative is equivalent to using the standard formula
ⅆLⅆgμ,ν−∂α⁡ⅆLⅆ∂α⁡gμ,ν=0
When L depends on 2nd order derivatives of the metric, the equivalent formula would be
ⅆLⅆgμ,ν−∂α⁡ⅆLⅆ∂α⁡gμ,ν+∂α⁡∂β⁡ⅆLⅆ∂β⁡∂α⁡gμ,ν=0
However, this formula does not discard total derivatives which would require additional assumptions to be eliminated, namely that on the corresponding boundary integrals of the action integral the variation of the metric vanishes. If that assumption is made, this formula can be rewritten (see ref[3] Chapter 8) in terms of the Riemann tensor and covariant derivatives as follows
g⁢μ,ν⁢μ,ν⁢L2+23⁢ⅆLⅆ∂β⁡∂σ⁡gα,μ⁢R⁢νβ,α,σ⁢νβ,α,σ+▿σ⁡▿β⁡ⅆLⅆ∂β⁡∂σ⁡gμ,ν=0
As is standard, the LagrangeEquations command makes that assumption, and in the case of general relativity, for computationally efficiency, and taking into account that the Lagrangian cannot depend on derivatives of the metric of order higher than 2, the above are the formulas used instead of constructing the action integral and functionally differentiating.
As shown at the end of the Examples section, the Einstein equations can as well be derived in steps, constructing the action integral S and equating to zero its functional derivative with respect to the metric gμ,ν. In doing so, total derivatives are automatically discarded by Fundiff, and the compact form in terms of the Ricci tensor is obtained after a few further tensor substitutions.
In both flat and curved spacetimes, and for Lagrangians representing any physical model (scalar field, electromagnetic field, etc.), the energy-momentum tensor Tμ,ν, also called stress-energy tensor, can be computed taking the functional derivative of the action integral S according to
Tμ,ν=2− g δ Sδ gμ,νμ,ν
This energy-momentum tensor, represented in Maple by the EnergyMomentum command, can be computed by calling LagrangeEquations with the keyword EnergyMomentum or in indexed form EnergyMomentum[a, b] where a and b are expected to be spacetime indices. The formula above assumes the signature to have the timelike component positive, so either ---+ (default Physics signature) or +---. If the signature has a negative timelike component as in +++- or -+++, the right-hand side of this formula above is multiplied by -1. To use the output of LagrangeEquations as the definition of the EnergyMomentum tensor, you can use the Define command - see the Examples section.
Examples
with(Physics):
Setup(mathematicalnotation = true, coordinates = cartesian);
⁢Systems of spacetime coordinates are:⁢X=x,y,z,t
_______________________________________________________
coordinatesystems=X,mathematicalnotation=true
LagrangeEquations can be used in general in the context of variational principles; below are examples of its use in typical areas of Physics.
Classical Mechanics
The Lagrangian of a one-dimensional oscillator - small oscillations
L := 1/2*diff(x(t), t)^2 - 1/2*k*x(t)^2;
L≔x.⁡t22−k⁢x⁡t22
The corresponding Lagrange equation gives Newton's second law, a 2nd order linear ODE for x⁡t
LagrangeEquations(L, x);
x⁡t⁢k+x..⁡t=0
The Lagrangian of a pendulum of mass m and length l where the suspension point moves uniformly over a vertical circumference centered at the origin, with a constant frequency ω
CompactDisplay(phi(t));
φ⁡t⁢will now be displayed as⁢φ
L := 1/2*m*(-(2*diff(phi(t), t))*a*l*omega*sin(omega*t - phi(t)) + diff(phi(t), t)^2*l^2 + (2*cos(phi(t)))*g*l);
L≔m⁢−2⁢φ.⁢a⁢l⁢ω⁢sin⁡ω⁢t−φ+φ.2⁢l2+2⁢cos⁡φ⁢g⁢l2
The Lagrange equations
LagrangeEquations(L, phi);
a⁢ω2⁢cos⁡t⁢ω−φ−sin⁡φ⁢g−φ..⁢l=0
Relativistic Mechanics
In relativistic mechanics the Lagrangian of a free particle is proportional to the interval ds=dxμ⁢dxμ. Dividing dxμ by dτ, where τ is the proper time, the Lagrangian can be expressed in terms of the 4-velocity dxμdτ
L__rm := -m * diff(X[mu](tau), tau) * diff(X[~mu](tau), tau);
L__rm≔−m⁢Xμτ⁢X⁢μ⁢μτ
The corresponding Lagrange equation reflects the absence of acceleration
LagrangeEquations(L__rm, X[~mu]);
X⁢μ⁢μ⁡ττ,τ=0
In steps, the action is
S__rm := Intc(L__rm, tau);
S__rm≔∫−∞∞−m⁢Xμτ⁢X⁢μ⁢μτⅆτ
Equating to 0 its functional derivative with respect to the SpaceTimeVector,
Fundiff(S__rm, X[mu](sigma)) = 0;
m⁢g⁢μ,ν⁢μ,ν⁢Xν⁡σσ,σ+m⁢δνμνμ⁢X⁢ν⁢ν⁡σσ,σ=0
Simplify((10));
2⁢m⁢X⁢μ⁢μ⁡σσ,σ=0
This equation can also be computed directly from geometrical considerations as the geodesic for the current (Minkowski) metric
Geodesics(tensornotation);
Electrodynamics
Maxwell equations can be derived as the Lagrange equations for the corresponding Lagrangian. For this purpose, define the 4D electromagnetic potential and current Aμ and Jμ, and it is useful to define them directly as functions of the coordinates by indicating the functionality on the right-hand side of the defining equations:
Define(A[mu] = A[mu](X), J[mu] = J[mu](X));
Defined objects with tensor properties
Aμ,γμ,Jμ,σμ,∂μ,gμ,ν,εα,β,μ,ν,Xμ,SpaceTimeVector⁢μ⁢μ⁡τ
This form of definition tells the system that both Aμ and Jμ are functions of X so that you don't need to specify the dependency. Define the electromagnetic field tensor in terms of derivatives of Aμ
F[mu, nu] = d_[mu](A[nu]) - d_[nu](A[mu]);
Fμ,ν=∂μ⁡Aν−∂ν⁡Aμ
Define((14), quiet):
The Lagrangian (see ref.1, section 28):
L__EM := - F[mu, nu]^2/(16*Pi) - A[mu]*J[mu];
L__EM≔−Fμ,ν⁢F⁢μ,ν⁢μ,ν16⁢π−Aμ⁢J⁢μ⁢μ
The two terms above have the same sign, the one of the timelike component of the signature in use (+++-).
The corresponding Lagrange equations
LagrangeEquations(L__EM, A);
−4⁢π⁢J⁢α⁢α+□⁡A⁢α⁢α−∂μ⁡∂⁢α⁢α⁡A⁢μ⁢μ=0
These equations can be rewritten in the usual form, in terms of the 4-divergence of the electromagnetic field tensor Fμ,ν:
F[definition];
d_[nu](F[definition]);
∂ν⁡Fμνμν=∂μ⁡∂ν⁡A⁢ν⁢ν−□⁡Aμ
Isolate the second derivative of Aμ from the output (10) of LagrangeEquations and substitute into this expression (12) for the 4-divergence of Fμ,ν
isolate((16), d_[mu](d_[~alpha](A[~mu])));
∂μ⁡∂⁢α⁢α⁡A⁢μ⁢μ=−4⁢π⁢J⁢α⁢α+□⁡A⁢α⁢α
Substitute((19), (18));
∂ν⁡Fμνμν=−4⁢π⁢Jμ
The energy-momentum tensor can be computed as the Lagrange equations taking the metric as the coordinate, not equating to 0 the result, but multiplying δ Sδ gμ,νμ,ν by 2−g. For that purpose, pass EnergyMomentum, with or without spacetime indices as an extra argument. Note however that the sector of the Lagrangian to be passed when computing the energy-momentum tensor may depend on physical considerations. For example, in electrodynamics, the action for the whole system has three terms, one for the free particles, another for their interaction with the electromagnetic field (2nd term in LEM, assuming Aμ and Jμ don't depend on the positions or velocities of the particles even if they are charged) and the one that determines the electromagnetic field itself (1st term in LEM).
The energy-momentum tensor Τ⁢μ,ν⁢μ,ν is then computed variating the action as a function of the coordinates of the particles but without variating Aμ or the trajectories of the particles which satisfy the equations of motion. Hence only the part of the Lagrangian that involves the electromagnetic tensor field Fμ,ν is considered for computing Tμ,ν (see ref.[1], sections 28 and 32)
L__F := select(has, L__EM, F);
L__F≔−Fμ,ν⁢F⁢μ,ν⁢μ,ν16⁢π
LagrangeEquations(L__F, EnergyMomentum[mu, nu]);
Τμ,ν=Fβ,α⁢F⁢β,α⁢β,α⁢gμ,ν16⁢π+Fκ,μ⁢Fνκνκ4⁢π
To compute using the above as the definition for Tμ,ν, you can use the Define command
Define((22));
Aμ,γμ,Fμ,ν,Jμ,σμ,∂μ,gμ,ν,Τμ,ν,εα,β,μ,ν,Xμ,SpaceTimeVector⁢μ⁢μ⁡τ
After that, the system will know about the symmetry properties and components of Tμ,ν
EnergyMomentum[definition];
Τμ,ν=Fα,β⁢F⁢α,β⁢α,β⁢gμ,ν16⁢π+Fκ,μ⁢Fνκνκ4⁢π
Quantum Mechanics
Schrodinger's equation, can also be derived from a Lagrangian, expressed in terms of a complex field ψ⁡X and an external potential V⁡X. To use vectorial operators like the Gradient and Laplacian load the Physics:-Vectors package
with(Vectors);
&x,`+`,`.`,Assume,ChangeBasis,ChangeCoordinates,CompactDisplay,Component,Curl,DirectionalDiff,Divergence,Gradient,Identify,Laplacian,∇,Norm,ParametrizeCurve,ParametrizeSurface,ParametrizeVolume,Setup,Simplify,`^`,diff,int
interface(imaginaryunit = i);
I
macro(h = `ℏ`):
Set the real objects of the problem
CompactDisplay((psi, V)(X));
ψ⁡x,y,z,t⁢will now be displayed as⁢ψ
V⁡x,y,z,t⁢will now be displayed as⁢V
Setup(realobjects = {h, m, V(X)});
realobjects=ℏ,m,φ,r,ρ,t,θ,x,y,z,V
The Lagrangian
L := 1/(2*m) * h^2 * Norm(%Gradient(psi(X)))^2 + 1/2*i*h*(diff(conjugate(psi(X)), t) * psi(X) - diff(psi(X), t) * conjugate(psi(X))) + V(X)*abs(psi(X))^2;
L≔ℏ2⁢∇ψ22⁢m+ⅈ⁢ℏ⁢ψ&conjugate0;t⁢ψ−ψ.⁢ψ&conjugate0;2+V⁢ψ2
Taking ψ as the coordinate,
LagrangeEquations(L, psi);
−2⁢ⅈ⁢ℏ⁢m⁢ψ.+2⁢V⁢ψ⁢m−ℏ2⁢ψz,z−ψx,x⁢ℏ2−ψy,y⁢ℏ2=0
Make the Laplacian explicit
(Laplacian = %Laplacian)(psi(X));
ψx,x+ψy,y+ψz,z=∇2ψ
simplify((30), {(31)});
−2⁢ⅈ⁢ℏ⁢m⁢ψ.−ℏ2⁢∇2ψ+2⁢V⁢ψ⁢m=0
Schrodinger's equation as usually presented in textbooks, with the time derivative isolated
i * h * isolate((32), diff(psi(X), t));
ⅈ⁢ℏ⁢ψ.=−ℏ2⁢∇2ψ−2⁢V⁢ψ⁢m2⁢m
The Lagrangian of a quantum system including a term G⁢12⁢ψ4 representing the atom-atom interaction between identical particles results in Gross-Pitaevskii equation
Setup(realobjects = G);
realobjects=ℏ,G,m,φ,r,ρ,t,θ,x,y,z,V
L__GP := L + G*abs(psi(X))^4/2;
L__GP≔ℏ2⁢∇ψ22⁢m+ⅈ⁢ℏ⁢ψ&conjugate0;t⁢ψ−ψ.⁢ψ&conjugate0;2+V⁢ψ2+G⁢ψ42
The Gross-Pitaevskii equation
LagrangeEquations(L__GP, psi);
−ψx,x⁢ℏ2−ψy,y⁢ℏ2−ℏ2⁢ψz,z+2⁢m⁢−ⅈ⁢ℏ⁢ψ.+V⁢ψ+G⁢ψ2⁢ψ&conjugate0;=0
As for Schrodinger's equation, make the Laplacian explicit
simplify((36), {(31)});
−2⁢ⅈ⁢ℏ⁢m⁢ψ.−ℏ2⁢∇2ψ+2⁢m⁢ψ⁢G⁢ψ&conjugate0;⁢ψ+V=0
The standard form of the Gross-Pitaevskii equation with the time derivative of ψ isolated
i*h*isolate((37), diff(psi(X), t));
ⅈ⁢ℏ⁢ψ.=−ℏ2⁢∇2ψ−2⁢m⁢ψ⁢G⁢ψ&conjugate0;⁢ψ+V2⁢m
Classical Field Theory
The λ⁢Φ4 model in classical field theory and corresponding field equations
CompactDisplay(Phi(X));
Φ⁡x,y,z,t⁢will now be displayed as⁢Φ
L := 1/2*d_[mu](Phi(X))*d_[mu](Phi(X)) - m^2/2*Phi(X)^2 + lambda/4*Phi(X)^4;
L≔∂μ⁡Φ⁢∂⁢μ⁢μ⁡Φ2−m2⁢Φ22+λ⁢Φ44
Lagrange's equations
LagrangeEquations(L, Phi);
Φ3⁢λ−Φ⁢m2−□⁡Φ=0
The energy-momentum tensor can be computed as the Lagrange equations taking the metric as the coordinate, not equating to 0 the result, but multiplying δ Sδ gμ,νμ,ν by 2−g. For that purpose, you can use the energymomentum keyword
LagrangeEquations(L, EnergyMomentum[mu, nu]);
Τμ,ν=−λ⁢Φ44+m2⁢Φ22−∂⁢β⁢β⁡Φ⁢∂β⁡Φ2⁢gμ,ν+∂μ⁡Φ⁢∂ν⁡Φ
Define((42));
EnergyMomentum[];
Τμ,ν=λ⁢Φ44−m2⁢Φ22+Φx22−Φy22−Φz22+Φ.22Φx⁢ΦyΦx⁢ΦzΦx⁢Φ.Φx⁢Φyλ⁢Φ44−m2⁢Φ22−Φx22+Φy22−Φz22+Φ.22Φy⁢ΦzΦy⁢Φ.Φx⁢ΦzΦy⁢Φzλ⁢Φ44−m2⁢Φ22−Φx22−Φy22+Φz22+Φ.22Φz⁢Φ.Φx⁢Φ.Φy⁢Φ.Φz⁢Φ.−λ⁢Φ44+m2⁢Φ22+Φx22+Φy22+Φz22+Φ.22
The case of a scalar field in a curved spacetime is treated the same way. Set for instance an arbitrary metric
g_[arb];
⁢_______________________________________________________
Setting lowercaselatin_is letters to represent space indices
⁢The arbitrary metric in coordinates ⁢x,y,z,t
Signature: - - - +
gμ,ν=f__1⁡Xf__2⁡Xf__3⁡Xf__4⁡Xf__2⁡Xf__5⁡Xf__6⁡Xf__7⁡Xf__3⁡Xf__6⁡Xf__8⁡Xf__9⁡Xf__4⁡Xf__7⁡Xf__9⁡Xf__10⁡X
For the action to be a scalar, the Lagrangian density now needs to be multiplied by the square root of the determinant of the metric
L := sqrt(-%g_[determinant]) * L;
L≔− g ⁢∂μ⁡Φ⁢∂⁢μ⁢μ⁡Φ2−m2⁢Φ22+λ⁢Φ44
Φ3⁢λ−Φ⁢m2−▿κ⁡∂⁢κ⁢κ⁡Φ=0
Comparing with the result for the same Lagrangian in a flat spacetime, we see the only difference is that the dAlembertian is now expressed in terms of covariant derivatives D_.
The EnergyMomentum tensor is computed in the same way as when the spacetime is flat
General Relativity
Einstein's equations too can be derived from a variational principle, and the problem concerns the case of a non-flat spacetime with metric gμ,ν, as for instance the arbitrary metric set lines above. In the Lagrangian formulation, the coordinates of the problem are the components of the metric gμ,ν, and the parameters are the spacetime coordinates. The simplest case is that of Einstein's equation in vacuum, for which the Lagrangian density is expressed in terms of the trace of the Ricci tensor by
L := sqrt(-%g_[determinant]) * Ricci[alpha, ~alpha];
L≔− g ⁢Rαααα
Einstein's equations in vacuum:
LagrangeEquations(L, g_[~mu, ~nu]);
−g⁢μ,ν⁢μ,ν⁢Rαααα2+R⁢μ,ν⁢μ,ν=0
where in the above instead of passing g as second argument, we passed gμ,ν to get the equations using those free indices. The tensorial equation computed is also the definition of the Einstein tensor
Einstein[~mu, ~nu, definition];
G⁢μ,ν⁢μ,ν=−g⁢μ,ν⁢μ,ν⁢Rαααα2+R⁢μ,ν⁢μ,ν
The Lagrangian L used above to compute Einstein's equations contains first and second derivatives of the metric. To see that, rewrite it in terms of Christoffel symbols
L__C := convert(L, Christoffel);
L__C≔− g ⁢g⁢α,λ⁢α,λ⁢∂ν⁡Γ⁢να,λ⁢να,λ−∂λ⁡Γ⁢να,ν⁢να,ν+Γ⁢βα,λ⁢βα,λ⁢Γ⁢νβ,ν⁢νβ,ν−Γ⁢βα,ν⁢βα,ν⁢Γ⁢νβ,λ⁢νβ,λ
Recalling the definition
Christoffel[definition];
Γα,μ,ν=∂ν⁡gα,μ2+∂μ⁡gα,ν2−∂α⁡gμ,ν2
in LC the two terms containing derivatives of Christoffel symbols contain second order derivatives of gμ,ν. Nonetheless, it is always possible to add a total spacetime derivative to LC without changing Einstein's equations (assuming the variation of the metric in the corresponding boundary integrals vanishes), and in that way, in the particular case of LC, obtain a Lagrangian involving only 1st order derivatives. The total derivative, expressed using the inert ∂ command to see it before the differentiation operation is performed, is
TD := %d_[alpha](g_[~mu, ~nu]*sqrt(-%g_[determinant])*(-Christoffel[~alpha, mu, nu] + g_[~alpha, mu]*Christoffel[~beta, nu, beta]));
Adding this term to LC, performing the ∂ differentiation operation and simplifying we get
L__CTD := Simplify(L__C) + TD;
eval(L__CTD, %d_ = d_);
−− g ⁢Γα,βαα,βα⁢Γχβ,χχβ,χ−Γα,β,χ⁢Γ⁢β,α,χ⁢β,α,χ+∂α⁡Γβα,ββα,β−∂β⁡Γ⁢βαα⁢βαα+∂α⁡g⁢μ,ν⁢μ,ν⁢− g ⁢δμαμα⁢Γ⁢ββ,ν⁢ββ,ν−Γ⁢αμ,ν⁢αμ,ν−g⁢μ,ν⁢μ,ν⁢δμαμα⁢Γ⁢ββ,ν⁢ββ,ν−Γ⁢αμ,ν⁢αμ,ν⁢ g ⁢g⁢κ,λ⁢κ,λ⁢∂α⁡gκ,λ2⁢− g +g⁢μ,ν⁢μ,ν⁢− g ⁢δμαμα⁢∂α⁡Γ⁢ββ,ν⁢ββ,ν−∂α⁡Γ⁢αμ,ν⁢αμ,ν
L__1 := Simplify((57));
L__1≔− g ⁢Γα,β,χ⁢Γ⁢β,α,χ⁢β,α,χ−Γα,βαα,βα⁢Γ⁢βχχ⁢βχχ
which is a Lagrangian depending only on 1st order derivatives of the metric through Christoffel symbols. As expected, the equations of motion resulting from this Lagrangian are the same Einstein equations computed in (45)
LagrangeEquations(L__1, g_[~mu, ~nu]);
−Rιιιι⁢g⁢μ,ν⁢μ,ν2+R⁢μ,ν⁢μ,ν=0
Note that L1 is no just LC after discarding the terms involving derivatives of Christoffel symbols. To see that, split LC into the two terms containing or not derivatives of Christoffel
L__22, L__11 := selectremove(has, expand(L__C), d_);
L__22,L__11≔− g ⁢g⁢α,λ⁢α,λ⁢∂ν⁡Γ⁢να,λ⁢να,λ−− g ⁢g⁢α,λ⁢α,λ⁢∂λ⁡Γ⁢να,ν⁢να,ν,− g ⁢g⁢α,λ⁢α,λ⁢Γ⁢βα,λ⁢βα,λ⁢Γ⁢νβ,ν⁢νβ,ν−− g ⁢g⁢α,λ⁢α,λ⁢Γ⁢βα,ν⁢βα,ν⁢Γ⁢νβ,λ⁢νβ,λ
The total derivative TD is not just −L22 but
TD = - L__22 - 2*L__11;
To verify this, take the left-hand side minus the right-hand side, evaluate the inert derivative ∂ and simplify
(lhs - rhs)((61));
eval((62), %d_ = d_);
∂α⁡g⁢μ,ν⁢μ,ν⁢− g ⁢δμαμα⁢Γ⁢ββ,ν⁢ββ,ν−Γ⁢αμ,ν⁢αμ,ν−g⁢μ,ν⁢μ,ν⁢δμαμα⁢Γ⁢ββ,ν⁢ββ,ν−Γ⁢αμ,ν⁢αμ,ν⁢ g ⁢g⁢κ,λ⁢κ,λ⁢∂α⁡gκ,λ2⁢− g +g⁢μ,ν⁢μ,ν⁢− g ⁢δμαμα⁢∂α⁡Γ⁢ββ,ν⁢ββ,ν−∂α⁡Γ⁢αμ,ν⁢αμ,ν+− g ⁢g⁢α,λ⁢α,λ⁢∂ν⁡Γ⁢να,λ⁢να,λ−− g ⁢g⁢α,λ⁢α,λ⁢∂λ⁡Γ⁢να,ν⁢να,ν+2⁢− g ⁢g⁢α,λ⁢α,λ⁢Γ⁢βα,λ⁢βα,λ⁢Γ⁢νβ,ν⁢νβ,ν−2⁢− g ⁢g⁢α,λ⁢α,λ⁢Γ⁢βα,ν⁢βα,ν⁢Γ⁢νβ,λ⁢νβ,λ
Simplify((63));
0
That said, it is also true that TD=−L22−2⁢L11 results in the Lagrangian L1=−L11, and since the equations of movement don't depend on the sign of the Lagrangian, for this Lagrangian LC adding the term TD happens to be equivalent to just discarding the terms involving derivatives of Christoffel symbols.
Finally, it is also possible to compute Einstein's equations from first principles, constructing the action,
S := Intc(L, X);
S≔∫−∞∞∫−∞∞∫−∞∞∫−∞∞− g ⁢Rααααⅆxⅆyⅆzⅆt
and equating to zero the functional derivative with respect to the metric. To avoid displaying the resulting large expression, end the input line with ":"
EE__unsimplified := Fundiff(S, g_[alpha, beta]) = 0:
Simplifying this result, we get an expression in terms of Christoffel symbols and its derivatives
EEC := Simplify(EE__unsimplified);
EEC≔2⁢Γχ,ι,κ⁢Γ⁢ι,χ,κ⁢ι,χ,κ−2⁢Γχ,ιχχ,ιχ⁢Γ⁢ικκ⁢ικκ−2⁢▿ι⁡Γχχ,ιχχ,ι+2⁢▿χ⁡Γ⁢χιι⁢χιι⁢g⁢α,β⁢α,β4+Γ⁢αχβ⁢αχβ+Γ⁢βχα⁢βχα⁢Γ⁢χιι⁢χιι4−Γ⁢βχ,ι⁢βχ,ι⁢Γ⁢χ,α,ι⁢χ,α,ι4−Γχ,ιαχ,ια⁢Γ⁢ι,β,χ⁢ι,β,χ2+Γχα,βχα,β⁢Γιχ,ιιχ,ι2−Γ⁢αχ,ι⁢αχ,ι⁢Γ⁢χ,β,ι⁢χ,β,ι4−▿χ⁡Γ⁢χ,α,β⁢χ,α,β2−▿⁢α⁢α⁡Γ⁢βχχ⁢βχχ4+▿⁢β⁢β⁡Γχα,χχα,χ2−▿⁢β⁢β⁡Γ⁢αχχ⁢αχχ4+▿χ⁡Γ⁢α,β,χ⁢α,β,χ4+▿χ⁡Γ⁢β,α,χ⁢β,α,χ4=0
To rewrite this expression in terms of the Ricci tensor, consider its definition
Ricci[definition];
Rμ,ν=∂α⁡Γ⁢αμ,ν⁢αμ,ν−∂ν⁡Γ⁢αμ,α⁢αμ,α+Γ⁢βμ,ν⁢βμ,ν⁢Γ⁢αβ,α⁢αβ,α−Γ⁢βμ,α⁢βμ,α⁢Γ⁢αν,β⁢αν,β
Rewrite this definition in terms of covariant derivatives D_, simplify and isolate one of them
convert((67), D_);
Rμ,ν=▿α⁡Γ⁢αμ,ν⁢αμ,ν−Γ⁢αα,κ⁢αα,κ⁢Γ⁢κμ,ν⁢κμ,ν+Γ⁢κα,μ⁢κα,μ⁢Γ⁢ακ,ν⁢ακ,ν+Γ⁢κα,ν⁢κα,ν⁢Γ⁢αμ,κ⁢αμ,κ−▿ν⁡Γ⁢αα,μ⁢αα,μ−Γ⁢λμ,ν⁢λμ,ν⁢Γ⁢αα,λ⁢αα,λ+Γ⁢βμ,ν⁢βμ,ν⁢Γ⁢αα,β⁢αα,β−Γ⁢βα,μ⁢βα,μ⁢Γ⁢αβ,ν⁢αβ,ν
Simplify((68));
Rμ,ν=Γα,β,μ⁢Γ⁢βνα⁢βνα−Γβ,μ,ν⁢Γαα,βαα,β+▿α⁡Γ⁢αμ,ν⁢αμ,ν−▿ν⁡Γα,μαα,μα
C_to_Ricci := isolate((69), D_[alpha](Christoffel[~alpha, mu, nu]));
C_to_Ricci≔▿α⁡Γ⁢αμ,ν⁢αμ,ν=−Γα,β,μ⁢Γ⁢βνα⁢βνα+Γβ,μ,ν⁢Γαα,βαα,β+Rμ,ν+▿ν⁡Γα,μαα,μα
Analogously, derive an expression to rewrite covariant derivatives using the Riemann tensor
Riemann[~alpha, beta, mu, nu, definition];
R⁢αβ,μ,ν⁢αβ,μ,ν=∂μ⁡Γ⁢αβ,ν⁢αβ,ν−∂ν⁡Γ⁢αβ,μ⁢αβ,μ+Γ⁢αυ,μ⁢αυ,μ⁢Γ⁢υβ,ν⁢υβ,ν−Γ⁢αυ,ν⁢αυ,ν⁢Γ⁢υβ,μ⁢υβ,μ
convert((71), D_);
R⁢αβ,μ,ν⁢αβ,μ,ν=▿μ⁡Γ⁢αβ,ν⁢αβ,ν+Γ⁢κμ,ν⁢κμ,ν⁢Γ⁢αβ,κ⁢αβ,κ−Γ⁢ακ,μ⁢ακ,μ⁢Γ⁢κβ,ν⁢κβ,ν+Γ⁢κβ,μ⁢κβ,μ⁢Γ⁢ακ,ν⁢ακ,ν−▿ν⁡Γ⁢αβ,μ⁢αβ,μ−Γ⁢λμ,ν⁢λμ,ν⁢Γ⁢αβ,λ⁢αβ,λ−Γ⁢λβ,ν⁢λβ,ν⁢Γ⁢αλ,μ⁢αλ,μ+Γ⁢αλ,ν⁢αλ,ν⁢Γ⁢λβ,μ⁢λβ,μ+Γ⁢αμ,υ⁢αμ,υ⁢Γ⁢υβ,ν⁢υβ,ν−Γ⁢αν,υ⁢αν,υ⁢Γ⁢υβ,μ⁢υβ,μ
Simplify((72));
R⁢αβ,μ,ν⁢αβ,μ,ν=−Γ⁢ακ,μ⁢ακ,μ⁢Γ⁢κβ,ν⁢κβ,ν+Γ⁢κβ,μ⁢κβ,μ⁢Γ⁢ακ,ν⁢ακ,ν+▿μ⁡Γ⁢αβ,ν⁢αβ,ν−▿ν⁡Γ⁢αβ,μ⁢αβ,μ
C_to_Riemann := isolate((73), D_[mu](Christoffel[~alpha, beta, nu]));
C_to_Riemann≔▿μ⁡Γ⁢αβ,ν⁢αβ,ν=Γ⁢ακ,μ⁢ακ,μ⁢Γ⁢κβ,ν⁢κβ,ν−Γ⁢κβ,μ⁢κβ,μ⁢Γ⁢ακ,ν⁢ακ,ν+R⁢αβ,μ,ν⁢αβ,μ,ν+▿ν⁡Γ⁢αβ,μ⁢αβ,μ
Substitute these two equations, in sequence, into Einstein's equations expressed in terms of Christoffel symbols derived lines above
Substitute(C_to_Riemann, C_to_Ricci, EEC);
2⁢Γχ,ι,κ⁢Γ⁢ι,χ,κ⁢ι,χ,κ−2⁢Γχ,ιχχ,ιχ⁢Γ⁢ικκ⁢ικκ−2⁢Γα4,α5,α6⁢Γ⁢α6,α4,α5⁢α6,α4,α5+2⁢Γα4,α6α5α4,α6α5⁢Γ⁢α6α5α4⁢α6α5α4−2⁢▿⁢α5⁢α5⁡Γα4,α5α4α4,α5α4+2⁢Γ⁢α1α1,α3⁢α1α1,α3⁢Γ⁢α3α2α2⁢α3α2α2−2⁢Γ⁢α1α3α2⁢α1α3α2⁢Γ⁢α3α1,α2⁢α3α1,α2+2⁢Rα2α2α2α2+2⁢▿⁢α2⁢α2⁡Γ⁢α1α1,α2⁢α1α1,α2⁢g⁢α,β⁢α,β4−R⁢α,β⁢α,β+Γα10α,βα10α,β⁢Γα9α10,α9α9α10,α92−Γα9,α10αα9,α10α⁢Γ⁢α10,α9,β⁢α10,α9,β2+Γ⁢βν,σ⁢βν,σ⁢Γ⁢σ,α,ν⁢σ,α,ν4−Γ⁢βσν⁢βσν⁢Γ⁢σνα⁢σνα4−Γ⁢αρβ⁢αρβ⁢Γ⁢ρρ1ρ1⁢ρρ1ρ14+Γ⁢αρρ1⁢αρρ1⁢Γ⁢ρρ1β⁢ρρ1β4−Γ⁢βψα⁢βψα⁢Γ⁢ψωω⁢ψωω4+Γ⁢βψω⁢βψω⁢Γ⁢ψωα⁢ψωα4+Γ⁢τυα⁢τυα⁢Γ⁢υτβ⁢υτβ2−Γ⁢τ,α,β⁢τ,α,β⁢Γ⁢υτ,υ⁢υτ,υ2−Γ⁢αλμ⁢αλμ⁢Γ⁢λμβ⁢λμβ4+Γ⁢αλ,μ⁢αλ,μ⁢Γ⁢λ,β,μ⁢λ,β,μ4−Γο,ζοο,ζο⁢Γ⁢ζ,α,β⁢ζ,α,β2+Γο,ζβο,ζβ⁢Γ⁢ζ,α,ο⁢ζ,α,ο2−Γχ,ιαχ,ια⁢Γ⁢ι,β,χ⁢ι,β,χ2+Γ⁢αχβ⁢αχβ+Γ⁢βχα⁢βχα⁢Γ⁢χιι⁢χιι4−▿⁢ρ1⁢ρ1⁡Γ⁢αρ1β⁢αρ1β4−▿⁢ω⁢ω⁡Γ⁢βωα⁢βωα4+▿⁢β⁢β⁡Γα9α,α9α9α,α92+▿⁢ν⁢ν⁡Γ⁢βνα⁢βνα4+▿⁢μ⁢μ⁡Γ⁢αμβ⁢αμβ4−▿⁢β⁢β⁡Γ⁢υυα⁢υυα2−Γ⁢βχ,ι⁢βχ,ι⁢Γ⁢χ,α,ι⁢χ,α,ι4+Γχα,βχα,β⁢Γιχ,ιιχ,ι2−Γ⁢αχ,ι⁢αχ,ι⁢Γ⁢χ,β,ι⁢χ,β,ι4=0
Simplify to arrive at the traditional compact form
Simplify((75));
−R⁢α,β⁢α,β+Rχχχχ⁢g⁢α,β⁢α,β2=0
See Also
CompactDisplay, conjugate, d_, D_, dAlembertian, Fundiff, Geodesics, Gradient, isolate, Laplacian, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Physics[*], Ricci, Riemann, Setup, Simplify, simplify/siderels, Substitute, VariationalCalculus:-EulerLagrange, Vectors
References
[1] Landau, L.D., and Lifshitz, E.M. The Classical Theory of Fields, Course of Theoretical Physics Volume 2, fourth revised English edition. Elsevier, 1975.
[2] Ohanian, H.C., and Ruffini, R. Gravitation and Spacetime, third edition. Cambridge, 2013
[3] Lovelock, D., and Rund, H. Tensors, Differential Forms and Variational Principles, Dover, 1989.
Compatibility
The Physics[LagrangeEquations] command was introduced in Maple 2023.
For more information on Maple 2023 changes, see Updates in Maple 2023.
The Physics[LagrangeEquations] command was updated in Maple 2025.
Download Help Document