Skip to main content

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.
Starting model: The SHM equation and its general solutionDisplacement against time for x = A cos(ωt + φ), with the two constants computed from the start rather than assumed: x₀ = 0.04 m and v₀ = -0.60 m s⁻¹ at ω = 12 rad s⁻¹ give A = 0.064 m and φ = 0.90 rad, so the period is 0.52 s. The filled dot is the state at t = 0, the arrow is its slope v₀, and the dashed lines sit at x = ±A.x(t) = A cos(ωt + φ) ω = 12 rad s⁻¹A = 0.064 mstart x₀ = 0.04 m, v₀ = −0.60 m s⁻¹φ = 0.90 radx / mAdashed x = ±A, dot t = 0, arrow slope v₀t / s, 0 to 1.36 s
Start with a picture. Change the model in the lab below.
1

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.

2

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/m

General 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 rad

Amplitude 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 added

Phase 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 travelling
3

Interactive lab

Predict first. Explore the model. Compare the result.

Explore the model

0.04 m
−0.08 to 0.08 m; steps of 0.01.
−0.6 m s⁻¹
−0.8 to 0.8 m s⁻¹; steps of 0.1.
12 rad s⁻¹
6 to 16 rad s⁻¹; steps of 1.

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.

Interactive Physics III modelDisplacement against time for x = A cos(ωt + φ), with the two constants computed from the start rather than assumed: x₀ = 0.04 m and v₀ = -0.60 m s⁻¹ at ω = 12 rad s⁻¹ give A = 0.064 m and φ = 0.90 rad, so the period is 0.52 s. The filled dot is the state at t = 0, the arrow is its slope v₀, and the dashed lines sit at x = ±A.x(t) = A cos(ωt + φ) ω = 12 rad s⁻¹A = 0.064 mstart x₀ = 0.04 m, v₀ = −0.60 m s⁻¹φ = 0.90 radx / mAdashed x = ±A, dot t = 0, arrow slope v₀t / s, 0 to 1.36 s
Displacement against time for x = A cos(ωt + φ), with the two constants computed from the start rather than assumed: x₀ = 0.04 m and v₀ = −0.60 m s⁻¹ at ω = 12 rad s⁻¹ give A = 0.064 m and φ = 0.90 rad, so the period is 0.52 s. The filled dot is the state at t = 0, the arrow is its slope v₀, and the dashed lines sit at x = ±A.

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⁻¹

Baseline 0.04; choose −0.08 to 0.08, in steps of 0.01.
4. Compared with the saved baseline, this result will…

This experiment is kept only while this page is open. It does not change saved course progress.

4

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.

5

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.

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.

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.

6

Quick check

Select an answer and explain it before checking.

A glider obeys d²x/dt² = −(25 s⁻²)x. At t = 0 it is at x₀ = 0.30 m and moving at v₀ = +2.0 m s⁻¹. What is the amplitude of the motion?
7

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.

Extra challenging questions

Connect several ideas, explore supplied data, and compare your reasoning with a worked solution.