Deriving the Euler–Lagrange Equation for Particles, Fields, and Curved Spacetime

A good way to understand the laws of motion is not to memorize a separate equation for each situation, but to notice that there is really only one trick, and that every equation of motion is what falls out when you apply it. That sounds like an exaggeration, and it is not. I am going to take the trick apart in front of you, use it to derive Newton’s law, then use the very same steps to derive the equation for a field spread through all of space, and then run those same steps one last time for a field living in curved spacetime. Three arenas that look nothing alike in a textbook, and one move that does not change from the first to the last. I want you to try something as we go: before I write the next line, guess it. The whole point of a trick this general is that once you have it, you can anticipate the physics before the algebra confirms it.

Here is the trick, stated before any symbols get in the way. You take every history the world could possibly have, every path a particle might follow and every way a field might wave, and to each one you attach a single number. You call that number the action.1The action is a functional: unlike an ordinary function, which eats a number and returns a number, it eats an entire history $q_r(t)$ and returns a single number $S$. Its units are energy multiplied by time. The name and the idea run back through Maupertuis, Euler, Lagrange, and Hamilton across the eighteenth and nineteenth centuries. Then you make one demand: the history nature actually chooses is the one for which the number does not change, to first order, when you wiggle the history a little. Carry out that demand honestly and it hands you the equation of motion. That is the whole engine. Everything below is just running it in three different arenas and watching the same three steps do the same job every time.

Start with the simplest arena there is, a single particle moving along a path. To say where the particle is at each moment, give its coordinates $q_r(t)$, where the label $r$ runs over as many numbers as you need to pin it down.2The label $r$ collects what are called generalized coordinates. For one particle in three dimensions it runs over $1,2,3$; for $N$ particles it runs to $3N$; and it need not be a Cartesian position at all, since an angle or any other convenient parameter works just as well. The derivation never cares which you choose. The action is a running total of a quantity $L$, the Lagrangian, tallied all along the path from a starting time to a finishing time:

$$ S = \int_{t_1}^{t_2} L(q_r, \dot q_r, t)\, dt. $$

The Lagrangian is allowed to depend on where the particle is, on how fast it is going, and possibly on the time itself, and on nothing else. I want you to hold onto that restriction a little harder than you normally would, because it is doing more work than it looks like. Ask yourself: what would go wrong if $L$ were also allowed to depend on the acceleration $\ddot q_r$? Keep that question in your pocket. We will come back to it right after the equation falls out, and the answer is not a footnote you can skip.3If $L$ depended on $\ddot q_r$ as well, the variation would produce a fourth-order equation of motion instead of a second-order one, since integrating the acceleration term by parts twice brings down two extra time derivatives. Ostrogradski showed in 1850 that any such theory, if the dependence on the highest derivative is non-degenerate, carries a Hamiltonian unbounded below: energy can be extracted without limit, which is a genuine instability rather than a mathematical curiosity. This is the real reason essentially every fundamental Lagrangian in physics is built only from a field and its first derivatives. And when we later move to fields, this same restriction reappears as $\mathcal L$ depending only on $\phi_A$ and its first spacetime derivatives, never on second derivatives. That is not a coincidence either.

Now the move. Take the true path, whatever it happens to be, and nudge it aside by a small amount:

$$ q_r(t) \longmapsto q_r(t) + \varepsilon\, \eta_r(t). $$

The function $\eta_r(t)$ is the shape of the nudge, an arbitrary bend you are free to invent, and $\varepsilon$ is a small knob that controls how hard you push. There is exactly one string attached. The nudge has to vanish at the two ends,

$$ \eta_r(t_1) = 0, \qquad \eta_r(t_2) = 0, $$

which says in plain words that you may bend the path however you like in the middle, but the particle must start where it started and arrive where it arrived. Keep that condition in view. It is going to come back later wearing a much larger coat, and recognizing it in disguise is half of the whole story.

q t t₁ t₂ εη(t) q(t) q(t) + εη(t)

Figure 1 — The true path and a nearby varied path. Both are pinned at the two endpoints, so the nudge $\varepsilon\eta(t)$ is free to bulge in the middle but must close up at the ends. The action is stationary on the true path.

To say the action is stationary is to say that as you turn the knob $\varepsilon$ up through zero, the action does not move, to first order:

$$ \left.\frac{dS}{d\varepsilon}\right|_{\varepsilon=0} = 0. $$

This is the precise version of the loose phrase about wiggling the path.4Stationary is the honest word, not least. The true history is guaranteed only to be a critical point of the action, where the first-order change vanishes, and depending on the problem it may be a minimum, a maximum, or a saddle. The traditional name “principle of least action” is therefore a mild historical misnomer, a point Feynman was fond of making. What is always true is that the action does not change to first order, which is exactly the condition $dS/d\varepsilon|_{0}=0$. Now we simply compute the derivative. Differentiate under the integral sign and use the chain rule, remembering that when the path wiggles its velocity wiggles too, at the rate $\dot\eta_r$:5Pulling the derivative $d/d\varepsilon$ inside the integral sign is itself a small theorem, not a free move. It requires $L$ and its first derivatives to be continuous in $\varepsilon$ near $\varepsilon=0$ and the path $q_r(t)$ to be differentiable on $[t_1,t_2]$; under those mild smoothness conditions, differentiation under the integral sign (a form of the Leibniz integral rule) is justified. Physics almost never worries about this, and it almost never needs to, but it is worth knowing the fine print exists.

$$ \left.\frac{dS}{d\varepsilon}\right|{0} = \int{t_1}^{t_2} \sum_r \left[ \frac{\partial L}{\partial q_r}\, \eta_r + \frac{\partial L}{\partial \dot q_r}\, \dot\eta_r \right] dt. $$

Look hard at the bracket, because the entire difficulty of this subject lives inside it, and so does the entire solution. The nudge $\eta_r$ appears bare in the first term, but in the second term it appears differentiated, as $\dot\eta_r$. I would love to factor the nudge out and declare that whatever multiplies it must vanish, but I cannot, because the nudge is wearing two different outfits. The fix is integration by parts, and integration by parts is really the only idea in the whole business. It peels the derivative off the nudge and lays it onto everything else:

$$ \frac{\partial L}{\partial \dot q_r}\, \dot\eta_r = \frac{d}{dt}!\left( \frac{\partial L}{\partial \dot q_r}\, \eta_r \right) – \frac{d}{dt}!\left( \frac{\partial L}{\partial \dot q_r} \right)\eta_r. $$

Substitute this back. The first piece is a total time derivative, so when you integrate it from $t_1$ to $t_2$ it collapses to its values at the two endpoints, and the rest gathers into a single bracket multiplying the bare nudge:

$$ \delta S = \int_{t_1}^{t_2} \sum_r \left[ \frac{\partial L}{\partial q_r} – \frac{d}{dt}!\left(\frac{\partial L}{\partial \dot q_r}\right) \right]\eta_r\, dt \;+\; \sum_r \left[ \frac{\partial L}{\partial \dot q_r}\, \eta_r \right]_{t_1}^{t_2}. $$

Before you read the next line, guess what happens to that second piece, given what you already know about $\eta_r$ at the endpoints. Now the endpoint term steps forward and then, exactly as you predicted, removes itself. It is the nudge evaluated at the two ends, and we agreed at the outset that the nudge is zero at the two ends. So it is simply gone:

$$ \left[ \frac{\partial L}{\partial \dot q_r}\, \eta_r \right]_{t_1}^{t_2} = 0. $$

What is left is an integral of some bracket multiplied by the nudge, and it has to equal zero not for one clever choice of nudge but for every nudge you could ever draw. A fixed function that integrates to zero against absolutely every wiggle has nowhere to hide. It must be zero at every point.6This is the fundamental lemma of the calculus of variations, and it is worth stating carefully. If $f(t)$ is continuous on $[t_1,t_2]$ and $\int_{t_1}^{t_2} f(t)\,\eta(t)\,dt = 0$ for every smooth $\eta$ that vanishes at the two endpoints, then $f(t)=0$ everywhere on the interval. The argument is by contradiction: if $f$ were nonzero, say positive, at some interior point $t_0$, continuity guarantees $f$ stays positive on some small interval around $t_0$; choosing an $\eta$ that bulges upward only inside that interval and is zero elsewhere forces the integral to be strictly positive, contradicting the assumption that it is zero for every such $\eta$. Therefore the bracket vanishes on its own:

$$ \boxed{\; \frac{d}{dt}!\left( \frac{\partial L}{\partial \dot q_r} \right) – \frac{\partial L}{\partial q_r} = 0. \;} $$

This is the Euler–Lagrange equation, and it came out of exactly three steps. You wiggled the path. You integrated by parts to move the derivative off the wiggle. You threw away the endpoint term because you had pinned the wiggle down. Photograph the shape of that equation and keep it in your wallet: a time derivative of the derivative of $L$ with respect to the velocity, minus the derivative of $L$ with respect to the position. In a moment we are going to meet its identical twin. And notice, as promised, that only $\ddot q_r$ ever entered the story, through the single time derivative acting on $\partial L/\partial \dot q_r$; the acceleration you were tempted to add to $L$ at the very start never got the chance to appear twice over, which is exactly what keeps this equation second order and well behaved.

Before we go anywhere bigger, let me convince you the equation is not an empty formality by feeding it the most ordinary situation in physics. One particle, three dimensions, and the Lagrangian everyone meets first, kinetic energy minus potential energy:

$$ L = \tfrac{1}{2} m\left(\dot x_1^2 + \dot x_2^2 + \dot x_3^2\right) – V(x_1, x_2, x_3, t). $$

The derivative of $L$ with respect to a velocity is the momentum in that direction, and its time derivative is mass times acceleration:

$$ \frac{\partial L}{\partial \dot x_r} = m \dot x_r, \qquad \frac{d}{dt}!\left(\frac{\partial L}{\partial \dot x_r}\right) = m \ddot x_r. $$

The derivative of $L$ with respect to a position is minus the slope of the potential in that direction:

$$ \frac{\partial L}{\partial x_r} = -\frac{\partial V}{\partial x_r}. $$

Put both into the box, rearrange, and out falls

$$ \boxed{\; m \ddot x_r = -\frac{\partial V}{\partial x_r} = F_r. \;} $$

That is $F = ma$, with the force revealed as minus the gradient of the potential.7If the force depends on velocity, as the magnetic force does, it cannot be written as minus the gradient of an ordinary potential $V(x)$. The remedy is a velocity-dependent potential $U(x,\dot x)$, and the Euler–Lagrange machinery goes through untouched with $L = T – U$. The full Lorentz force on a charge comes out of exactly this generalization. Notice what just happened. We did not assume Newton’s law anywhere. We wrote down a single scalar, kinetic minus potential, demanded that its running total be stationary, and Newton’s law came out the far end with no further input. The principle of stationary action is not a decorative restatement of Newtonian mechanics sitting politely beside it. It contains Newtonian mechanics, and, as we are about to see, it contains a great deal that Newton never wrote down.

Here is the leap, and it is a real leap, so watch it slowly. For the particle, the thing with a life of its own was a position that depends on time, $q_r(t)$. We now hand that starring role to a field: a number $\phi_A$ that has a value at every point of spacetime at once,

$$ \phi_A = \phi_A(x^\mu), \qquad x^0 = ct,\; x^1 = x,\; x^2 = y,\; x^3 = z. $$

The lower label $A$ is a roster, telling you which field you mean when there are several of them.8The label $A$ simply counts the independent components of whatever field you are studying. A single real scalar has one, a complex scalar has effectively two, the electromagnetic potential $A_\mu$ has four, and the metric of general relativity has ten. What follows never cares what the count is. The upper index $\mu$, running from $0$ to $3$, is a compass, telling you which of the four spacetime directions you are differentiating along. I will write $\partial_\mu$ for the derivative along direction $\mu$, so that the single symbol $\partial_\mu \phi_A$ gathers up how fast the field is changing in time and in each of the three directions of space, all in one stroke.

Only one thing about the action has to change, and it changes for an honest reason. The particle’s action was a total along a one-dimensional path through time. A field is not at a point, it is everywhere, so its action must be a total over a whole slab of spacetime:

$$ S = \int_\Omega \mathcal L\left(\phi_A, \partial_\mu \phi_A, x^\mu\right) d^4x. $$

The script $\mathcal L$ is a Lagrangian density, meaning an amount of action packed into each little box of spacetime volume, and $d^4x = dx^0\,dx^1\,dx^2\,dx^3$ is the size of the box.9There is a factor of $c$ hiding in $x^0 = ct$, which makes $d^4x = c\,dt\,d^3x$. You can absorb that constant into the definition of $\mathcal L$, or you can set $x^0 = t$ and carry the factors of $c$ explicitly. Either way it is bookkeeping: a constant multiplying the whole action never changes which history makes the action stationary, so it cannot affect the equation of motion. Set this next to the particle line by line and the correspondence is almost embarrassing. Where the particle had $L$, the field has a density $\mathcal L$. Where the particle’s Lagrangian leaned on the velocity $\dot q_r$, the field’s density leans on the spacetime gradient $\partial_\mu \phi_A$. Where the particle summed $dt$ along a line, the field sums $d^4x$ over a region. It is the same skeleton with one dimension traded for four. If you have really absorbed the particle derivation, you should already be able to write down the field equation before I derive it. Try it now, then keep reading and check yourself.

Wiggle the field, and pin the wiggle not at two endpoints but on the entire boundary of the region:

$$ \phi \longmapsto \phi + \varepsilon\, \eta, \qquad \eta = 0 \text{ on } \partial\Omega. $$

I will carry a single field through the algebra to keep the symbols uncluttered; the case of many fields costs nothing, and I will collect that dividend at the end.10With several fields $\phi_A$, you introduce an independent nudge $\eta_A$ for each and run the same variation. Because the nudges are independent, the demand that the total variation vanish for all of them at once splits into one Euler–Lagrange equation per field. This is why the several-field case, which looks more general, is not any harder. Look at the pinning condition and see it for what it is. For the particle I froze the two endpoints of the path. For the field I freeze the entire boundary surface of the spacetime slab. But a boundary is a boundary. The two endpoints of the particle were nothing more than the boundary of a one-dimensional interval. This is the same condition as before, promoted from the ends of a line to the skin of a four-dimensional region.

Demand stationarity, run the chain rule exactly as we did for the particle, and note that when the field wiggles its gradient wiggles at the rate $\partial_\mu \eta$:

$$ \delta S = \int_\Omega \left[ \frac{\partial \mathcal L}{\partial \phi}\, \eta + \frac{\partial \mathcal L}{\partial(\partial_\mu \phi)}\, \partial_\mu \eta \right] d^4x. $$

There is the same obstacle we already know how to beat. The nudge is bare in the first term and differentiated in the second, so it cannot yet be factored out. Reach for the same tool. Integration by parts, now carried out in spacetime, lifts the derivative off the nudge:

$$ \frac{\partial \mathcal L}{\partial(\partial_\mu \phi)}\, \partial_\mu \eta = \partial_\mu!\left[ \frac{\partial \mathcal L}{\partial(\partial_\mu \phi)}\, \eta \right] – \partial_\mu!\left[ \frac{\partial \mathcal L}{\partial(\partial_\mu \phi)} \right] \eta. $$

The first piece is a four-dimensional divergence, and integrating a divergence over a region converts it into a flux through the boundary of that region. That conversion is the divergence theorem:

$$ \int_\Omega \partial_\mu V^\mu\, d^4x = \int_{\partial\Omega} V^\mu\, d\Sigma_\mu. $$

I want to slow down here, because this is the most beautiful point in the whole derivation and it is the easiest one to walk past. This is not merely the analogue of the particle’s endpoint term. It is the very same theorem. When we integrated a total time derivative from $t_1$ to $t_2$ and collapsed it to its values at the two ends, we were using the fundamental theorem of calculus, and the fundamental theorem of calculus is nothing but the divergence theorem in a single dimension, with the two endpoints playing the part of the boundary.11In one dimension the divergence theorem is just the fundamental theorem of calculus: $\int_{t_1}^{t_2}\frac{dF}{dt}\,dt = F(t_2)-F(t_1)$. The boundary of the interval $[t_1,t_2]$ is the two-point set $\{t_1,t_2\}$, and the signs in $F(t_2)-F(t_1)$ are just the outward orientation of that boundary: $+1$ at $t_2$, where the outward direction agrees with increasing $t$, and $-1$ at $t_1$, where it opposes it. Both the one-dimensional and the four-dimensional statements are special cases of the general Stokes theorem, which says that integrating a derivative over a region equals integrating the original object over the region’s boundary. Raise the number of dimensions from one to four and the boundary of an interval fattens into a boundary surface, and the evaluation at two endpoints swells into a flux through that surface. One theorem, read once in one dimension and once in four. The endpoint term and the surface term are not cousins. They are the same creature at two different sizes.

So: given everything you now know, does that surface term survive or die? Decide before you read on. It dies, and for the same reason as before. We pinned the nudge to zero on the boundary, so the flux through the boundary is zero, and the surface term is gone. What survives is an integral of a bracket multiplied by an arbitrary nudge, which forces the bracket to vanish:

$$ \boxed{\; \partial_\mu!\left( \frac{\partial \mathcal L}{\partial(\partial_\mu \phi)} \right) – \frac{\partial \mathcal L}{\partial \phi} = 0. \;} $$

Lay this beside the particle’s equation and the resemblance is not a resemblance, it is a template with the words swapped. Where the particle had the time derivative $d/dt$, the field has the spacetime divergence $\partial_\mu$. Where the particle differentiated $L$ with respect to the velocity, the field differentiates $\mathcal L$ with respect to the gradient. Where the particle differentiated with respect to position, the field differentiates with respect to the field value. The equation did not change its shape at all. It only learned to count in four directions where before it counted in one.

Let us feed this field equation its own simplest case, the way we fed Newton to the particle equation, and see what nature’s plainest field does. Take the density

$$ \mathcal L = \tfrac{1}{2}\, \partial_\mu \phi\, \partial^\mu \phi – \tfrac{1}{2}\, \mu^2 \phi^2, $$

where $\partial^\mu = \eta^{\mu\nu}\partial_\nu$ is the gradient with its index raised by the Minkowski metric, and the constant $\mu$ sets a scale we will read off in a moment.12Apologies for the notation: $\mu$ is doing double duty here, as a spacetime index in $\partial_\mu$ and as the mass constant. Both usages are completely standard, and context keeps them apart, but it is worth flagging so you are not caught off guard. The derivative of the density with respect to the field is

$$ \frac{\partial \mathcal L}{\partial \phi} = -\mu^2 \phi, $$

and the derivative with respect to the gradient comes out clean, because each of the two gradient factors in the first term contributes equally:

$$ \frac{\partial \mathcal L}{\partial(\partial_\mu \phi)} = \partial^\mu \phi. $$

Drop both into the boxed field equation and you get

$$ \partial_\mu \partial^\mu \phi + \mu^2 \phi = 0, \qquad\text{or, more compactly,}\qquad \boxed{\; \Box \phi + \mu^2 \phi = 0. \;} $$

The symbol $\Box = \partial_\mu \partial^\mu$ is the wave operator, the four-dimensional relative of the Laplacian, and written out in ordinary time and space it reads

$$ \frac{1}{c^2}\frac{\partial^2 \phi}{\partial t^2} – \nabla^2 \phi + \frac{m^2 c^2}{\hbar^2}\, \phi = 0. $$

This is the Klein–Gordon equation, the simplest relativistic wave equation a single scalar field can obey, and the constant we called $\mu$ has turned out to be $\mu = mc/\hbar$, an inverse length fixed by the mass.13The constant works out to $\mu = mc/\hbar$, so its reciprocal $1/\mu = \hbar/mc$ is the reduced Compton wavelength of a particle of mass $m$, the natural length scale the mass sets. Throughout I use the signature $(+,-,-,-)$, so that $\partial_\mu\partial^\mu = \frac{1}{c^2}\partial_t^2 – \nabla^2$; with the opposite convention a sign flips, but no physics does. Set the mass to zero and the last term disappears, leaving

$$ \Box \phi = 0, $$

which is the plain wave equation, the same one that carries light and sound. So the field arena, handed its simplest Lagrangian, produces a wave, in exact parallel to the particle arena, which handed its simplest Lagrangian produced Newton. Same procedure, different arena, and out comes the law that arena is famous for.

Now I want to show you the single fact that turned my own picture of these two arenas from “similar” into “the same.” Suppose the field is lazy and refuses to vary through space, depending on time alone, $\phi = \phi(t)$. Then every spatial derivative is zero, and if we measure time with the coordinate $t$ itself, the spacetime divergence $\partial_\mu$ keeps only its time part. The boxed field equation quietly collapses into

$$ \frac{d}{dt}!\left( \frac{\partial \mathcal L}{\partial \dot\phi} \right) – \frac{\partial \mathcal L}{\partial \phi} = 0, $$

which is the particle’s Euler–Lagrange equation, character for character. So the field equation is not an analogy of the particle equation. It is a generalization that contains the particle equation exactly, as the special case in which nothing depends on where you are. Peel away the three dimensions of space and the field remembers that it was the same law all along.

One arena is left, and I promised the move would survive it. Let spacetime itself be curved, described by a metric $g_{\mu\nu}(x)$ that sets how distances and times are measured and that changes from place to place. Two things change in the passage to curved spacetime. Guess them before I tell you: one is about how you measure volume, and the other is about how you differentiate. Both are true, and the whole point of what follows is that neither of them touches the move.

The first change is the volume of the little box. On flat spacetime the box had volume $d^4x$; on a curved manifold the honest, coordinate-independent volume is $\sqrt{-g}\, d^4x$, where $g$ is the determinant of the metric.14For a Lorentzian metric the determinant $g$ is negative, so $-g$ is positive and $\sqrt{-g}$ is real. The combination $\sqrt{-g}\,d^4x$ is the invariant four-volume, the same number in every coordinate system. In flat Minkowski coordinates the metric determinant is $-1$, so $\sqrt{-g}=1$ and the invariant volume reduces to the ordinary $d^4x$, which is why the flat-space derivation never had to mention it. The second change is that the plain derivative $\partial_\mu$ ought to be promoted to the covariant derivative $\nabla_\mu$, the derivative that accounts for the bending of the coordinates. For a scalar field these two happen to coincide, $\nabla_\mu \phi = \partial_\mu \phi$, which is a small mercy I am going to accept gratefully.15Two facts are doing quiet work here. First, a scalar field has no indices for the connection to act on, so $\nabla_\mu\phi = \partial_\mu\phi$; the first place the two derivatives part ways is a vector, where $\nabla_\mu V^\nu = \partial_\mu V^\nu + \Gamma^\nu{}_{\mu\lambda}V^\lambda$. Second, the divergence identity $\nabla_\mu V^\mu = \frac{1}{\sqrt{-g}}\partial_\mu(\sqrt{-g}\,V^\mu)$ used two lines below follows from the contracted Christoffel symbol $\Gamma^\lambda{}_{\mu\lambda} = \partial_\mu \ln\sqrt{-g}$. The action reads

$$ S = \int_\Omega \mathcal L\, \sqrt{-g}\; d^4x. $$

Run the move a third time. Wiggle the field, pin it on the boundary, demand stationarity, integrate by parts, this time with the covariant product rule. The one step with any right to go wrong is the boundary term. Before I show you why it survives intact, ask yourself what could possibly go wrong that did not go wrong before — the curvature has to show up somewhere, and if it is not in the boundary term, it has to hide somewhere else entirely. It hides, in fact, in plain sight, in a small identity of great beauty:

$$ \nabla_\mu V^\mu = \frac{1}{\sqrt{-g}}\, \partial_\mu!\left( \sqrt{-g}\, V^\mu \right). $$

The $\sqrt{-g}$ sitting in the volume element and the $\sqrt{-g}$ hidden inside the covariant divergence find each other and cancel, so the boundary piece becomes an ordinary divergence once more, which becomes an ordinary flux, which vanishes because the nudge vanishes on the boundary. Same death, same reason, third time in a row; the curvature never got a chance to spoil the argument because it was absorbed into the very identity that lets the divergence theorem apply at all. What survives is

$$ \boxed{\; \nabla_\mu!\left( \frac{\partial \mathcal L}{\partial(\nabla_\mu \phi)} \right) – \frac{\partial \mathcal L}{\partial \phi} = 0, \;} $$

and, if you prefer to see the metric factor out in the open,

$$ \frac{1}{\sqrt{-g}}\, \partial_\mu!\left[ \sqrt{-g}\, \frac{\partial \mathcal L}{\partial(\partial_\mu \phi)} \right] – \frac{\partial \mathcal L}{\partial \phi} = 0. $$

There is one piece of magic in that last line that I refuse to let you miss. It looks as though the equation has forgotten that the metric depends on position, but it has not forgotten at all. The factor $\sqrt{-g}$ depends only on where you are, never on the field or on the field’s gradient, so when you differentiate the density with respect to the field, the $\sqrt{-g}$ is not a variable to be differentiated but a bystander that rides along inside the explicit coordinate dependence. It is luggage the field carries, not a control the field can turn. That is precisely why it is allowed to sit inside the derivative in one line and outside it in the next with no contradiction whatsoever.

I leaned, twice now, on the field being a scalar, and I owe you the reason it mattered. When the field carries indices of its own, when it is a vector or a tensor rather than a plain number, the covariant derivative stops being equal to the plain derivative, the connection terms that measure the bending of the coordinates come out of hiding, and the bookkeeping grows real teeth.16For a vector or tensor field you must differentiate the density with respect to $\nabla_\mu\phi_A$ treating its indices honestly, and the resulting Euler–Lagrange operator carries extra connection terms. The Maxwell and Proca equations, and the linearized equations for a metric perturbation, all come out this way. The scalar spares us those terms without hiding the essential move. The scalar is the clean room in which you can watch the move work with nothing extra clinging to it. It is the right place to learn the pattern before the pattern puts on its armor.

Step back now and count what we actually did, because the counting is the point. We wrote an action for a particle, demanded it be stationary, and Newton’s law came out. We wrote an action for a field, demanded it be stationary, and a wave came out. We wrote an action for a field in curved spacetime, demanded it be stationary, and the curved-space wave equation came out. Three arenas that share no furniture, and in every one of them the derivation was the same three motions: wiggle the history, integrate by parts to move the derivative off the wiggle, and discard the boundary term because the wiggle was pinned down there.

The dividend I promised is real, and it is free. If there are many fields $\phi_A$ instead of one, you introduce an independent nudge for each and run the same variation, and because the nudges are independent, each field simply hands you its own copy of the boxed equation. Nothing in the three steps ever asked how many fields were present. The move does not become harder when the world becomes more complicated. It only becomes longer to write down.

Here is a second dividend, one I have been quietly setting up all along and have not yet cashed in. We discarded the boundary term every single time because we forced the nudge to vanish there. But suppose you refuse to force it. Suppose, instead, the nudge is not an arbitrary bend but the specific shift generated by translating time itself, $\eta_r = \dot q_r$, so that the “wiggle” is really the flow of the system one instant into the future. If the Lagrangian does not depend explicitly on time, the boundary term you would have discarded does not vanish; it becomes a genuine quantity, built from $\partial L/\partial \dot q_r$ and $\dot q_r$, that is exactly the same at $t_1$ and at $t_2$ for every choice of the two endpoints. A quantity that comes out equal no matter which two instants you compare is a conserved quantity, and for this particular choice of nudge it is the energy.17This is the shadow of Noether’s theorem falling across the same calculation we already did. Time-translation symmetry of $L$ forces the surface term $\left[\partial L/\partial\dot q_r\,\dot q_r\right]_{t_1}^{t_2}$ built along the true trajectory to vanish identically, which is the statement that the Hamiltonian $H=\dot q_r\,\partial L/\partial\dot q_r – L$ is constant in time. In the field case the analogous choice of nudge, $\eta = \partial_\nu\phi$ for each spacetime direction $\nu$, produces the canonical energy–momentum tensor $T^\mu{}_\nu = \partial^\mu\phi\,\partial_\nu\phi – \delta^\mu{}_\nu\mathcal L$, and $\partial_\mu T^\mu{}_\nu=0$ is the local conservation law for energy and momentum carried by the field. Every conservation law you have ever used, momentum, angular momentum, electric charge, is a boundary term of exactly this kind, refusing to vanish because a symmetry protects it. The very piece of the calculation you learned to throw away, when you refuse to throw it away for the right reason, is where every conservation law in physics comes from. That is not a small aside. It may be the more important half of this entire trick, and it is the subject for the next post.

What I find genuinely worth sitting with is that none of this is a coincidence of notation. As far as we know, every fundamental equation of motion in physics comes from an action of exactly this kind, which is the deep reason a single trick can reach from a bead on a wire all the way to a field in curved spacetime. The principle of stationary action is one sentence, that nature makes a certain total stationary, and the equation of motion is simply what that one sentence looks like once you have carried out the wiggle without cheating. Newton’s law, the Klein–Gordon equation, and a scalar field threading its way through curved spacetime are not three laws that happen to rhyme. They are one demand, put to three arenas, and answered by one move in each.

And if you ever get bold and let the metric itself be the thing you wiggle, instead of a fixed stage you have set the field upon, the same move hands you Einstein’s field equations for gravity.18The gravitational case takes the Einstein–Hilbert action $S = \frac{1}{2\kappa}\int R\,\sqrt{-g}\,d^4x$, where $R$ is the Ricci scalar built from the metric, and varies with respect to the metric $g^{\mu\nu}$ itself rather than a field living on top of it. The same wiggle-and-discard procedure, with a more careful boundary analysis, yields Einstein’s field equations $G_{\mu\nu} = \kappa T_{\mu\nu}$. But that is a story for another day, and it is, I promise you, the same trick once more. When you have truly seen this move, you have not learned a drawer full of separate equations. You have learned one thing, and then watched it grow up.

References and Footnotes

  • 1
    The action is a functional: unlike an ordinary function, which eats a number and returns a number, it eats an entire history $q_r(t)$ and returns a single number $S$. Its units are energy multiplied by time. The name and the idea run back through Maupertuis, Euler, Lagrange, and Hamilton across the eighteenth and nineteenth centuries.
  • 2
    The label $r$ collects what are called generalized coordinates. For one particle in three dimensions it runs over $1,2,3$; for $N$ particles it runs to $3N$; and it need not be a Cartesian position at all, since an angle or any other convenient parameter works just as well. The derivation never cares which you choose.
  • 3
    If $L$ depended on $\ddot q_r$ as well, the variation would produce a fourth-order equation of motion instead of a second-order one, since integrating the acceleration term by parts twice brings down two extra time derivatives. Ostrogradski showed in 1850 that any such theory, if the dependence on the highest derivative is non-degenerate, carries a Hamiltonian unbounded below: energy can be extracted without limit, which is a genuine instability rather than a mathematical curiosity. This is the real reason essentially every fundamental Lagrangian in physics is built only from a field and its first derivatives.
  • 4
    Stationary is the honest word, not least. The true history is guaranteed only to be a critical point of the action, where the first-order change vanishes, and depending on the problem it may be a minimum, a maximum, or a saddle. The traditional name “principle of least action” is therefore a mild historical misnomer, a point Feynman was fond of making. What is always true is that the action does not change to first order, which is exactly the condition $dS/d\varepsilon|_{0}=0$.
  • 5
    Pulling the derivative $d/d\varepsilon$ inside the integral sign is itself a small theorem, not a free move. It requires $L$ and its first derivatives to be continuous in $\varepsilon$ near $\varepsilon=0$ and the path $q_r(t)$ to be differentiable on $[t_1,t_2]$; under those mild smoothness conditions, differentiation under the integral sign (a form of the Leibniz integral rule) is justified. Physics almost never worries about this, and it almost never needs to, but it is worth knowing the fine print exists.
  • 6
    This is the fundamental lemma of the calculus of variations, and it is worth stating carefully. If $f(t)$ is continuous on $[t_1,t_2]$ and $\int_{t_1}^{t_2} f(t)\,\eta(t)\,dt = 0$ for every smooth $\eta$ that vanishes at the two endpoints, then $f(t)=0$ everywhere on the interval. The argument is by contradiction: if $f$ were nonzero, say positive, at some interior point $t_0$, continuity guarantees $f$ stays positive on some small interval around $t_0$; choosing an $\eta$ that bulges upward only inside that interval and is zero elsewhere forces the integral to be strictly positive, contradicting the assumption that it is zero for every such $\eta$.
  • 7
    If the force depends on velocity, as the magnetic force does, it cannot be written as minus the gradient of an ordinary potential $V(x)$. The remedy is a velocity-dependent potential $U(x,\dot x)$, and the Euler–Lagrange machinery goes through untouched with $L = T – U$. The full Lorentz force on a charge comes out of exactly this generalization.
  • 8
    The label $A$ simply counts the independent components of whatever field you are studying. A single real scalar has one, a complex scalar has effectively two, the electromagnetic potential $A_\mu$ has four, and the metric of general relativity has ten. What follows never cares what the count is.
  • 9
    There is a factor of $c$ hiding in $x^0 = ct$, which makes $d^4x = c\,dt\,d^3x$. You can absorb that constant into the definition of $\mathcal L$, or you can set $x^0 = t$ and carry the factors of $c$ explicitly. Either way it is bookkeeping: a constant multiplying the whole action never changes which history makes the action stationary, so it cannot affect the equation of motion.
  • 10
    With several fields $\phi_A$, you introduce an independent nudge $\eta_A$ for each and run the same variation. Because the nudges are independent, the demand that the total variation vanish for all of them at once splits into one Euler–Lagrange equation per field. This is why the several-field case, which looks more general, is not any harder.
  • 11
    In one dimension the divergence theorem is just the fundamental theorem of calculus: $\int_{t_1}^{t_2}\frac{dF}{dt}\,dt = F(t_2)-F(t_1)$. The boundary of the interval $[t_1,t_2]$ is the two-point set $\{t_1,t_2\}$, and the signs in $F(t_2)-F(t_1)$ are just the outward orientation of that boundary: $+1$ at $t_2$, where the outward direction agrees with increasing $t$, and $-1$ at $t_1$, where it opposes it. Both the one-dimensional and the four-dimensional statements are special cases of the general Stokes theorem, which says that integrating a derivative over a region equals integrating the original object over the region’s boundary.
  • 12
    Apologies for the notation: $\mu$ is doing double duty here, as a spacetime index in $\partial_\mu$ and as the mass constant. Both usages are completely standard, and context keeps them apart, but it is worth flagging so you are not caught off guard.
  • 13
    The constant works out to $\mu = mc/\hbar$, so its reciprocal $1/\mu = \hbar/mc$ is the reduced Compton wavelength of a particle of mass $m$, the natural length scale the mass sets. Throughout I use the signature $(+,-,-,-)$, so that $\partial_\mu\partial^\mu = \frac{1}{c^2}\partial_t^2 – \nabla^2$; with the opposite convention a sign flips, but no physics does.
  • 14
    For a Lorentzian metric the determinant $g$ is negative, so $-g$ is positive and $\sqrt{-g}$ is real. The combination $\sqrt{-g}\,d^4x$ is the invariant four-volume, the same number in every coordinate system. In flat Minkowski coordinates the metric determinant is $-1$, so $\sqrt{-g}=1$ and the invariant volume reduces to the ordinary $d^4x$, which is why the flat-space derivation never had to mention it.
  • 15
    Two facts are doing quiet work here. First, a scalar field has no indices for the connection to act on, so $\nabla_\mu\phi = \partial_\mu\phi$; the first place the two derivatives part ways is a vector, where $\nabla_\mu V^\nu = \partial_\mu V^\nu + \Gamma^\nu{}_{\mu\lambda}V^\lambda$. Second, the divergence identity $\nabla_\mu V^\mu = \frac{1}{\sqrt{-g}}\partial_\mu(\sqrt{-g}\,V^\mu)$ used two lines below follows from the contracted Christoffel symbol $\Gamma^\lambda{}_{\mu\lambda} = \partial_\mu \ln\sqrt{-g}$.
  • 16
    For a vector or tensor field you must differentiate the density with respect to $\nabla_\mu\phi_A$ treating its indices honestly, and the resulting Euler–Lagrange operator carries extra connection terms. The Maxwell and Proca equations, and the linearized equations for a metric perturbation, all come out this way. The scalar spares us those terms without hiding the essential move.
  • 17
    This is the shadow of Noether’s theorem falling across the same calculation we already did. Time-translation symmetry of $L$ forces the surface term $\left[\partial L/\partial\dot q_r\,\dot q_r\right]_{t_1}^{t_2}$ built along the true trajectory to vanish identically, which is the statement that the Hamiltonian $H=\dot q_r\,\partial L/\partial\dot q_r – L$ is constant in time. In the field case the analogous choice of nudge, $\eta = \partial_\nu\phi$ for each spacetime direction $\nu$, produces the canonical energy–momentum tensor $T^\mu{}_\nu = \partial^\mu\phi\,\partial_\nu\phi – \delta^\mu{}_\nu\mathcal L$, and $\partial_\mu T^\mu{}_\nu=0$ is the local conservation law for energy and momentum carried by the field. Every conservation law you have ever used, momentum, angular momentum, electric charge, is a boundary term of exactly this kind, refusing to vanish because a symmetry protects it.
  • 18
    The gravitational case takes the Einstein–Hilbert action $S = \frac{1}{2\kappa}\int R\,\sqrt{-g}\,d^4x$, where $R$ is the Ricci scalar built from the metric, and varies with respect to the metric $g^{\mu\nu}$ itself rather than a field living on top of it. The same wiggle-and-discard procedure, with a more careful boundary analysis, yields Einstein’s field equations $G_{\mu\nu} = \kappa T_{\mu\nu}$.

About Aronno Mirdha

I am a theoretical physics student working on general relativity and black hole physics. My research builds statistical tools for testing whether independent observations of the same black hole, from gravitational waves to shadow imaging to stellar dynamics, all agree on a single underlying geometry.
This entry was posted in Expository and tagged , , , , , , , , , , , . Bookmark the permalink.