Visual walkthrough — Principle of least action — Hamilton's principle derivation
Step 0 — The cast of characters (draw them before using them)
Before any calculus, let us meet every object on stage.
WHAT. We have a moving thing (a bead, a ball) described by one number that changes with time, called . Read it as "the position of the thing at time ". At the start time it sits at height ; at the end time it sits at . Those two dots are nailed down — given to us, not chosen.
WHY. Every other symbol we will meet is built on top of . If you can picture a curve on a "position vs time" graph, you already have the entire foundation.
PICTURE. The horizontal axis is time , the vertical axis is position . The solid curve is the true path; the two big dots at and are the fixed endpoints.

Step 1 — The Lagrangian gives each path a "score-rate"
WHAT. To every instant along a path we attach a single number: Here is the kinetic energy (energy of motion, big when the slope is steep) and is the potential energy (energy of position, big up a hill). Their difference is the Lagrangian.
- — the score-rate at one instant.
- — motion cost, grows with speed .
- — position cost, grows with height .
- The minus sign — "kinetic credit minus potential debt".
WHY this combination and not ? We are hunting for the rule that reproduces Newton. It turns out only does (the parent note checks it). For now, treat as a labelled machine we will justify by its output.
PICTURE. Two energy curves plotted against time along a sample path: in teal, in plum, and their difference in burnt orange. Watch how dips where the ball climbs (high ) and rises where it moves fast (high ).

Step 2 — Add up the score along the whole path: the action
WHAT. Sum (integrate) the score-rate over the whole trip:
- — the action: one number for one whole path. The square brackets warn us it eats a function, not a value.
- — "add up over every instant from start to end". Geometrically, the area under the -vs- curve.
WHY integrate? A single instant cannot tell you which path is best — you must judge the entire journey. The integral is exactly "total accumulated score".
PICTURE. The area under the orange curve of Step 2, shaded — that shaded area is for this path.

Step 3 — Wiggle the path: the family
WHAT. Take the true path and nudge it by a small wiggle:
- — an arbitrary smooth "bump" shape (the direction of the nudge).
- — a tiny knob controlling how much nudge.
- — the wiggle is pinned to zero at both ends, because the endpoints are fixed data we may not move.
WHY wiggle? To ask "is this path special?", we test whether tiny detours change the score. If no small detour changes to first order, the path is stationary — nature's choice.
PICTURE. The true path (solid) and several wiggled paths for different (dashed), all pinched together at the two endpoints. The vertical gap between dashed and solid is .

Step 4 — Turn the path-hunt into a one-variable calculus problem
WHAT. Feed the wiggled family into the action; now depends only on the knob : The true path is . "Stationary" means the graph of versus has a flat tangent at :
- — an ordinary function of one number now, easy to handle.
- — its slope; setting it to zero at is ordinary "flat point" calculus.
WHY. We converted a scary "search over all functions" into a familiar "find where the slope is zero" from one-variable calculus. That is the master trick of Calculus of Variations.
PICTURE. A parabola-like curve of ; its lowest point sits exactly at with a horizontal red tangent line — flat means stationary.

Step 5 — Chain rule: how the score reacts to the nudge
WHAT. Differentiate under the integral. feels only through its two slots and :
- — how much changes if you nudge position alone. Multiplied by because the position slot shifted by .
- — how much changes if you nudge slope alone. Multiplied by because the slope slot shifted by (the derivative of the wiggle).
WHY the chain rule? It is the exact tool that answers "if my inputs move a little, how much does the output move?" — precisely our question. Note is not independent of : it is its time-derivative. That link matters next.
PICTURE. A little box labelled with two input wires: the -wire wiggled by , the -wire wiggled by ; two contribution arrows add up to .

Step 6 — Integration by parts: trade for
WHAT. The second term carries , but the first carries . To factor out we must convert . Integration by parts does exactly that:
- The boundary chunk — evaluated at the two ends, where (Step 3's pin!) — so it dies.
- The surviving integral now carries (not ), ready to be factored.
WHY. This is the pivot of the whole derivation. Only after both terms share the same can we combine them. And the pin from Step 4 is what makes the boundary term vanish cleanly.
PICTURE. The boundary term drawn at the two endpoints as tiny arrows that collapse to zero (because there), leaving the middle integral intact.

Step 7 — Factor , then let it be arbitrary
WHAT. Combine Step 5 and Step 6: Because is any bump we like, the bracket must be zero at every instant. (If it were positive somewhere, place a bump there and the integral would be positive — contradiction.) That is the Fundamental Lemma of the Calculus of Variations.
- The bracket — the "residual force" the path feels.
- — free to probe any instant, so the bracket cannot hide anywhere.
WHY. Freedom of is what upgrades one integral equation into a pointwise law valid at every time.
PICTURE. A localized bump (a "test poke") sitting under the curve at one time; if the bracket were nonzero there, the shaded product would not cancel — forcing the bracket to zero everywhere.

Step 8 — Edge cases: what if the bracket isn't a clean minimum?
WHAT. says stationary, not minimum. Three flavours exist:
- Minimum — valley bottom; short trips, free particle. Every wiggle raises .
- Saddle — flat in the nudge direction but some wiggles raise and others lower . Common over long times past a "focal point".
- Degenerate / free-endpoint — if an endpoint is not pinned, there, the boundary term in Step 6 survives and gives an extra natural boundary condition at that end.
WHY. A reader who only saw the valley picture will wrongly believe "least" is literal. It is not — see the mistakes in the parent note. Covering saddle and free-end cases means no scenario surprises you.
PICTURE. Three miniature -vs- curves side by side: valley (minimum), true saddle (inflection-flat), and the free-endpoint case where the pin is released and the boundary arrow no longer vanishes.

The one-picture summary
Everything above, on one canvas: the pinned endpoints, the true path with its wiggled cousins, the score as area, the parabola going flat at , and the boxed result it forces.

Recall Feynman retelling of the whole walkthrough
Picture a graph of where you are against the time. You must start on one dot and finish on another dot — those are fixed. In between you may take any wiggly route. To each route we hand a "score": at every moment we take your energy-of-moving minus your energy-of-height, and we add all those little numbers up over the whole trip. That total is the action.
Now play a game: take the true route and jiggle it just a hair, keeping the two dots pinned. Does the score change? For nature's chosen route, the answer is no — not to first order. The score sits at a flat spot, like the bottom of a bowl. We turn "jiggle the whole route" into ordinary calculus by introducing a knob : at knob-zero the score-versus-knob curve is flat. Turning the crank (chain rule, then integration by parts, and the pinned ends killing the leftover boundary bit) squeezes the whole thing down to one demand: a certain bracket must be zero at every instant. That bracket, set to zero, is the Euler–Lagrange equation — and if you plug in kinetic-minus-potential energy, out pops . One lazy rule about a flat score, drawn as a bowl, becomes all of mechanics.
Recall Quick self-check
Why does the boundary term in Step 6 vanish? ::: Because the wiggle is pinned to zero at both fixed endpoints, so . What upgrades one integral equation into a law at every instant? ::: The freedom of (Fundamental Lemma) — the bracket can't be nonzero anywhere. Does mean minimum? ::: No — it means stationary: minimum, saddle, or maximum all qualify.
See also: Euler–Lagrange Equation · Lagrangian Mechanics · Hamiltonian Mechanics · Noether's Theorem · Newton's Second Law