From F=ma to the Lagrangiana whirlwind tour through least action

There are two ways to describe a falling apple. Newton tells you, at every instant, what force pulls it down. Lagrange tells you, from the moment it leaves the branch to the moment it hits the ground, which path among all conceivable paths it actually takes. These sound like different physics. They aren't.

The kernel
F=ma is a local rule: at each instant, force fixes acceleration. The Lagrangian framework is a global rule: of all possible trajectories from start to end, nature picks the one whose action is stationary. Calculus of variations turns the global statement back into a local one — and the local one it produces is exactly F=ma.

Newton (1687) wrote mechanics as a recipe: tell me where a body is now, how fast it's moving, and what forces act on it, and I will tell you what happens next. This is mechanics as local prediction. Step forward in time, recompute the force, step again.

Eighty years later, building on work by Maupertuis and Euler, Joseph-Louis Lagrange (1788, Mécanique Analytique) reframed the entire subject. Instead of asking "what happens next?" he asked "out of all the imaginable trajectories that connect where the particle starts to where it ends up, what is special about the real one?" His answer — a single function called the Lagrangian whose integral over the trajectory is minimized — turned out to give precisely Newton's equations back, but in a form that is coordinate-free, handles constraints effortlessly, and generalizes (without modification) to electromagnetism, relativity, and quantum field theory.

This page walks the bridge between the two views in five steps. By the end you should understand: what the action is, why it is \(\int(T-V)\,dt\) and not \(\int(T+V)\,dt\), what "calculus of variations" actually does, and why setting the variation of the action to zero is the same physical statement as F=ma.


Step 1Newton's view — local rules

Newton's law of motion is local in the strongest possible sense. At every point along a trajectory, the force on a particle determines its acceleration:

\[ F(q) = m\,\ddot q. \]

Read this as a recipe. Given position \(q(t)\) and velocity \(\dot q(t)\) right now, compute the force, divide by mass to get \(\ddot q\), advance a tiny step \(\Delta t\) forward in time, and repeat. The trajectory is built one infinitesimal step at a time. There is no notion of "future" — only of "next instant."

For a conservative force you can write \(F(q) = -V'(q)\), where \(V\) is the potential energy. The equation of motion becomes \(m\ddot q = -V'(q)\). The widget below integrates this for a particle in a double-well potential \(V(q) = (q^2-1)^2\) — two stable basins at \(q=\pm 1\) separated by a barrier. Drag the initial conditions; watch the trajectory build forward in time.

Widget 1 A particle in a double-well, integrated step by step by F=ma live · drag x₀ and v₀ · velocity-Verlet
E = 0.040 (conserved)
Left: position over time. Right: phase portrait — every state of the system is a point (q, q̇), and the trajectory is a curve. Energy is conserved to bounded error because velocity-Verlet is symplectic.
The formal version

Velocity-Verlet integration of \(m\ddot q = -V'(q)\) advances by

\[ q_{n+1} = q_n + v_n\,\Delta t + \tfrac{1}{2}a_n\,\Delta t^2, \qquad v_{n+1} = v_n + \tfrac{1}{2}(a_n + a_{n+1})\,\Delta t, \]

with \(a_n = -V'(q_n)/m\). This scheme is symplectic: it exactly preserves a slightly modified Hamiltonian (the so-called shadow Hamiltonian) to all orders, so the true energy oscillates within bounded error rather than drifting. The double-well \(V(q) = (q^2-1)^2\) has minima at \(q=\pm 1\) (energy 0) and a barrier at \(q=0\) (energy 1). If \(E < 1\) the particle is trapped in one well; if \(E > 1\) it traverses freely between them. The phase portrait shows the orbit closed (periodic, single-well) or figure-eight (cross-well), entirely from local steps.


Step 2A different question — many paths, one truth

Newton's framing is initial-value: you tell me where the particle starts and how fast, and I'll predict where it goes. Lagrange's framing is boundary-value: you tell me where the particle starts and where it ends up, and I'll tell you which trajectory it took to get there.

This is a strange question at first. Of course many curves can connect two points in space-time. Imagine throwing a ball from your hand at \(t=0\) so that it lands in a friend's hand at \(t=T\). You could draw infinitely many curves on a position-time diagram between those two endpoints — the actual parabola the ball follows is only one of them. What singles out the real one?

The widget below shows five candidate trajectories for a ball thrown straight up under gravity (\(V(q) = q\), starting at \(q=0\), required to return to \(q=0\) at \(t=2\)). One of them is the trajectory that Newton's law would actually produce. The others are mathematical fictions. Click each one; we'll compute a number called the action for it. Pay attention to which path's action is smallest.

Widget 2 Five candidate paths between fixed endpoints — which is real? click a path · compare actions
Select path →
Each path connects (t=0, q=0) to (t=2, q=0) — a ball that leaves the ground and returns. Click a path to compute its action S = ∫(T−V)dt.
The formal version

Each candidate trajectory \(q(t)\) is a function satisfying the boundary conditions \(q(0) = q_A\) and \(q(T) = q_B\). The space of such functions is infinite-dimensional — you can perturb any candidate in any way, anywhere in the interval, and you have a new candidate. The question "which one is real?" is therefore a question about a function on this infinite-dimensional space. The answer requires extending calculus from "find the minimum of a function of \(x\)" to "find the minimum of a function of a function". That extension is the calculus of variations, developed by Euler and Lagrange in the 1750s.


Step 3Each path has a number — the action

Here is the magic ingredient. For each candidate path \(q(t)\), define a number called the action:

\[ S[q] = \int_0^T L(q, \dot q)\,dt, \qquad L(q, \dot q) = T_\text{kin} - V = \tfrac{1}{2}m\dot q^2 - V(q). \]

The integrand \(L\) is the Lagrangian: kinetic energy minus potential energy. The square brackets in \(S[q]\) emphasize that \(S\) takes an entire function as input — the whole curve from \(t=0\) to \(t=T\) — and returns a single number.

Why \(T - V\) and not \(T + V\) (which would be total energy, a much more obvious quantity)? Short answer: because \(T - V\) is the combination whose minimization gives Newton's law. We'll prove that in step 5. For now, take it as a guess — Lagrange's guess — and check what kind of behavior it rewards.

A path through a region of high potential energy and low speed contributes a large negative term to the integrand. A path that moves fast (high \(T\)) but stays where \(V\) is small contributes a large positive term. So small action prefers paths that are slow where \(V\) is small and fast where \(V\) is large. That is: spend your time in the low-potential regions and get through the high-potential regions quickly. That already smells like how a ball falls.

The widget below lets you build a path with three draggable control points and watch the action evolve in real time. Notice how \(T(t)\), \(V(t)\), and \(L(t) = T - V\) all change as you bend the path. The shaded area under \(L(t)\) is the action.

Widget 3 Building the action by integrating L = T − V along a path drag the three black dots · watch S update
T (kinetic) V (potential) L = T − V S = 0.000
Drag the dots to reshape the path. The bottom panel shows the Lagrangian L(t) along the path you've drawn; the shaded area is the action S. The "snap to true path" button puts the path on the analytic Newton trajectory q(t) = ½t(2−t).

Step 4Calculus of variations — find where bending doesn't help

To find the minimum of an ordinary function \(f(x)\), you set its derivative to zero: \(f'(x) = 0\). That equation picks out the points where a tiny shift \(x \to x + \epsilon\) doesn't change \(f\) to first order in \(\epsilon\). "Stationary" means: in any direction, the function is flat to first order.

The action \(S[q]\) is a function on an infinite-dimensional space of curves. The analogous derivative-zero condition is: at the right path \(q^*(t)\), perturbing it by any small bump \(\epsilon\eta(t)\) (with \(\eta(0) = \eta(T) = 0\), so the endpoints stay fixed) should not change \(S\) to first order in \(\epsilon\):

\[ \frac{d}{d\epsilon}\bigg|_{\epsilon=0} S[q^* + \epsilon\eta] = 0 \qquad \text{for every admissible } \eta. \]

This is the principle of stationary action. It is the entire content of Lagrangian mechanics. Everything else is consequences.

The Taylor analogy — the first variation is a directional derivative

If that condition felt mysterious, here is the reassurance: it is the same first-order Taylor expansion you already know, just lifted into an infinite-dimensional space. In ordinary calculus, expand a function of one variable around a point \(x_0\):

\[ f(x_0 + \epsilon h) = f(x_0) + \epsilon\, f'(x_0)\, h + \tfrac{1}{2}\epsilon^2 f''(x_0)\, h^2 + O(\epsilon^3). \]

The first-order coefficient \(f'(x_0)\,h\) is the directional derivative of \(f\) at \(x_0\) in the direction \(h\). Setting it to zero for every \(h\) gives \(f'(x_0) = 0\), the critical-point condition.

The same machinery applies to the action, but the "point" is a function \(q^*(t)\) and the "direction" is itself a function \(\eta(t)\):

\[ S[q^* + \epsilon \eta] \;=\; S[q^*] \;+\; \epsilon\,\underbrace{\delta S[q^*;\eta]}_{\text{first variation}} \;+\; \tfrac{1}{2}\epsilon^2\,\underbrace{\delta^2 S[q^*;\eta]}_{\text{second variation}} \;+\; O(\epsilon^3). \]

The first variation \(\delta S\) is the directional derivative of \(S\) at \(q^*\) along the direction \(\eta\) — the literal Taylor coefficient. Stationary action means this coefficient vanishes for every admissible \(\eta\). First variation ↔ gradient; second variation ↔ Hessian; \(\delta S = 0\) ↔ critical point. The vocabulary changes only because "direction" is now a function with infinitely many independent components, which is why a single scalar condition (\(f' = 0\)) gets replaced by a differential equation (the Euler–Lagrange equation gives one constraint per \(t\)).

The widget below is this Taylor expansion drawn live. Pick a perturbation shape \(\eta(t)\) and slide its amplitude \(a\). The right panel plots

\[ S(a) \;=\; S[q^*] \;+\; a\,\delta S[q^*;\eta] \;+\; \tfrac{1}{2}a^2\,\delta^2 S[q^*;\eta] \;+\; \cdots \]

At the true path \(q^*\) the first variation vanishes, killing the linear term — that is what flatness at \(a=0\) looks like as a picture. What remains is the quadratic term \(\tfrac{1}{2}a^2\,\delta^2 S\); its sign tells you whether the stationary point is a local minimum, maximum, or saddle. Try switching between \(\sin(\pi t/T)\), \(\sin(2\pi t/T)\), and \(\sin(3\pi t/T)\) — each direction \(\eta\) has its own \(\delta^2 S\), and so each parabola opens at its own width. That is exactly how the eigenvalues of an ordinary Hessian decompose into curvatures along different perturbation directions.

Widget 4 Perturbing the true path — the action is stationary at a=0 live · drag amplitude · watch the parabola
S = -0.3333
Left: the true path (dashed) and the perturbed path q*(t) + a·η(t). Right: S(a) — a parabola, stationary at a=0 for any choice of η that vanishes at the endpoints. That is what "δS = 0" means in pictures.
The formal version

Expand:

\[ S[q^* + \epsilon\eta] = \int_0^T L(q^* + \epsilon\eta,\, \dot q^* + \epsilon\dot\eta)\,dt = S[q^*] + \epsilon\!\int_0^T \!\!\left(\frac{\partial L}{\partial q}\eta + \frac{\partial L}{\partial \dot q}\dot\eta\right)dt + O(\epsilon^2). \]

The first-order term is the first variation \(\delta S\). Integrate the second part by parts, using \(\eta(0)=\eta(T)=0\) to kill the boundary term:

\[ \int_0^T \frac{\partial L}{\partial \dot q}\dot\eta\,dt = \underbrace{\left[\frac{\partial L}{\partial \dot q}\eta\right]_0^T}_{=\,0} - \int_0^T \frac{d}{dt}\!\left(\frac{\partial L}{\partial \dot q}\right)\eta\,dt. \]

So

\[ \delta S = \int_0^T \left(\frac{\partial L}{\partial q} - \frac{d}{dt}\frac{\partial L}{\partial \dot q}\right)\eta(t)\,dt. \]

Stationarity demands this vanish for every admissible \(\eta\). The only way an integral against an arbitrary test function can always be zero is if the bracketed expression itself is zero at every \(t\):

\[ \boxed{\;\frac{d}{dt}\frac{\partial L}{\partial \dot q} - \frac{\partial L}{\partial q} = 0\;} \qquad \text{(Euler–Lagrange equation)}. \]

The widget's parabola is the second-order term \(\tfrac{1}{2}a^2 \int(\delta^2 S/\delta q^2)\eta^2\,dt\); the first-order term has been forced to zero by the choice of \(q^*\).


Step 5Euler–Lagrange is F=ma — watch a path become Newton's

Plug \(L = \tfrac{1}{2}m\dot q^2 - V(q)\) into the Euler–Lagrange equation from the previous "formal version" box. The pieces fall out immediately:

\[ \frac{\partial L}{\partial \dot q} = m\dot q \quad \text{(this is momentum)}, \qquad \frac{\partial L}{\partial q} = -V'(q) \quad \text{(this is the force)}. \]

So the Euler–Lagrange equation reads

\[ \frac{d}{dt}(m\dot q) - (-V'(q)) = 0 \quad \Longleftrightarrow \quad m\ddot q = -V'(q) = F. \]

That is Newton's second law. The minus sign in \(L = T - V\), which we asked you to take on faith in step 3, is exactly the sign needed to make \(\partial L/\partial q = -V' = F\) (force points downhill in potential). Try it with \(L = T + V\) and you get \(m\ddot q = +V'(q)\) — force pointing uphill, nonsense.

Now for the most direct possible demonstration: stop deriving and start computing. Discretize a path between \((t=0, q=0)\) and \((t=2, q=0)\) into a chain of 22 beads. Treat the action \(S\) as an ordinary function of the 20 interior bead positions. Run gradient descent: at each step, nudge every bead in the direction that lowers \(S\). Watch the path evolve.

Widget 5 Gradient descent on the action — a random path morphs into Newton's trajectory live · watch S minimize · max|∇S| → 0
iter 0 S = 0.000 max|∇S| = 0.000
The dashed curve is the analytic Newton trajectory q(t) = ½t(2−t). The solid curve is the chain of beads. Gradient descent on S makes the bead chain converge onto the dashed curve — because gradient descent on the action is, by construction, the Euler-Lagrange equation, which is F=ma.
The formal version

Discretize: \(q(t)\) at times \(t_i = i\,\Delta t\), with \(i=0,\dots,N+1\) and \(q_0, q_{N+1}\) fixed at the endpoints. Approximate the action by a midpoint rule:

\[ S \approx \sum_{i=0}^{N} \Delta t\!\left[\tfrac{1}{2}m\!\left(\frac{q_{i+1}-q_i}{\Delta t}\right)^{\!2} - V\!\left(\tfrac{q_i+q_{i+1}}{2}\right)\right]. \]

For an interior bead, take the partial derivative:

\[ \frac{\partial S}{\partial q_i} = -m\,\frac{q_{i+1} - 2q_i + q_{i-1}}{\Delta t} - \Delta t \cdot V'(q_i) + O(\Delta t^3). \]

The first term is the centered finite-difference approximation of \(-m\ddot q\,\Delta t\). So setting \(\partial S/\partial q_i = 0\) is, to leading order, exactly

\[ m\ddot q + V'(q) = 0, \]

the Newton equation. Gradient descent \(q_i \leftarrow q_i - \eta\,\partial S/\partial q_i\) therefore drives the bead chain toward the unique critical point of \(S\) — the Newton trajectory — as you watch.


RecapThe bridge in five planks

  1. Newton's law is local. Tell me the state now; I'll integrate forward. F = ma.
  2. Lagrange's question is global. Of all paths from A to B, which is real?
  3. Every path gets a number — the action \(S[q] = \int(T-V)\,dt\).
  4. Stationary action picks the real path. Perturb the right path in any way; \(S\) doesn't change to first order. That is the principle of stationary action; the calculus of variations is the machinery for solving it.
  5. The Euler–Lagrange equation is F=ma. With \(L = T - V\) the abstract condition \(\delta S = 0\) collapses, line by line, to \(m\ddot q = -V'(q)\) — Newton's law back again, this time as a global theorem.

The two views are mathematically equivalent; they answer the same question with different vocabulary. But the Lagrangian formulation has practical superpowers that Newton's doesn't.

Where this shows up

Coordinate freedom. Newton's law \(F = m\ddot q\) is written in inertial Cartesian coordinates. Try it in polar \((r,\theta)\) and you have to remember centrifugal and Coriolis terms by hand. The Lagrangian doesn't care: just write \(L = T - V\) in any coordinates you like (\(T = \tfrac{1}{2}m(\dot r^2 + r^2\dot\theta^2)\) in polar) and the Euler–Lagrange equation gives the correct equations of motion, centrifugal and Coriolis terms generated automatically.

Constraints. A bead on a wire, a pendulum on a rigid rod, a particle confined to a sphere — Newton requires solving for the unknown constraint force at every instant. Lagrangian mechanics simply uses the constraint to reduce the number of coordinates and writes \(L\) in those. The constraint force never appears in the equations.

Symmetries → conservation laws. Emmy Noether (1918) showed: every continuous symmetry of the Lagrangian gives a conserved quantity. Translation symmetry of \(L\) ↔ conservation of momentum. Time-translation symmetry ↔ conservation of energy. Rotational symmetry ↔ conservation of angular momentum. This is the deepest statement in classical mechanics, and it lives natively in the Lagrangian language.

Beyond particles. Field theories — electromagnetism, general relativity, the Standard Model of particle physics — are all formulated as principles of stationary action for some Lagrangian density \(\mathcal{L}(\phi, \partial_\mu\phi)\). The variational principle, dressed for whatever the theory is, is the spine of theoretical physics. Newton's \(F = ma\) does not generalize to fields. Lagrange's \(\delta S = 0\) does, without changing a symbol.