Visual walkthrough — SHM differential equation — solution - x = A cos(ωt + φ)
Step 0 — What do the squiggles and even mean?
WHAT. Before any physics, meet the notation. Suppose is the distance of a ball from the centre line of a table, measured in metres, at each instant of time .
- = position (where the ball is).
- = velocity = "how fast is changing right now" (metres per second). The single dot is shorthand for "rate of change of."
- = acceleration = "how fast the velocity is changing" (metres per second, per second). Two dots = "rate of change of the rate of change."
WHY this notation. Physicists put dots on top of a letter instead of writing every time — it is the same thing, just shorter. Each dot means "take the slope of the graph with respect to time."
PICTURE. Below: a position curve (blue), its slope (velocity) at one marked point drawn as the orange tangent line. Where the tangent tilts steeply, velocity is large; where the curve is flat, velocity is zero.

Step 1 — The sentence the equation is saying
WHAT. The defining law of Simple Harmonic Motion is
Term by term: is where we're accelerating to; is where we currently are; is a constant "stiffness" number (always positive); the minus sign flips the direction.
WHY this shape. For a mass on a spring we use three plain quantities:
- = the mass of the ball, in kilograms (how much stuff there is to push around).
- = the spring stiffness, in newtons per metre (how hard the spring pulls per metre of stretch) — see Hooke's law.
- = the force on the ball, in newtons (the total push or pull it feels).
Hooke's law says the spring's pull is (pull is opposite the stretch, hence the minus). Newton's second law says (force = mass × acceleration). Since both equal , set them equal and divide by : We name the positive number as (writing it as a square guarantees it's positive, which we'll need later). So .
PICTURE. The arrow of acceleration always points back toward , and it grows longer the further out you go. That is the entire personality of the minus sign.

Step 2 — A trick to make the equation integrable: multiply by
WHAT. We multiply both sides of by the velocity :
WHY do this bizarre step? Because of a hidden calculus identity: multiplying by turns both sides into "the slope of something," and anything that is a slope can be integrated (un-slope-d) cleanly. Here are the two identities, shown outright using the chain rule (the slope of a squared thing is 2×thing×its slope, and the cancels the 2): So the left side of our multiplied equation is and the right side is . This is secretly energy conservation appearing on its own.
PICTURE. Two "bump" curves. The blue one is plotted against position (horizontal axis) — its tangent slope at any point equals . The orange one is plotted against velocity on the same horizontal axis — its slope equals . The picture exists to make one claim visible: the slope of a squared quantity is (that quantity) itself, which is precisely the chain-rule identity we used above.

Step 3 — Integrate to get a speed–position relation
WHAT. Un-slope both sides (that's what integrating means: add up the slopes to recover the original): Here is the constant of integration — a leftover number we haven't pinned down yet. Rearrange and rename :
Term by term: is speed-squared; is a new name for the constant, chosen so the equation looks tidy.
WHY write as ? Look at the boxed line: when , the right side is zero, so . A place where speed is zero is exactly a turning point — the ball is momentarily stopped at its furthest reach. So automatically becomes the amplitude (maximum displacement). We didn't assume that; the algebra handed it to us.
PICTURE. Speed vs position is an ellipse-like arch: fastest at the centre , zero at the edges .

Step 4 — Separate variables so the sinusoid is forced to appear
WHAT. Take the square root of the box and split position onto one side, time onto the other (using ):
Term by term: on the left, everything about where we are; on the right, everything about time. The carries whether we're moving out () or back ().
WHY this exact rearrangement? Because the left-hand side is a standard integral from circle geometry. Ask "what function has slope ?" and the honest answer is Both arcsine and arccosine work — they differ only by a constant (indeed ), and any constant is swallowed by the phase we're about to introduce. We are not choosing cosine by hand — the equation drags a circle-function in by its own logic.
PICTURE. The tiny slice over the shrinking length (the vertical side of a right triangle inside a circle of radius ) traces an angle on that circle — the birth of the reference circle.

Step 5 — Integrate both sides → the solution appears (and where the goes)
WHAT. Integrate. Using the arccosine form, and being careful with the sign: Multiply through by and gather every constant (from the integration and the ) into a single new letter : Now "un-do" the arccos by taking cosine of both sides (this is where being an inverse function earns its keep — ):
WHY the disappears. Because is an even function, , so the leftover sign in front of makes no difference — it vanishes inside the cosine. That from Step 4 got absorbed two ways: part into (a shift), and the rest killed by the evenness of cosine. This is why one constant , ranging over the full , is enough to capture "started moving left" versus "started moving right" — you don't need a separate sign.
Term by term, the boxed answer:
- — amplitude, the maximum reach (from Step 3).
- — angular frequency in rad/s, how fast the phase spins (from Step 1).
- — time.
- — phase constant, where in the swing we started, and which way (from Step 5).
PICTURE. The finished cosine wave, with marking its height and marking its horizontal shift.

Step 6 — Why exactly TWO leftover constants ( and )?
WHAT. We picked up one constant when we integrated in Step 3 (, which became ) and a second when we integrated in Step 5 (). Two integrations → two constants.
WHY exactly two, physically? To predict a motion whose second derivative is fixed, you must state two starting facts: where the ball is at , and how fast it's going. Plug into the solution and its velocity: Solving these two for and :
The appears because velocity has units of (position ); dividing by converts a speed back into a length so it can sit beside under the same square root.
PICTURE. Two dials — one sets height (), one sets the starting angle () — together locking one unique wave.

Step 7 — Every starting case, so no scenario surprises you
WHAT & PICTURE. Choosing correctly means checking both and the sign of , because alone can't tell two opposite situations apart (tangent repeats every ). See phase for the general rule. Four honest cases:
| Start condition | Correct | Resulting wave | ||
|---|---|---|---|---|
| Released from rest at right edge | ||||
| Released from rest at left edge | ||||
| Through centre moving right | ||||
| Through centre moving left |
WHY the centre-crossing cases pick . At the centre , so , forcing (the two angles with zero cosine). The tie between them is broken by the sign of the velocity: recall . Moving right means , which needs , i.e. . Moving left means , needing , i.e. . So the tangent-sign discussion and the velocity sign agree: same rule, "check which way you're moving," resolves both.

Degenerate check — what if ? Then : no spring, no restoring pull. The "oscillation" period — the ball never comes back. Correct: with nothing pulling it home, there is no wiggle at all. (Adding a little friction instead gives damped motion, a separate story.)
The one-picture summary
Everything above compressed into three linked panels, left to right: (1) the law — red arrows always pointing back to , longer when farther out (Step 1); (2) the speed-vs-position arch and the circle it becomes (Steps 3–4); (3) the resulting cosine wave (Step 5). Read the panels as a sentence: pull points home → speed law is a circle → position is a cosine.

Recall Feynman: tell the whole walkthrough to a 12-year-old
A ball on a rubber band feels a tug that gets stronger the further it's pulled — and the tug always points back to the middle. That single fact ("pull points home, and grows with distance") is our starting equation. We can't guess the answer, so we play a trick: multiply the equation by the ball's speed. Magically both sides become "the steepness of some hill," and steepness-of-a-hill is something we can add back up (integrate). Doing so gives a rule linking speed to position: fastest in the middle, frozen still at the two edges — and those edges we name , the amplitude. Rearranging that rule, a shape from circle-geometry (arcsine/arccosine) is forced to show up — we never chose it. Undo it and out pops . The two mystery letters are just the two facts you need to start any motion: how big the swing is () and where in the swing you began, plus which way you were headed (). Check where you start and which way you're moving, and you've got the exact wave.
Recall Quick self-test
Why must there be exactly two constants? ::: The equation involves a second derivative, so two integrations occur, each leaving one constant; physically, you must state starting position and starting velocity. Where does the cosine come from — did we assume it? ::: No; the integral equals (or ), a circle-function, so the sinusoid is forced out by the algebra. Two situations both give . How do you choose ? ::: Check the sign of : must match it, giving for and for . Where did the from separating variables go? ::: Part of it folds into the phase ; the rest is killed because cosine is even, .