advanced27 min studyLesson 123 in Physics

Euler–Lagrange equations from variations

Derive stationary action with fixed endpoints and test the distinction between a stationary path and a minimum.

On this page

What you’ll understand

  • Derive the boundary and interior terms in the first variation.
  • Apply independent path variations to obtain Euler–Lagrange equations.
  • Check stationary action without assuming the path minimizes it.

A differential equation compares a position with neighboring times. A variational principle compares an entire path with nearby paths. For smooth conservative mechanical models, these viewpoints describe the same local dynamics. The word stationary is crucial: a physical path makes the first-order action change vanish under allowed variations, but the action need not be smallest among all paths. We can derive that claim and test it with an explicit family of paths.

Vary a path while preserving its endpoints

Choose fixed initial and final times and fixed endpoint configurations. A nearby path is the original path plus a small parameter multiplying a smooth variation function that vanishes at both endpoints. The velocity variation is the time derivative of that function. Position and velocity arguments are treated independently when taking partial derivatives of the Lagrangian; their variations are linked only after substituting the varied path. Confusing a partial derivative with a total time derivative is a common source of missing terms.

Differentiate the action with respect to the small parameter at zero. One term multiplies the position variation and another multiplies its derivative. Integration by parts transfers the time derivative onto the conjugate momentum, leaving an endpoint contribution. The endpoint contribution vanishes because we fixed configurations, not because momentum is zero. If endpoint conditions change, this term must be reconsidered; discarding it automatically can remove a genuine natural boundary condition.

δS=[∑a∂L∂q˙aηa]titf+∫titf∑a(∂L∂qa−ddt∂L∂q˙a)ηa dt\delta S=\left[\sum_a\frac{\partial L}{\partial\dot q_a}\eta_a\right]_{t_i}^{t_f}+\int_{t_i}^{t_f}\sum_a\left(\frac{\partial L}{\partial q_a}-\frac{d}{dt}\frac{\partial L}{\partial\dot q_a}\right)\eta_a\,dt
Here η is the infinitesimal path variation and vanishes at fixed endpoints. Smoothness is assumed so differentiation and integration by parts are valid.↔ Scroll wide equations horizontally.

Independent interior variations impose a local law

For independent holonomic coordinates, each variation can be chosen freely inside the interval. If a continuous coefficient had a nonzero sign near some time, choosing a variation localized there would make the action change nonzero. Therefore every interior coefficient must vanish. This gives the Euler–Lagrange equations. A regular velocity Hessian allows these equations to be solved locally for accelerations; singular Lagrangians require additional constraint analysis rather than automatic inversion of a zero matrix.

For a mass on a spring, differentiating with respect to velocity gives mechanical momentum and differentiating with respect to position gives minus the spring force coefficient times displacement. The resulting equation is the familiar oscillator equation. Multiplying the whole Lagrangian by a nonzero constant changes the numerical action but not its stationary paths. Adding a total time derivative of a configuration function changes endpoint contributions while leaving these fixed-endpoint equations unchanged. Neither operation licenses changing individual kinetic or potential terms arbitrarily.

ddt∂L∂q˙a−∂L∂qa=0,L=m2x˙2−k2x2 ⟹ mx¨+kx=0\frac{d}{dt}\frac{\partial L}{\partial\dot q_a}-\frac{\partial L}{\partial q_a}=0,\qquad L=\frac m2\dot x^2-\frac k2x^2\ \Longrightarrow\ m\ddot x+kx=0
The displayed conservative equation assumes the independent variations are unconstrained. Nonconservative applied forces require a separate generalized-force contribution.↔ Scroll wide equations horizontally.

Stationarity is weaker than minimization

The first variation tests the term linear in the small path change. It says nothing by itself about the sign of the quadratic change. For a harmonic oscillator observed over a long enough interval, some fixed-endpoint variations decrease the action even though the actual solution remains stationary. The action principle is therefore not a mechanical search for the shortest visible curve or the least energy at every instant. Boundary-value problems can also have multiple stationary paths or special intervals with nonunique solutions.

The oscillator lab provides a separate check of a differential-equation solution, not a path-variation engine. Set damping ratio to zero, predict that changing natural frequency compresses the time scale, then play or step the normalized trajectory. The fixed initial data are displacement one and velocity zero. Introducing damping explores a different equation with a dissipative force; it does not show that the same autonomous T−V action suddenly produces damping. Keep the variational derivation and the illustrative initial-value model conceptually distinct.

A stationary path with lower-action neighbors

In dimensionless units take m=k=1, endpoints x(0)=x(2π)=0, and trial paths xε(t)=ε sin(t/2). Test stationarity of x=0 and the sign of its nearby action change.

  1. The zero path solves xddot+x=0. The trial paths share its endpoints because sin 0=sin π=0, and their rates are ε cos(t/2)/2.

  2. Over 0 to 2π, the integrals of sin²(t/2) and cos²(t/2) are both π. Hence S[xε]=(ε²/2)(π/4−π).

  3. Simplify to S[xε]=−3π ε²/8. Its derivative at ε=0 is zero, while every nonzero ε in this family gives a smaller action than S[0]=0.

S[xϵ]−S[0]=−3π8ϵ2,dS[xϵ]dϵ∣ϵ=0=0S[x_\epsilon]-S[0]=-\frac{3\pi}{8}\epsilon^2,\qquad \left.\frac{dS[x_\epsilon]}{d\epsilon}\right|_{\epsilon=0}=0
This calculation evaluates a chosen trial family exactly; it does not attempt to classify every possible variation.↔ Scroll wide equations horizontally.
The result

The zero path is stationary but not a local minimum on this interval. A single lower-action variation is enough to reject a minimum claim.

Explore the model

Interactive lab

Interactive lab · oscillator

Check the derived oscillator dynamics

Set Damping ratio to zero. Predict how doubling Natural frequency changes the normalized period, then play or step. This solves one analytic initial-value oscillator, not the action minimization problem.

Check the derived oscillator dynamicsUnit mass, x(0) = 1 and v(0) = 0. The analytic solution includes underdamped, critically damped and overdamped cases; time is measured in seconds. Current readings: Displacement x(t): 1; Velocity v(t): 0; Regime: underdamped. All parameters are adjustable with the labeled controls below.02.557.510−1.15−0.5700.571.15Time · sDisplacementunderdamped
Displacement x(t)Current time
Displacement x(t)
1
Velocity v(t)
0
Regime
underdamped
t = 0 s

Unit mass, x(0) = 1 and v(0) = 0. The analytic solution includes underdamped, critically damped and overdamped cases; time is measured in seconds. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA solution can satisfy the Euler–Lagrange equation without minimizing the action over every time interval.

Check your understanding

Why does the boundary term vanish in the fixed-configuration derivation?

Try it yourself

For a free unit mass over 0≤t≤1, compare the straight path x=t with xε=t+ε sin(πt). Show why the cross term integrates to zero and find the action change.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Expand one half of (1+επ cos πt) squared, then integrate the constant, cosine, and cosine-squared terms separately.

Compare with the solution

The cosine term integrates to sin π−sin 0=0. The squared cosine integrates to 1/2, so S[xε]−S[x]=ε²π²/4. This particular family increases the action for nonzero ε, while its first derivative at zero vanishes. Unlike the long-interval oscillator example, the quadratic correction here is positive.

Take it with you

  • Boundary conditions determine which variations are allowed.
  • Arbitrary interior variations yield a local differential equation.
  • Vanishing first variation does not establish a minimum.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.