Visual walkthrough — Spring potential energy — derivation
Step 0 — What is a spring, and what is ?
WHAT. A spring has one length where it is happy: its natural length — not stretched, not squeezed. Call that the equilibrium position. We measure everything from there.
The single most important symbol on this page is : the displacement from equilibrium. If you pull the end out , then . If you push it in , then . At the happy length, .
WHY define this first. Every formula below uses . If you secretly meant "total length of the spring" you would get nonsense. So we nail it down with a picture before writing a single equation.
PICTURE. The relaxed spring, then the same spring stretched — the red arrow is , the gap between "where the end is now" and "where it rests."

Step 1 — How hard does the spring pull? (Hooke's law)
WHAT. Experiment says: the further you pull a spring, the harder it pulls back — and it does so in the simplest possible way, straight-line proportional. This is Hooke's Law:
Let us read this symbol by symbol, right where each sits:
- — the force the spring exerts, in newtons .
- — the spring constant, the "stiffness." Big = stubborn spring. Units: newtons per metre , i.e. how many newtons per metre of stretch.
- — our displacement from Step 0.
- the minus sign — this is the whole personality of a spring: the force points opposite to the displacement. Pull right (), it pulls left. Push left (), it pushes right. Always back toward . That is why we call it a restoring force.
WHY a straight line and not a curve? Because for an ideal spring the graph of force against is exactly a slanted line through the origin. That linearity is the reason the final energy comes out so clean. (Real springs bend from this at extreme stretch — but that is a different note.)
PICTURE. The force–displacement line. Notice it passes through the origin: at the spring pulls with zero force. That single fact — zero force at the start — is what defeats the naive "rectangle" guess later.

Step 2 — The force you must apply
WHAT. We want the energy stored, which equals the work you do stretching it slowly. To move the end without accelerating it, your pull must exactly cancel the spring's pull:
- The sign flipped to because you pull outward, the same direction as the stretch.
- Same size , opposite direction to — they are a balanced tug-of-war at every instant.
WHY do we track your force, not the spring's? Because "energy stored in the spring" = "work you had to invest against it." We build the store by pushing against the restoring force. This is the conservative-force bookkeeping: work done against a conservative force is banked as potential energy, none lost to heat.
PICTURE. Same slanted line, now labelled (the mirror of Step 2, drawn in the upper half). This is the line whose area we are about to measure.

Step 3 — Why one is a lie
WHAT. For a constant force, work is simply — a rectangle: height , width . Tempting to write .
WHY it is wrong. is the force only at the very end. At the start the force was (the line passes through the origin!). Using the biggest force for the whole trip double-counts. Look at the figure: the honest region under the line is a triangle, but is the full rectangle — twice as big.
PICTURE. The rectangle (wrong, faint) drawn over the triangle (right, red). The triangle is exactly half the rectangle. That factor of you keep seeing? It is that empty upper-left half.

Step 4 — Chop the motion into tiny slices
WHAT. The force changes as we move, so we cannot use over the whole trip. But over a tiny step it barely changes. Slice the stretch into thin strips. Let be a running position somewhere between and (the prime just means "the position we are currently at," to keep it distinct from the final ). Let be the width of one thin strip.
- — a position partway through, .
- — the (infinitesimally small) width of one slice.
WHY slice at all? Because "" is only legal when holds still. Making the slice infinitesimally thin makes the force effectively constant across it — legal again. This is precisely the Work done by a variable force trick.
PICTURE. The triangle carved into vertical strips. One strip is highlighted in red: at position its height is the force , its width is .

Step 5 — Work done on one slice
WHAT. For that single red strip, the force is essentially constant at , and the distance moved is . So the tiny bit of work is:
- — the sliver of work for this one strip.
- — the (constant, for this strip) force at position : the strip's height.
- — the strip's width.
- so is literally the area of one thin rectangle — height width.
WHY. This is honest used only where it is allowed: on a piece too thin for the force to change. Each strip contributes its little rectangular area of work.
PICTURE. Zoom on the single strip: height , width , area shaded red.

Step 6 — Add up every slice (the integral)
WHAT. Total work = sum of all the strip-areas from to . Adding infinitely many infinitely thin strips is the integral:
Reading the symbols:
- — "add up, sweeping from (relaxed) to (final stretch)."
- — the area of the strip at (from Step 5).
Now evaluate. Pull the constant out; the integral of is :
- — plug in top limit minus bottom limit.
- the bottom limit gives (no stretch, no stored work) — good sanity check.
WHY the integral equals the triangle. Summing all strip-areas is the same as the area of the whole triangle: base , height , area . The calculus and the geometry agree — as they must.
PICTURE. All strips filled in, merging into the solid red triangle, labelled base , height , area .

Step 7 — Work becomes stored energy
WHAT. The spring force is conservative: the work you spent against it is not burnt off as heat, it is banked inside the spring, ready to give back. So the stored potential energy equals that work:
WHY conservative matters. For a conservative force, work-in equals energy-stored with a perfect exchange rate. Release the spring and it does exactly of work back on whatever it pushes — the basis of the launch example and of Simple Harmonic Motion. It also underlies Conservation of mechanical energy.
PICTURE. The energy bowl: plotting against gives a parabola (a valley). The lowest point is (relaxed, zero stored energy); climbing either wall costs energy.

Step 8 — The degenerate & edge cases
Never leave the reader in an unshown scenario. Three cases:
- (relaxed). . No stretch, no stored energy. The bottom of the bowl.
- Compression (). Say . Then — the minus vanishes when squared. So , exactly the same as stretching by . Compression stores positive energy, equal to the matching stretch.
- Symmetry. Because depends on , the bowl is a perfect mirror: left wall (compress) matches right wall (stretch). Both walls climb; neither dips below zero.
PICTURE. The parabola again with two marked points, and , sitting at the same height — visually proving stretch and compression store equal energy.

The one-picture summary
Everything at once: the slanted force line , its triangular area = work = the number , and the resulting energy parabola whose valley floor is . Force is the slope-line; energy is the area beneath it.

Recall Feynman retelling — the whole walkthrough in plain words
A spring at rest is lazy — push it a hair and it barely pushes back. But every extra millimetre you pull, it fights you a little harder, in a straight-line-fair way: twice the stretch, twice the fight. So the "graph of fight versus stretch" is a slanted line climbing from zero. The total effort you spend is the space under that line — and the space under a slanted line from zero is a triangle, half a box, not the whole box. That is where the sneaky "half" comes from. Chop the stretch into hair-thin steps, do the easy on each (the force can't change across a hair), and add them all — that adding-up is what the integral sign means. It totals to half-times-stiffness-times-stretch-squared. Because a spring gives every bit of that back when released (nothing leaks to heat), that number is also the energy it now hoards. Squeeze instead of stretch? The stretch number turns negative, but you square it, so the minus disappears — squeezing stores the very same positive energy. Picture it all as a valley: sitting at the bottom is free; climbing either wall, stretch-side or squeeze-side, costs you exactly .
Active Recall
Why can't we use for a spring?
What is ?
Why does the integral equal the triangle area?
Why is the same for stretch and compression by the same amount?
Why does work-in equal energy-stored here?
Connections
- Hooke's Law — the linear force we integrate (Steps 1–2).
- Work done by a variable force — the slice-and-sum method (Steps 4–6).
- Conservative forces and potential energy — why work-in = stored (Step 7).
- Conservation of mechanical energy — turns back into motion.
- Simple Harmonic Motion — the parabolic bowl drives oscillation.
- Gravitational potential energy — contrast: constant force → rectangle → , linear not quadratic.