From shortest paths to the path Nature takes
In the earlier guides of this rung you learned to optimize a whole curve, not a number: a functional eats a function y(x) and returns a single value — the length of a hanging chain, the time down a brachistochrone — and the first variation vanishing gives the Euler-Lagrange equation. That was geometry. The astonishing turn in this final guide is that the SAME machinery governs how matter moves. Physics, it turns out, is a variational problem in disguise.
Recall the very first thing you ever optimized in Volume I: you found a critical point of a plain function by setting its derivative to zero. The calculus of variations is that idea lifted into infinitely many dimensions — instead of nudging one number x, you nudge an entire trajectory and demand that the leading change in the integral be zero. Hold that picture: stationary, not necessarily minimal. We will see this matters.
Hamilton's principle and the Lagrangian
Hamilton's principle of least action says: among all conceivable motions q(t) that a system could take between fixed start and end configurations at times t1 and t2, the one Nature actually follows makes the action S stationary. The action is an integral over time of a single function L called the Lagrangian: S = integral from t1 to t2 of L(q, q-dot, t) dt, where q-dot = dq/dt is the velocity. For ordinary mechanics, L = T - V, kinetic energy minus potential energy — a strange combination at first sight, not the total energy T + V.
Now feed this action into the Euler-Lagrange machinery with q playing the role of y and t the role of x. The stationarity condition d/dt(partial L / partial q-dot) - partial L / partial q = 0 pops out — and for L = T - V it is exactly Newton's second law, ma = F, with -partial V / partial q being the force. So F = ma is not a separate axiom; it is the Euler-Lagrange equation of the action. The deep payoff: this works in ANY coordinates — angles, distances along a wire, generalized coordinates — because the partial derivatives handle the bookkeeping automatically.
Action: S[q] = integral_{t1}^{t2} L(q, q', t) dt, q' = dq/dt
Euler-Lagrange: d/dt ( dL/dq' ) - dL/dq = 0
Mechanics: L = T - V = (1/2) m q'^2 - V(q)
dL/dq' = m q' dL/dq = -dV/dq
d/dt(m q') = -dV/dq => m q'' = F (Newton)Crossing to Hamilton: energy takes the wheel
There is a second, complementary picture. Define the momentum p = partial L / partial q-dot (for a free particle this is just the familiar mass times velocity), then trade the velocity q-dot for p through a Legendre transform to build the Hamiltonian H = p q-dot - L. For our mechanics example this miraculously comes out to H = T + V, the total energy. The whole framework is Lagrangian and Hamiltonian mechanics, two faces of one coin.
The single second-order Euler-Lagrange equation now splits into two graceful first-order ones, Hamilton's equations: q-dot = partial H / partial p and p-dot = -partial H / partial q. Geometrically, the state of the system is a point in phase space (q, p), and H generates its flow — the system glides along contours of constant energy when H has no explicit time dependence. This is the language in which quantum mechanics and statistical mechanics were later built, and the reason mathematicians care so much about the structure hiding behind ma = F.
A familiar bridge back to this rung: when the Lagrangian does not depend on x (here, on t) explicitly, the Beltrami identity already told you a combination stays constant along the extremal. In mechanics that constant IS the Hamiltonian — conservation of energy is the Beltrami identity wearing a physicist's hat. The variational thread you have been pulling on for several guides ties itself, here, directly to the most famous conservation law in science.
Noether: every symmetry hides a conservation law
Noether's theorem is one of the most beautiful results in all of mathematics. It says: every continuous symmetry of the action gives a conserved quantity, and vice versa. If the Lagrangian is unchanged when you shift time, energy is conserved. If it is unchanged when you shift the whole experiment in space, momentum is conserved. If it is unchanged when you rotate, angular momentum is conserved. Symmetry and conservation are not two facts but one, viewed from two sides.
The mechanism is wonderfully concrete. Suppose nudging the coordinate by a small symmetry, q -> q + epsilon*(something), leaves the action unchanged to first order. Run the same variation that produced the Euler-Lagrange equation, but now the boundary terms — which we usually kill by fixing the endpoints — carry the information instead. Combining "action unchanged" with "equation of motion holds" forces a certain combination of q and p to have zero time-derivative. That combination is the conserved charge. The conservation is literally read off from a vanishing first variation under the symmetry.
A first glimpse of optimal control
Classical variations asks for the best PATH when nature is free to roam. Optimal control asks a sharper, modern question: you can steer the system with a control input u(t) that you choose at each instant — but it is bounded (a rocket's thrust cannot exceed maximum, a car's brake cannot pull harder than the tires allow). Find the control that minimizes a cost, say fuel burned or time taken, subject to the dynamics. This is the calculus of variations grown up to meet engineering and economics.
Why isn't this just another Euler-Lagrange problem? Because the optimum often sits ON the boundary of the allowed controls — thrust full-on, then abruptly full-off — and at a corner the smooth condition "derivative equals zero" fails. Setting a derivative to zero finds interior optima; here the best move is to slam against the constraint. We need a tool that handles the wall, not just the smooth valley floor.
Pontryagin's maximum principle is exactly that tool, and it generalizes Hamilton's picture beautifully. You build a control Hamiltonian from the cost and the dynamics, introduce a costate (a momentum-like multiplier that you may recognize as a Lagrange multiplier for the constraints), and then — instead of "differentiate and set to zero" — you require that the OPTIMAL control maximize that Hamiltonian at every instant over the allowed set. On a corner it picks the boundary; in the interior it reduces to the familiar stationary condition. The famous bang-bang controls (full thrust, then none) drop straight out of this principle.
What you can carry forward
Step back and see how far one idea travelled. You began this rung asking for the shape of a hanging chain; you end it holding a principle from which all of mechanics — and the scaffolding of quantum theory and modern engineering — can be derived. The thread never changed: write down a functional, demand its first variation vanish, read off an equation of motion, and exploit symmetry to integrate it.
Be honest about the boundaries of the story, though. Hamilton's principle in its simplest form assumes conservative forces deriving from a potential; friction and other dissipative effects need extra terms or a modified action. Noether's theorem needs a CONTINUOUS symmetry — a discrete flip like mirror reflection does not deliver a conserved quantity this way. And "stationary" never promised "minimal." Knowing precisely where a powerful method stops is part of wielding it well — the same discipline you practised when you learned that a vanishing derivative marks a critical point, not automatically a minimum.