Simple Harmonic Motion: Equation, Period & Examples
Simple harmonic motion explained: the restoring force F = −kx, the period T = 2π√(m/k), a worked mass-on-a-spring example, and a 3D spring you can pull and let go.

Simple harmonic motion (SHM) is a back-and-forth oscillation where the force pulling an object back to the middle is proportional to how far it has moved away, and always points towards the middle. Written as an equation, F = −kx. Because the pull grows with distance, the object speeds up towards the centre, overshoots, slows down and comes back, and every swing takes the same time no matter how big it is. A mass bouncing on a spring is the classic example, and you can pull one yourself in the 3D spring simulation.
What is the simple harmonic motion equation?
The simple harmonic motion equation starts from the restoring force, F = −kx. Using F = ma, the acceleration is a = −(k/m)x, often written a = −ω²x, where ω (omega) is the angular frequency in radians per second. Any motion that obeys a = −ω²x is simple harmonic.
The position over time is then a cosine wave:
x = A cos(ωt)
- x is the displacement: how far the object is from the middle (equilibrium), in metres.
- A is the amplitude: the biggest displacement, in metres.
- ω = √(k/m) for a mass on a spring.
- t is time in seconds.
The minus sign is the important part. It means the force always acts against the displacement: stretch the spring down and it pulls up; push it up and it pushes down.
What is Hooke's law and why does it give SHM?
Hooke's law says the force a spring exerts is proportional to how far it is stretched or squashed: F = kx, where k is the spring constant in newtons per metre (N/m). A stiff spring might have k = 200 N/m; a soft one k = 5 N/m.
Hooke's law gives SHM because the force is proportional to the displacement and points back towards the middle. That is exactly the condition a = −ω²x. It only holds while the spring stays within its elastic limit: stretch it too far and it deforms permanently, and the motion is no longer simple harmonic.
When a mass hangs on a spring, gravity first stretches it to a new resting point, the equilibrium position, where the spring force balances the weight: kx₀ = mg. The mass then oscillates about that point, not about the spring's natural length.
What is the period of a mass on a spring?
The period of a mass on a spring is the time for one complete oscillation:
T = 2π√(m/k)
- A heavier mass (bigger m) makes the period longer: more inertia, slower swings.
- A stiffer spring (bigger k) makes the period shorter: a bigger pull, faster swings.
- The amplitude does not appear. A big bounce and a small bounce take the same time. This property, called isochronism, is what makes SHM useful for clocks.
The frequency is the number of oscillations per second, f = 1/T, measured in hertz (Hz). Angular frequency links them: ω = 2πf.
Worked example
A 0.5 kg mass hangs on a spring with k = 20 N/m. It is pulled 0.10 m below equilibrium and let go.
- Period: T = 2π√(0.5 ÷ 20) = 2π√0.025 = 2π × 0.158 = 0.99 s.
- Frequency: f = 1 ÷ 0.99 = 1.01 Hz.
- Angular frequency: ω = √(20 ÷ 0.5) = √40 = 6.32 rad/s.
- Maximum speed (at the middle): v = ωA = 6.32 × 0.10 = 0.63 m/s.
- Maximum acceleration (at the ends): a = ω²A = 40 × 0.10 = 4.0 m/s².
- Rest stretch: x₀ = mg ÷ k = 0.5 × 9.81 ÷ 20 = 0.25 m below the spring's natural length.
Pull it down 0.20 m instead and the period is still 0.99 s. Only the speeds and accelerations double.
How does energy change during simple harmonic motion?
In SHM, energy swaps back and forth between elastic potential energy stored in the spring (E = ½kx²) and kinetic energy of the mass (E = ½mv²). With no friction, the total stays constant.
| Position | Displacement | Speed | Kinetic energy | Spring potential energy |
|---|---|---|---|---|
| End of the swing | ±A (maximum) | 0 | 0 | maximum |
| Middle (equilibrium) | 0 | maximum | maximum | 0 |
| In between | between 0 and A | between | between | between |
In the worked example, the total energy is ½kA² = ½ × 20 × 0.10² = 0.10 J. At the middle all of it is kinetic: ½ × 0.5 × 0.63² = 0.10 J. The numbers agree, which is a good check on any SHM calculation. The same energy swap happens in a skater on a ramp, which you can watch in the Energy Skate Park and read about in conservation of energy examples.
What are examples of simple harmonic motion?
Examples of simple harmonic motion, exactly or very nearly:
- A mass on a spring: the textbook case, T = 2π√(m/k).
- A simple pendulum at small angles (below about 15°): T = 2π√(L/g). A 1.0 m pendulum on Earth has T = 2.0 s. See how to find g with a simple pendulum.
- A guitar string vibrating, which makes a sound wave. Try it in Waves & Sound.
- A car's suspension bouncing after a bump (with dampers added to stop it).
- A quartz crystal in a watch, vibrating 32,768 times a second.
- Atoms in a solid vibrating about their fixed positions.
What is damping?
Damping is any force, such as air resistance or friction, that removes energy from an oscillation. The amplitude shrinks with each swing while the period stays almost the same. Light damping lets it ring for many swings; critical damping returns it to rest as fast as possible without overshooting, which is what car suspension and door closers are designed to do.
Common mistakes
- Thinking a bigger pull gives a longer period. For SHM the period does not depend on amplitude.
- Forgetting the square root. Doubling the mass makes T bigger by √2 (about 1.41 times), not 2 times.
- Measuring from the natural length. A hanging mass oscillates about its equilibrium position, mg/k below the natural length.
- Using the pendulum formula for big swings. T = 2π√(L/g) is only accurate for small angles.
- Mixing up f and ω. ω = 2πf, so 1 Hz is 6.28 rad/s.
Frequently asked questions
What is simple harmonic motion in simple words?
Simple harmonic motion is a steady back-and-forth movement where something is always pulled back towards the middle, and the further it goes, the harder the pull. A mass bouncing on a spring and a gently swinging pendulum both do it. Each swing takes the same time whether the movement is big or small, which is why pendulums and vibrating crystals are used to keep time in clocks and watches.
Does mass affect the period of a spring?
Yes. The period of a mass on a spring is T = 2π√(m/k), so a heavier mass gives a longer period. Because of the square root, four times the mass only doubles the period. This is different from a pendulum, where the mass of the bob makes no difference and only the length and gravity matter. A stiffer spring, with a bigger spring constant k, shortens the period.
Why doesn't amplitude affect the period?
When you pull the mass further, the spring pulls back harder in exact proportion, because F = −kx. The mass has further to travel but it also moves faster, and the two effects cancel exactly. So a 2 cm bounce and a 20 cm bounce on the same spring both take the same time. This only holds while Hooke's law holds, so very large stretches past the elastic limit break the rule.
Where is the speed greatest in SHM?
The speed is greatest at the middle of the motion, the equilibrium position, where the displacement is zero and all the energy is kinetic. The maximum speed is v = ωA. At the two ends of the swing the object stops for an instant and all the energy is stored as elastic potential energy, while the acceleration is at its greatest there and points back towards the middle.
Try it yourself
Open the spring SHM simulation, drag the blue mass down and let go. Watch the displacement graph draw a sine wave and the energy bars swap between spring potential and kinetic energy. Then try these:
- Pull it a little, then a lot: the period stays the same.
- Raise the mass slider and the swings slow down; raise the spring constant and they speed up.
- Turn on the comparison spring to race a stiffer spring side by side.
- Add damping and watch the amplitude shrink while the period stays put.
Voyez-le par vous-même, en 3D et gratuitement.
Essayez-le dans le Simple Harmonic Motion