Visual walkthrough — Hamilton's principle — least action
We are chasing this final result — but you are not allowed to believe it yet: By the last step every mark above will be something you have seen.
Step 1 — A path is just a trail through a "position vs. time" chart
WHAT. Picture a bead sliding on a wire. At each instant (a moment in time) the bead sits at some position. Call that position . As time ticks forward the pair traces a curve on a flat chart: time runs left-to-right, position runs bottom-to-top. That whole curve is what we call a path — read " as a function of ", meaning "give me a time, I give you back where the bead is".
WHY. Before we can talk about "the best path" we must be able to see an arbitrary path. A path is not a formula in the sky — it is a drawn curve you can point at.
PICTURE. The blue curve below is one path. Notice the two fat dots at its ends: the start and end . Those two dots are nailed down — we are told where the bead begins and where it ends. The freedom is only in how the curve wiggles between them.

Step 2 — The slope of the trail is the velocity
WHAT. Zoom into one point of the curve and draw the little tangent line hugging it. Its steepness — how much the position changes per tiny tick of time — is the bead's velocity. We write it (say "q-dot"). The dot on top is shorthand for "rate of change with time".
WHY. Every physics ingredient we need (kinetic energy) depends on how fast the bead moves, not just where it is. Speed lives in the slope, so we must name the slope. We use a derivative here — and not just "distance ÷ time" — because the slope changes from point to point along the curve; the derivative is the tool that gives the instantaneous steepness at each single point.
PICTURE. Two points on the same curve: at the pink point the curve is steep so is large; at the yellow point it is nearly flat so is small. Same curve, different slopes.

Step 3 — Score each path with a single number: the action
WHAT. At every instant the bead has a kinetic energy (energy of motion, big when is big) and a potential energy (energy of position, big when the bead sits somewhere "expensive"). Form the Lagrangian Now slide along the whole path, read off at each instant, and add up all those values across the trip. That grand total is the action:
WHY. We want to compare whole paths against each other with one number, so we must crush an entire curve down to a single score. The tool that "adds up a value continuously along a curve" is the integral — a sum with infinitely many infinitely thin slices. A plain sum can't do it because changes smoothly at every instant; the integral is exactly the continuous-sum tool.
PICTURE. The value of at each time is a height; the action is the shaded area under that height-curve. Term by term:

Step 4 — Compare a path to its nudged neighbours (the wiggle )
WHAT. Take the candidate true path and add a small wiggle. Write the nudged path as Here (say "eta") is any smooth bump-shape, and (say "epsilon") is a tiny knob that controls how much of the bump we add. Crucially, the bump is flattened to zero at both ends:
WHY. "Best path" means: nudging it any which way cannot improve the score. To test that, we need a way to produce neighbouring paths on demand — that is the job of . And the ends must stay pinned (Step 1 nailed them), so the wiggle is forced to vanish there. This pinning is the whole reason the derivation works; keep your eye on it.
PICTURE. The solid blue curve is . The dashed curves are for a couple of values. See how all of them pass through the same two nailed dots — the wiggle pinches shut at the ends.

Step 5 — Turn the score into a curve in , and demand a flat top
WHAT. Feed the nudged path into the action. Since the path now depends on the dial , so does the score: Plot this single number against the dial . The true path is the one where sits at a flat point of this curve:
WHY. "Nudging any way can't improve the score" translates exactly into "the score-vs-dial curve has zero slope at ". We use the derivative because the derivative is precisely the tool that detects "flat = can't-be-improved-to-first-order". Note the flat point could be a valley (minimum), a hilltop (maximum), or a saddle — all are "stationary". That is why the honest name is stationary action, not least action.
PICTURE. A cup-shaped curve of against , tangent horizontal at . The tiny green tangent line is flat — that flatness is .

Step 6 — Differentiate: each slot of feels the wiggle
WHAT. Differentiate under the integral. The wiggle entered in two places — the position slot (gained ) and the velocity slot (gained ) — so the chain rule hands us two terms:
WHY. We want to know how the score changes when we turn the dial. The chain rule is the tool for "small change in output caused by small changes in several inputs". The symbol (a partial derivative) means "wiggle only the position slot of , freeze everything else" — we need it because has several inputs and we want the response of one at a time.
PICTURE. drawn as a little machine with two input dials, "position" and "velocity". The wiggle jiggles both dials; each dial's sensitivity ( and ) times its jiggle ( and ) is one term of the sum.

Step 7 — Integrate by parts to get a lone everywhere
WHAT. The second term is annoying: it contains (the slope of the wiggle), while the first contains bare . To combine them we must convert into . The tool for trading a derivative from one factor onto the other, inside an integral, is integration by parts: Now here is the payoff of the pinned ends (Step 4): , so the boundary term is at both ends. It vanishes.
WHY. We integrate by parts only to unify the two terms into a single common factor . And the endpoint-pinning is what lets us throw the boundary term away — this is the exact spot where "fixed endpoints" pays off. If the ends were free, that term would survive and we'd get a different problem.
PICTURE. The boundary term evaluated at each nailed dot: both heights are zero because the wiggle pinches shut there. The little brackets literally close on nothing.

Putting the surviving pieces back together:
Step 8 — The wiggle is arbitrary ⇒ the bracket must be zero everywhere
WHAT. We now have , and this must hold for every allowed wiggle . The Fundamental Lemma of the Calculus of Variations says: if a continuous gives zero area against every pinned wiggle, then itself is zero at every point. So .
WHY. Suppose were positive on some little interval. Then choose a wiggle that is a positive bump sitting exactly over that interval and zero elsewhere. The integral would come out positive, not zero — contradiction. Because we are free to place the bump anywhere, cannot be nonzero anywhere. The freedom of is the crowbar that pries the equation out of the integral.
PICTURE. A hypothetical that pokes above zero, with a matching positive bump parked on top of it; the shaded product-area is clearly positive — the contradiction that forces .

Setting and flipping the sign gives the destination:
The one-picture summary
One figure, whole journey: a nailed start and end, the true path in bold, a fan of pinned wiggles around it, the score-vs-dial cup flat at , and the arrow landing on the boxed E–L equation.

Recall Feynman retelling — the whole walk in plain words
Draw a bead's journey as a curve on a "where-was-it vs. when" chart, with its two ends hammered down (Steps 1–2). Give the whole curve one report-card number by adding up "energy of motion minus energy of position" along the trip — that total is the action, the shaded area under a score-curve (Step 3). Now jiggle the middle of the path while keeping the ends nailed; a little dial sets how hard you jiggle (Step 4). Watch the report-card number as you turn the dial and demand it sit at a flat spot at zero jiggle — nudging can't improve the true path (Step 5). Turning the dial jiggles two things inside the score, position and speed, so the change splits into two pieces (Step 6). One piece carries the slope of the jiggle; a clever swap (integration by parts) trades that slope back onto the plain jiggle, and — because the ends are nailed — the leftover boundary bit is exactly zero (Step 7). Finally, since you were allowed to jiggle any way you like, the only way the total stays zero for every jiggle is if the thing multiplying the jiggle is zero at every instant (Step 8). Write "that thing " and you have the Euler–Lagrange equation — which, for a mass on a spring or a bead in a hill, is just Newton's law in disguise. Related roads out of here: Lagrangian Mechanics, Hamiltonian Mechanics, Noether's Theorem, Fermat's Principle, and the pure-maths engine behind it all, Calculus of Variations.