
Physics III course sequence · Interactive lesson
The SHM equation and its general solution
One line of algebra turns Newton's second law for a linear restoring force into an equation you can solve once and reuse everywhere. This topic is about that solution: why it carries exactly two free constants, how the starting position and velocity pin them down, and what you may do with two solutions at once.
UPIII-01.02 · Lesson 2 of 9 in this unit. Position is not a completion score.Build the model
The equation fixes ω; the start fixes A and φ.
The key idea
The SHM equation of motion is d²x/dt² = −ω²x, and its general solution is x(t) = A cos(ωt + φ): the equation fixes ω, while the amplitude A and the phase constant φ are fixed by the initial position and velocity.
Example. With ω = 12 rad s⁻¹, a body passing x₀ = 0.040 m at v₀ = −0.60 m s⁻¹ has v₀/ω = −0.050 m, so A = √(0.040² + 0.050²) = 0.064 m and φ = +0.896 rad, giving x(t) = 0.064 cos(12t + 0.896) m.
The complete physical model and assumptions
The physics is already finished by the time this topic starts: a restoring force proportional to displacement. What remains is a mathematical fact worth as much as the physics. Newton's second law with F = −kx becomes d²x/dt² = −(k/m)x, and the coefficient k/m is a reciprocal time squared, so it can be named ω². That one equation — linear, homogeneous, second order, constant coefficient — is the entire model, and it does not know whether it came from a spring, a pendulum, a floating cylinder or an atom in a crystal. Substituting x = A cos(ωt + φ) shows the equation is satisfied for every A and every φ, and because a second-order equation carries exactly two arbitrary constants, that two-parameter family is not one solution but all of them. The equation fixes ω and nothing else; the initial position and velocity fix A and φ. The rest follows: eliminating t gives v = ±ω√(A² − x²), and linearity guarantees that any sum of solutions is again a solution. The model stops precisely where linearity stops. Let the restoring force pick up a term in x³, or let a pendulum swing far enough that sin θ is no longer θ, and the frequency begins to depend on amplitude, the cosine stops being exact, and superposition fails.
1From a force law to a differential equation
Start from Newton's second law with the one force this section cares about, a restoring force proportional to displacement: m d²x/dt² = −kx. Divide by m and the physics of the particular apparatus disappears: d²x/dt² = −(k/m)x. Check the coefficient dimensionally. A stiffness in N m⁻¹ is kg s⁻², so k/m has units s⁻², a reciprocal time squared, and its positive square root is an angular frequency. Name it ω, and the equation becomes d²x/dt² = −ω²x. Three words describe it, and each one earns its place later. Linear: x and its derivatives appear only to the first power. Homogeneous: every term contains x, so x = 0 is a solution and equilibrium stays equilibrium. Constant coefficient: ω does not depend on t or on x. For a 0.20 kg glider on a spring of stiffness 45 N m⁻¹, ω = √(45/0.20) = 15 rad s⁻¹, so the coefficient in the equation is 225 s⁻² whatever the glider is later asked to do.
2Substitute the trial solution rather than quoting it
A solution is a claim you can test in two lines. Take x(t) = A cos(ωt + φ). Differentiating once gives dx/dt = −Aω sin(ωt + φ), and again gives d²x/dt² = −Aω² cos(ωt + φ), which is −ω² times the original x. The equation is satisfied identically — for every value of A and every value of φ, with no condition imposed on either. That is the first important result, and it is a negative one: the differential equation determines ω and nothing else. Notice also that x(t) = A sin(ωt + φ′) passes the same test, because it is the same family with φ′ = φ + π/2; the choice between cosine and sine is bookkeeping about where you start the clock, not physics. What the substitution cannot tell you is whether there are other solutions hiding elsewhere, and that question is settled by counting.
3Two constants, and the two numbers that fix them
A second-order equation needs two integrations, so its general solution carries exactly two arbitrary constants. A cos(ωt + φ) already has two, so the family is complete: there is nothing else to find. The two numbers that select one member are the state at one instant, conventionally t = 0. Setting t = 0 gives x₀ = A cos φ and v₀ = −Aω sin φ. Square and add, using cos² + sin² = 1, and A drops out of the trigonometry: A = √(x₀² + (v₀/ω)²). Divide the second by the first and A cancels instead: tan φ = −v₀/(ω x₀). Take ω = 12 rad s⁻¹, x₀ = 0.040 m and v₀ = −0.60 m s⁻¹. Then v₀/ω = −0.050 m, so A = √(0.0016 + 0.0025) = 0.0640 m and tan φ = 1.25, giving φ = 0.896 rad. Check it: 0.0640 cos(0.896) = 0.0400 m and −0.0640 × 12 × sin(0.896) = −0.600 m s⁻¹, both restored. The arctangent alone is ambiguous by π, so settle the quadrant with the signs of cos φ = x₀/A and sin φ = −v₀/(ωA).
4The same solution in sine–cosine and in phasor form
Expand the cosine of a sum: A cos(ωt + φ) = (A cos φ) cos ωt − (A sin φ) sin ωt. So x(t) = C cos ωt + D sin ωt is the same general solution wearing different constants, with C = A cos φ and D = −A sin φ, and going back the other way A = √(C² + D²). Fitted to initial conditions this form is even quicker: at t = 0 it gives x₀ = C directly, and dx/dt = −Cω sin ωt + Dω cos ωt gives v₀ = Dω, so C = x₀ and D = v₀/ω with no trigonometry at all. Its advantage is that it is linear in C and D, which is what makes least-squares fitting to data and the adding of solutions straightforward. A third dress is worth meeting now because the wave and driven-oscillator topics live in it: write x(t) = Re[ e(iωt)] with the complex amplitude  = A e(iφ). One complex number then carries both constants, and adding oscillations becomes adding arrows in the complex plane.
5Eliminate time to get speed as a function of position
Sometimes the clock is the wrong variable: you know where the body is, not when. Write θ = ωt + φ, so x = A cos θ and v = −Aω sin θ. Then x/A = cos θ and v/(Aω) = −sin θ, and squaring and adding kills θ: (x/A)² + (v/(Aω))² = 1, or v² = ω²(A² − x²). Hence v = ±ω√(A² − x²). Dimensions check: rad s⁻¹ multiplied by a length gives m s⁻¹. Limits check: at x = 0 the speed is its maximum ωA, and at x = ±A it is zero, which is what a turning point means. The ± is not sloppiness — it is the statement that the body passes each position twice per cycle, once outbound and once returning, and only the sign distinguishes them. Test it on the earlier numbers: with A = 0.0640 m and ω = 12 rad s⁻¹, the speed at x = 0.040 m is 12√(0.0041 − 0.0016) = 12 × 0.050 = 0.60 m s⁻¹, the starting speed given, as it must be.
6Superposition survives only while the equation is linear
If x₁ and x₂ both satisfy d²x/dt² = −ω²x, then so does a x₁ + b x₂ for any constants a and b, because differentiation is linear and no term in the equation squares x or feeds it to a sine. That licence is what makes the two-constant family closed, and it is why adding two oscillations of the same ω returns an oscillation of the same ω with a new amplitude and phase — amplitudes combining as phasors, not as numbers: 0.030 m and 0.040 m a quarter cycle apart give 0.050 m, never 0.070 m. The licence is withdrawn the moment the equation stops being linear. A pendulum's restoring torque goes as sin θ, not θ; keep the next term and the period grows with amplitude, T ≈ T₀(1 + θ₀²/16), which is 0.76% at θ₀ = 20° and no longer negligible at 60°. A spring with F = −kx − βx³ behaves the same way: the frequency depends on the amplitude, so the sum of two solutions is not a solution at all.
Key equations
Read the units, assumptions and limits before substituting.
The equation of motion
d²x/dt² = −ω²x
Every linear restoring force collapses to this one equation, so a single solution serves spring, pendulum and torsion bar alike.
x in m, t in s, ω in rad s⁻¹; dividing m d²x/dt² = −kx by m identifies ω² = k/mGeneral solution
x(t) = A cos(ωt + φ)
Two arbitrary constants is exactly what a second-order equation demands, so this family is the complete solution set, not one member of it.
A in m, φ in rad, and the whole argument ωt + φ in radAmplitude from the initial conditions
A = √(x₀² + (v₀/ω)²)
Starting speed enlarges the swing: A equals x₀ only when the body is released from rest.
x₀ in m, v₀ in m s⁻¹, ω in rad s⁻¹, so v₀/ω is a length and the two terms may be addedPhase constant from the initial conditions
tan φ = −v₀/(ω x₀)
Says where in the cycle your clock was started; a bare arctangent throws away half the circle.
φ in rad; the quadrant comes from cos φ = x₀/A together with sin φ = −v₀/(ωA)Sine–cosine form of the same solution
x(t) = C cos ωt + D sin ωt
Linear in its two constants, which makes fitting and superposing immediate: against the start, C = x₀ and D = v₀/ω.
C and D in m; comparing with A cos(ωt + φ) gives C = A cos φ and D = −A sin φSpeed at a given displacement
v = ±ω√(A² − x²)
Time has been eliminated, so the speed anywhere in the swing follows without solving for t first.
v in m s⁻¹, x and A in m, valid for |x| ≤ A; the sign says which way the body is travellingInteractive lab
Predict first. Explore the model. Compare the result.
Explore the model
Try this. Hold x₀ fixed and drag v₀ away from zero: the curve still starts at the same height, but the dashed ±A lines move outwards, because an oscillator that starts with speed has an amplitude larger than its initial displacement.
Live results
- AMPLITUDE A
- 0.064 m
- PHASE CONSTANT φ
- 0.90 rad
- SECOND LEG v₀/ω
- -0.050 m
- PERIOD T
- 0.52 s
Results follow this lesson’s model and assumptions. Displayed values are rounded.
Predict → change one variable → check
Plan a change before running it. Every other input stays at the saved baseline.
Saved baseline. Initial displacement x₀: 0.04 m; Initial velocity v₀: −0.6 m s⁻¹; Angular frequency ω: 12 rad s⁻¹
This experiment is kept only while this page is open. It does not change saved course progress.
Catch the common trap
The commonest error here is reading the amplitude straight off the starting position: A = x₀. That is true only for a release from rest. A is a property of the whole trajectory — the farthest the body ever gets — while x₀ is one point on it, and a body already moving at t = 0 must travel further before it turns. With ω = 12 rad s⁻¹, x₀ = 0.040 m and v₀ = −0.60 m s⁻¹ the amplitude is √(0.040² + 0.050²) = 0.064 m, sixty per cent larger than x₀, and every later answer built on 0.040 m is wrong. The mirror error is to expect the starting push to change ω. It cannot: ω comes from the coefficient in the differential equation, which is built from the system's inertia and stiffness alone, and A and φ are the only things the start is allowed to set.
Practice & worked examples
3 authored examples. Make an attempt, then reveal the reasoning one step at a time.
EasyExample 1
Show by substitution that x(t) = 0.12 cos(8.0t + π/3) m, with t in seconds, satisfies d²x/dt² = −(64 s⁻²)x. Then read off the angular frequency and period, and find the position and velocity at t = 0.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 6 steps revealed.
- Differentiate once: dx/dt = −(0.12)(8.0) sin(8.0t + π/3) = −0.96 sin(8.0t + π/3) m s⁻¹.
- Differentiate again: d²x/dt² = −(0.96)(8.0) cos(8.0t + π/3) = −7.68 cos(8.0t + π/3) m s⁻².
- Evaluate the right-hand side: −64x = −64 × 0.12 cos(8.0t + π/3) = −7.68 cos(8.0t + π/3) m s⁻². The two sides agree at every t, so the trial function is a solution.
- The coefficient is ω² = 64 s⁻², so ω = 8.0 rad s⁻¹ and T = 2π/ω = 0.785 s.
- At t = 0: x₀ = 0.12 cos(π/3) = 0.060 m and v₀ = −0.96 sin(π/3) = −0.83 m s⁻¹.
- Closing the loop, √(x₀² + (v₀/ω)²) = √(0.060² + 0.104²) = 0.12 m, which is the amplitude already written in the expression.
Answer. It is a solution: both sides reduce to −7.68 cos(8.0t + π/3) m s⁻². ω = 8.0 rad s⁻¹, T = 0.785 s, x₀ = 0.060 m, v₀ = −0.83 m s⁻¹.
MediumExample 2
A 0.20 kg glider on a spring of stiffness 45 N m⁻¹ runs on an air track. At t = 0 it is 0.050 m past equilibrium and moving back towards equilibrium at 0.90 m s⁻¹. Write x(t) in the form A cos(ωt + φ), then find the first time after t = 0 at which it reaches equilibrium.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 6 steps revealed.
- Angular frequency from the equation of motion: ω = √(k/m) = √(45/0.20) = √225 = 15 rad s⁻¹.
- Initial conditions, with the inward motion making v₀ negative: x₀ = +0.050 m and v₀ = −0.90 m s⁻¹, so v₀/ω = −0.060 m.
- Amplitude: A = √(0.050² + 0.060²) = √0.0061 = 0.0781 m, larger than x₀ because the glider is already moving.
- Phase: tan φ = −v₀/(ω x₀) = 0.90/(15 × 0.050) = 1.20, so φ = 0.876 rad, and cos φ = 0.640 is positive as x₀ > 0 requires. Hence x(t) = 0.0781 cos(15t + 0.876) m.
- Equilibrium means cos(15t + 0.876) = 0, first reached when 15t + 0.876 = π/2 = 1.5708.
- t = (1.5708 − 0.876)/15 = 0.0463 s, which is less than a quarter period, T/4 = 0.105 s, as it must be for a glider already heading inwards.
Answer. x(t) = 0.0781 cos(15t + 0.876 rad) m, and it first reaches equilibrium at t = 0.0463 s, passing through at the maximum speed Aω = 1.17 m s⁻¹.
HardExample 3
Two students solve the same equation d²x/dt² = −(81 s⁻²)x for a cart and get x₁ = 0.030 cos(9.0t) m and x₂ = 0.040 sin(9.0t) m. The cart's actual motion is the sum of the two. Justify that the sum is a solution, write it as a single cosine, then find the cart's speed as it passes x = +0.030 m and say which sign applies at t = 0.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 6 steps revealed.
- Linearity first: d²(x₁ + x₂)/dt² = −81x₁ − 81x₂ = −81(x₁ + x₂), so the sum solves the same equation, with ω = √81 = 9.0 rad s⁻¹.
- Match it to x = C cos ωt + D sin ωt, so C = 0.030 m and D = 0.040 m, and compare with A cos(ωt + φ), which gives C = A cos φ and D = −A sin φ.
- A = √(C² + D²) = √(0.0009 + 0.0016) = 0.050 m — not 0.070 m, because the two contributions are a quarter cycle apart and add as perpendicular phasors.
- cos φ = 0.030/0.050 = 0.60 with sin φ = −0.040/0.050 = −0.80 places φ in the fourth quadrant: φ = −0.927 rad, so x(t) = 0.050 cos(9.0t − 0.927) m.
- Speed with time eliminated: v = ±ω√(A² − x²) = ±9.0 × √(0.050² − 0.030²) = ±9.0 × 0.040 = ±0.36 m s⁻¹.
- Sign at t = 0: dx/dt = −0.27 sin(9.0t) + 0.36 cos(9.0t) m s⁻¹ gives v = +0.36 m s⁻¹, so the cart is outbound there and takes the −0.36 m s⁻¹ root when it next passes the same point.
Answer. x(t) = 0.050 cos(9.0t − 0.927 rad) m, amplitude 0.050 m. At x = +0.030 m the speed is 0.36 m s⁻¹, with v = +0.36 m s⁻¹ at t = 0 and −0.36 m s⁻¹ on the return pass.
Quick check
Select an answer and explain it before checking.
Review & continue
The SHM equation of motion is d²x/dt² = −ω²x, and its general solution is x(t) = A cos(ωt + φ): the equation fixes ω, while the amplitude A and the phase constant φ are fixed by the initial position and velocity.
- Explain the relationship without looking at the equation.
- Check a sign, a unit and a model assumption in your working.
- Return to the lab or worked example if a step is still unclear.
Optional supporting lessons
These chapter resources can help with earlier ideas; they are not additional required Physics III completion tasks.