Simple Harmonic Motion Explained: Definition, Formula, and Examples

Introduction
A child on a swing, a mass bobbing on a spring, a pendulum ticking in a clock, and the vibrations of a guitar string all share one hidden pattern. In each case, the object moves back and forth around a central position, and the force pulling it back grows stronger the farther it strays. Physicists call this pattern simple harmonic motion, or SHM, and it is one of the most important models in all of physics — because it describes not only swings and springs, but also sound waves, alternating current, molecular vibrations, and even the oscillations of buildings in an earthquake.
In this guide, you will learn the precise definition of simple harmonic motion, the equations that describe it, how period and frequency are determined, and how to solve typical SHM problems. You will also see why the same mathematics keeps appearing in wildly different parts of physics, and where the simple model breaks down in the real world.
Quick answer: Simple harmonic motion is periodic motion in which the restoring force is directly proportional to the displacement from equilibrium and always points back toward equilibrium: F = −kx. Its displacement follows a sine or cosine curve, x = A cos(ωt + φ), and its period depends only on the system, not on the amplitude.
What Is Simple Harmonic Motion? The Definition
Simple harmonic motion is a special type of periodic motion in which:
- The object oscillates back and forth about a fixed equilibrium position.
- The restoring force acting on it is directly proportional to its displacement from equilibrium.
- The restoring force always points toward the equilibrium position.
Mathematically, this defining condition is written as:
F = −kx
Here, F is the restoring force, x is the displacement from equilibrium, and k is a positive constant that measures the stiffness of the system. The minus sign is essential: it says the force always opposes the displacement. Pull a spring to the right, and the force pulls left. Compress it to the left, and the force pushes right. That opposition is what turns a single displacement into an endless oscillation.
Any system that obeys F = −kx will execute simple harmonic motion, regardless of what the system is made of. That universality is the reason SHM matters so much: learn the mathematics once, and you can apply it to springs, pendulums (for small angles), floating objects, vibrating molecules, and electrical circuits.
Equilibrium, Displacement, and Amplitude
Three words do most of the work in SHM, and it is worth defining them carefully:
Equilibrium position: the position where the net force on the object is zero and where it would sit at rest. For a mass on a horizontal spring, it is the spring’s natural length position. For a pendulum, it is the lowest point of the swing.
Displacement (x): how far the object is from equilibrium at a given moment, measured along the line of motion. It can be positive or negative depending on direction.
Amplitude (A): the maximum displacement from equilibrium — how far the object gets at the extremes of its swing. In ideal SHM, the amplitude stays constant forever, because no energy is lost.
Oscillation, Period, and Frequency
One complete back-and-forth trip — from one extreme, to the other, and back again — is one oscillation (or cycle). Two quantities describe how fast oscillations repeat:
Period (T): the time for one complete oscillation, measured in seconds.
Frequency (f): the number of oscillations per second, measured in hertz (Hz). Frequency and period are reciprocals: f = 1/T.
A related quantity, angular frequency (ω), measures the same idea in radians per second: ω = 2πf = 2π/T. Angular frequency appears in nearly every SHM equation, so getting comfortable with it is essential.
The Equations of Simple Harmonic Motion
Displacement as a Function of Time
If an object starts at its maximum displacement (amplitude A) at time t = 0 and then oscillates, its displacement at any later time is:
x(t) = A cos(ωt)
More generally, if the motion starts at some other point in the cycle, we include a phase constant φ (phi) that records where in the cycle the motion began:
x(t) = A cos(ωt + φ)
The phase constant simply shifts the cosine curve left or right in time. If the object starts at equilibrium moving in the positive direction, the motion is better described by a sine function: x(t) = A sin(ωt). Sine and cosine describe the same motion with a different starting point — they are the same curve, shifted by a quarter of a cycle.
Velocity and Acceleration
Differentiating the displacement equation gives velocity and acceleration:
Velocity: v(t) = −Aω sin(ωt + φ). Velocity is zero at the extremes (where the object turns around) and greatest at equilibrium (where it rushes through the middle).
Acceleration: a(t) = −Aω² cos(ωt + φ) = −ω²x. Acceleration is greatest at the extremes and zero at equilibrium — the exact opposite pattern to velocity.
The acceleration equation, a = −ω²x, is the signature of SHM. Comparing it with Newton’s second law, F = ma, gives F = −mω²x, which matches the defining condition F = −kx when ω² = k/m. This gives one of the most useful results in the topic:
ω = √(k/m)
Period and Frequency
From ω = 2π/T and ω = √(k/m), the period of a mass-spring system is:
T = 2π√(m/k)
and the frequency is:
f = (1/2π)√(k/m)
Notice something remarkable: the period does not depend on the amplitude. A mass on a spring takes the same time to complete an oscillation whether you stretch it 2 cm or 20 cm. This property, called isochronism, is what makes pendulums useful in clocks and springs useful in timekeeping devices. It is also why a swing takes the same time per swing no matter how high you go — as long as the small-angle approximation holds for pendulums.
The Mass-Spring System: The Classic Example
The mass-spring system is the textbook example of SHM because it obeys F = −kx exactly, thanks to Hooke’s law. Hooke’s law states that the force exerted by a spring is proportional to how far it is stretched or compressed: F = −kx, where k is the spring constant.
Energy in a Mass-Spring System
As the mass oscillates, energy continuously converts between two forms:
- Kinetic energy (½mv²): greatest at equilibrium, where the mass moves fastest.
- Elastic potential energy (½kx²): greatest at the extremes, where the spring is most stretched or compressed.
In an ideal system with no friction, the total mechanical energy stays constant:
E = ½kA²
The total energy depends only on the spring constant and the square of the amplitude. Doubling the amplitude quadruples the energy — a fact with practical consequences, from designing suspension systems to understanding why larger vibrations are disproportionately destructive.
Worked Example 1: Period of a Mass on a Spring
A 0.5 kg mass hangs from a spring with spring constant k = 200 N/m. What is the period of oscillation?
T = 2π√(m/k) = 2π√(0.5/200) = 2π√(0.0025) = 2π × 0.05 ≈ 0.314 s
The mass completes about three oscillations per second. Note how the calculation uses only mass and spring constant — the amplitude never enters.
Worked Example 2: Maximum Speed
If the mass in Example 1 is pulled 0.1 m from equilibrium and released, what is its maximum speed?
The maximum speed in SHM is v_max = Aω. First, ω = √(k/m) = √(200/0.5) = √400 = 20 rad/s. Then v_max = 0.1 × 20 = 2 m/s. The mass reaches 2 m/s as it passes through equilibrium.
The Simple Pendulum: SHM in Disguise
A simple pendulum — a small mass (bob) hanging from a light string — does not obviously obey F = −kx. The restoring force is the component of gravity along the arc of the swing, which is −mg sin θ, where θ is the angle from the vertical. For small angles (roughly less than 15 degrees), sin θ is very close to θ itself (measured in radians). This small-angle approximation turns the force into F ≈ −(mg/L)x, where L is the string length and x is the displacement along the arc. That is exactly the SHM form, with an effective k = mg/L.
The period of a simple pendulum for small angles is therefore:
T = 2π√(L/g)
This formula carries two famous consequences:
- The period does not depend on the mass of the bob. A heavy bob and a light bob on identical strings swing together.
- The period does not depend on the amplitude (for small angles). This is why pendulum clocks keep steady time even as their swing slowly dies down.
It does depend on length: a longer pendulum swings more slowly. Clockmakers exploit this directly — lengthening a pendulum clock’s pendulum makes it run slower, shortening it makes it run faster. And because the period depends on g, a pendulum clock taken to the Moon (where g is about one-sixth of Earth’s) would run noticeably slower, and a pendulum provides a practical way to measure local gravity.
Worked Example 3: A One-Second Pendulum
How long must a pendulum be to have a period of exactly 2 seconds (one second each way, the classic “seconds pendulum” of old clocks)?
Rearranging T = 2π√(L/g): L = gT²/(4π²) = (9.8 × 4)/(4 × 9.87) = 39.2/39.48 ≈ 0.99 m. About one meter — a neat coincidence that once made the meter’s definition tempting to tie to the pendulum.
SHM and Uniform Circular Motion: A Beautiful Connection

Simple harmonic motion has a deep relationship with uniform circular motion. Imagine a peg on a rotating turntable, viewed from the side. As the turntable spins at constant speed, the peg’s shadow (or its projection onto one axis) moves back and forth in exactly simple harmonic motion. The amplitude of the SHM equals the radius of the circle, and the angular frequency equals the turntable’s angular velocity.
This connection explains why sines and cosines appear in SHM equations: the motion is literally the shadow of circular motion. It also gives an intuitive route to the formulas. The centripetal acceleration of the peg is ω²r toward the center, and its component along the axis of motion is −ω²x — exactly the SHM acceleration. This link between circular motion and oscillation is worth studying alongside our guide to what centripetal force is, since the same ω appears in both.
Other Examples of Simple Harmonic Motion
A Floating Object
Push a floating block slightly down into water and release it: buoyancy provides a restoring force proportional to the extra submerged depth, so the block bobs in SHM (for small displacements). Ships and buoys behave the same way, and naval architects calculate these oscillation periods to keep vessels stable.
A Mass on a Vertical Spring
Hang a mass from a vertical spring and it settles at a new equilibrium where the spring force balances gravity. Displace it from that new equilibrium and it oscillates in SHM about the stretched position, with the same period formula T = 2π√(m/k). Gravity shifts the equilibrium but does not change the oscillation — a subtle point that trips up many students.
Torsional Oscillation
Twist a disk suspended by a wire and release it: the wire’s twisting resistance provides a restoring torque proportional to the angle, producing torsional SHM. Balance wheels in mechanical watches work this way, and the same mathematics describes their timekeeping.
Vibrating Strings and Air Columns
A guitar string plucked at its center vibrates in a pattern built from SHM: each point on the string oscillates sinusoidally, and the superposition of these oscillations creates the standing wave that determines the note. Organ pipes, flutes, and the human voice all rely on oscillating air columns governed by the same equations. The frequency of a vibrating string depends on its length, tension, and mass per unit length — the reason tuning a guitar means adjusting tension.
Molecular Vibrations
At the microscopic scale, atoms in a molecule are held by bonds that behave like tiny springs for small displacements. Molecules vibrate in SHM-like modes, and these vibrations absorb infrared radiation at characteristic frequencies — the basis of infrared spectroscopy, which chemists use to identify substances. The SHM model, born from springs and pendulums, thus reaches all the way down to chemistry.
Electrical Oscillations: The LC Circuit
In an LC circuit (an inductor and capacitor connected together), charge sloshes back and forth between the capacitor’s plates and the inductor’s magnetic field, exactly like energy sloshing between spring and mass. The charge obeys the same differential equation as SHM, with the oscillation frequency f = 1/(2π√(LC)). Radio tuners exploit this: adjusting the capacitance tunes the circuit’s natural frequency to the desired station. This electrical analogy is one of the strongest reasons SHM is taught so thoroughly.
Damped Oscillations: When SHM Meets Reality

Real oscillations do not last forever. Friction, air resistance, and other dissipative forces remove energy, and the amplitude decays over time. This is called damped oscillation. A playground swing, left alone, slowly comes to rest; a car’s suspension, after a bump, settles back to level.
Damping comes in three strengths:
- Underdamping: the system still oscillates, but with steadily shrinking amplitude. Most everyday examples, like swings and springs, are underdamped.
- Critical damping: the system returns to equilibrium as quickly as possible without oscillating. Car shock absorbers aim for near-critical damping so the car settles fast without bouncing.
- Overdamping: the system returns to equilibrium slowly, without oscillating. A door closer that takes a long time to shut is overdamped.
Engineers tune damping deliberately. Too little damping in a bridge or building lets wind or traffic vibrations build up; too much damping in a measuring instrument makes it sluggish. The mathematics of damped oscillation adds an exponential decay factor to the SHM solution: x(t) = Ae^(−bt/2m) cos(ω’t + φ), where b is the damping coefficient.
Forced Oscillations and Resonance
If an external periodic force drives an oscillator, the result is forced oscillation. The system eventually oscillates at the driving frequency, not its natural frequency. But when the driving frequency matches the system’s natural frequency, something dramatic happens: resonance. The amplitude grows enormously, limited only by damping.
Resonance is everywhere, for good and ill:
- Musical instruments exploit resonance: a soundboard resonates with the string’s vibrations, amplifying the sound.
- Radio tuning uses resonance to select one station’s frequency from the airwaves.
- The Tacoma Narrows Bridge collapse of 1940 is the classic cautionary tale: wind-driven oscillations at the bridge’s natural frequency grew until the structure failed. Modern bridges are designed with damping and aerodynamic shaping to prevent resonance.
- MRI machines use nuclear magnetic resonance, driving atomic nuclei at their resonant frequency to produce images of the body.
Resonance shows why understanding natural frequency matters: anything that oscillates has a frequency it “prefers,” and driving it at that frequency can produce outsized effects.
Simple Harmonic Motion vs Other Periodic Motion
Not all periodic motion is SHM. A bouncing ball is periodic but not SHM, because the force during the bounce is not proportional to displacement. A planet’s elliptical orbit is periodic but not SHM. A Ferris wheel cabin moves periodically but with no restoring force at all. The test is always the same: does the system obey F = −kx (or its rotational equivalent)? If yes, the motion is SHM and the whole machinery of sine curves, periods, and energy formulas applies. If no, the motion may still be periodic, but it needs different mathematics.
| Motion | Periodic? | SHM? | Why |
|---|---|---|---|
| Mass on a spring | Yes | Yes | Hooke’s law gives F = −kx exactly |
| Small-angle pendulum | Yes | Yes (approximately) | Small-angle approximation gives F ≈ −kx |
| Large-angle pendulum | Yes | No | sin θ differs significantly from θ |
| Bouncing ball | Yes | No | Force acts only during brief impacts |
| Ferris wheel cabin | Yes | No | No restoring force; constant rotation |
| Earth orbiting the Sun | Yes | No | Elliptical orbit, inverse-square force |
| LC circuit charge | Yes | Yes | Circuit equation matches SHM form |
| Swing pushed each cycle | Yes | Driven | External force maintains amplitude |
Solving SHM Problems: A Step-by-Step Method
Step 1: Confirm SHM applies
Check that the restoring force is proportional to displacement and points toward equilibrium. For pendulums, confirm the angle is small.
Step 2: Identify k and m (or L and g)
For a spring, read off k and m. For a pendulum, read off L and use g = 9.8 m/s². For other systems, find the effective “stiffness” — the constant relating force to displacement.
Step 3: Compute ω, T, and f
Use ω = √(k/m), T = 2π/ω, and f = 1/T. For a pendulum, use T = 2π√(L/g).
Step 4: Use the energy or kinematic equations
For speeds and positions, use x(t) = A cos(ωt + φ), v_max = Aω, a_max = Aω², or energy conservation E = ½kA² = ½mv² + ½kx². Pick whichever equation connects the quantities you know to the one you want.
Step 5: Check the answer
Does the period make sense — longer pendulum, longer period; stiffer spring, shorter period? Is the maximum speed at equilibrium, not at the extremes? A quick sanity check catches most sign and formula errors.
Worked Example 4: Full Problem
A 0.2 kg mass on a spring (k = 50 N/m) is pulled 0.08 m from equilibrium and released from rest. Find (a) the period, (b) the maximum speed, (c) the speed when the displacement is 0.04 m.
(a) T = 2π√(m/k) = 2π√(0.2/50) = 2π√(0.004) = 2π × 0.0632 ≈ 0.397 s.
(b) ω = √(k/m) = √(50/0.2) = √250 ≈ 15.81 rad/s. v_max = Aω = 0.08 × 15.81 ≈ 1.26 m/s.
(c) Using energy: ½kA² = ½mv² + ½kx². So v² = (k/m)(A² − x²) = 250 × (0.0064 − 0.0016) = 250 × 0.0048 = 1.2, giving v ≈ 1.10 m/s.
Common Mistakes to Avoid
Mistake 1: Applying the Pendulum Formula at Large Angles
T = 2π√(L/g) is a small-angle approximation. At 30 degrees or more, the true period is noticeably longer. Exam questions that specify a large angle are testing whether you notice this.
Mistake 2: Confusing Frequency and Angular Frequency
Frequency f is cycles per second; angular frequency ω is radians per second, and ω = 2πf. Forgetting the 2π factor is the single most common SHM arithmetic error.
Mistake 3: Thinking Amplitude Affects the Period
In ideal SHM, the period is independent of amplitude. A mass on a spring with a 20 cm swing has the same period as one with a 2 cm swing. (Damping and large-angle effects break this in real systems, but the ideal result is the one exams test.)
Mistake 4: Mixing Up Where Speed and Acceleration Are Greatest
Speed is greatest at equilibrium and zero at the extremes; acceleration is zero at equilibrium and greatest at the extremes. Sketching one cycle of x, v, and a curves together fixes this permanently.
Mistake 5: Forgetting the Minus Sign
The minus sign in F = −kx is the physics: it encodes “toward equilibrium.” Dropping it turns a restoring force into a repelling force, which would push the object away forever instead of oscillating.
SHM in the Wider Physics Curriculum
SHM connects to nearly every other topic in mechanics and waves. It uses Newton’s second law to derive its equations, energy conservation to analyze its motion, and circular motion for its geometric interpretation. It introduces waves: a traveling wave can be understood as a chain of oscillators, each in SHM, passing energy along. Sound, light (in its classical wave picture), and water waves all build on this foundation.
For students following a structured path, SHM naturally follows work on forces and energy. Our guides to what kinetic energy is, what potential energy is, and the difference between speed and velocity provide the background, while sound wave frequency shows SHM’s ideas at work in waves. The energy analysis of SHM also links to work and power and to inertia, which governs how mass resists the restoring force.
Key Takeaways
- SHM is defined by F = −kx: a restoring force proportional to displacement, always toward equilibrium.
- Displacement follows x = A cos(ωt + φ); velocity and acceleration follow by differentiation.
- Period is independent of amplitude: T = 2π√(m/k) for springs, T = 2π√(L/g) for small-angle pendulums.
- Energy swaps between kinetic and potential forms, with total E = ½kA².
- Real oscillations are damped; driven oscillations can resonate when the driving frequency matches the natural frequency.
- SHM appears in springs, pendulums, floating bodies, vibrating strings, molecules, and LC circuits — the same mathematics everywhere.
Conclusion
Simple harmonic motion earns its place at the heart of physics because it is both simple and universal. One equation, F = −kx, generates the sine curves, the period formulas, and the energy relationships that describe swings, springs, clocks, musical instruments, radio circuits, and molecular vibrations. Learning to recognize SHM — to spot the restoring force proportional to displacement — is a skill that pays off across mechanics, waves, and beyond. And when the ideal model meets the real world, its extensions — damping and resonance — explain why bridges need dampers, why radios can tune, and why a swing eventually stops unless someone keeps pushing.
Frequently Asked Questions
What is simple harmonic motion in simple words?
Simple harmonic motion is a back-and-forth movement where the force pulling an object back to its resting position gets stronger the farther the object moves away. A mass on a spring and a gently swinging pendulum are classic examples.
What is the formula for simple harmonic motion?
The defining force law is F = −kx. Displacement follows x = A cos(ωt + φ), with angular frequency ω = √(k/m) for a spring system, and period T = 2π√(m/k).
What are examples of simple harmonic motion?
A mass on a spring, a small-angle pendulum, a bobbing floating object, a vibrating guitar string, a tuning fork, molecular vibrations, and charge oscillating in an LC circuit are all examples.
What is the difference between oscillation and simple harmonic motion?
Oscillation is any repeated back-and-forth motion. Simple harmonic motion is the specific case where the restoring force is proportional to displacement, producing sinusoidal motion. All SHM is oscillation, but not all oscillation is SHM.
Does amplitude affect the period in SHM?
No. In ideal simple harmonic motion, the period is independent of amplitude. This property is called isochronism and is what makes pendulums useful for timekeeping.
What is the period of a simple pendulum?
For small angles, T = 2π√(L/g), where L is the pendulum length and g is the acceleration due to gravity. It depends on length and gravity, not on mass or amplitude.
What is angular frequency in SHM?
Angular frequency, ω, is the rate of oscillation measured in radians per second. It relates to frequency by ω = 2πf and to period by ω = 2π/T. For a spring system, ω = √(k/m).
What is phase constant in SHM?
The phase constant φ records where in the oscillation cycle the motion starts at t = 0. It shifts the sine or cosine curve in time but does not change the period, frequency, or amplitude.
Where is velocity greatest in SHM?
Velocity is greatest as the object passes through equilibrium, where the restoring force is momentarily zero and all the energy is kinetic. Velocity is zero at the extremes, where the object turns around.
Where is acceleration greatest in SHM?
Acceleration is greatest at the extremes of motion, where displacement and restoring force are largest, and zero at equilibrium. It always points toward equilibrium.
What is damped oscillation?
Damped oscillation is SHM with energy gradually removed by friction or air resistance, so the amplitude shrinks over time until the motion stops. Car suspensions and door closers are designed around controlled damping.
What is resonance?
Resonance occurs when an external driving force matches an oscillator’s natural frequency, causing the amplitude to grow dramatically. It is used in musical instruments and radio tuning, and must be avoided in bridges and buildings.
Is a pendulum simple harmonic motion?
A pendulum is approximately SHM only for small swing angles (below about 15 degrees), where sin θ ≈ θ. At large angles, the motion is still periodic but not simple harmonic, and the period becomes longer.
What is the total energy in SHM?
Total mechanical energy is E = ½kA², constant in ideal SHM. It converts between kinetic energy (½mv²) and potential energy (½kx²) as the object oscillates.
How is SHM related to circular motion?
SHM is the projection of uniform circular motion onto one axis. A peg on a rotating turntable, viewed from the side, moves in simple harmonic motion with amplitude equal to the circle’s radius.
What is the difference between SHM and uniform circular motion?
Uniform circular motion is motion around a circle at constant speed; SHM is back-and-forth motion along a line. The two are linked by projection: SHM is what circular motion looks like from the side.
Can SHM occur in electrical circuits?
Yes. In an LC circuit, charge oscillates between a capacitor and an inductor following the same equation as mechanical SHM, with frequency f = 1/(2π√(LC)). This is the basis of radio tuning.
What causes simple harmonic motion?
Any restoring force proportional to displacement causes SHM. Springs provide it via Hooke’s law; pendulums approximate it for small angles; buoyancy, torsion, and electromagnetic forces provide it in other systems.
How do you calculate the time period of SHM?
For a spring system, T = 2π√(m/k). For a pendulum, T = 2π√(L/g). In general, find ω from the system’s force law (ω² = k_effective/m) and use T = 2π/ω.
What is the maximum acceleration in SHM?
Maximum acceleration is a_max = Aω², occurring at the extremes of motion. It can also be written as a_max = (k/m)A for a spring system.
References and Further Reading
- Khan Academy, “Simple harmonic motion” — khanacademy.org/science/physics/mechanical-waves-and-sound
- HyperPhysics, Georgia State University, “Simple Harmonic Motion” — hyperphysics.phy-astr.gsu.edu/hbase/shm.html
- OpenStax University Physics, “Simple Harmonic Motion” — openstax.org/details/books/university-physics-volume-1
- MIT OpenCourseWare, “Simple Harmonic Motion” — ocw.mit.edu
- Encyclopaedia Britannica, “Simple harmonic motion” — britannica.com/science/simple-harmonic-motion