Harmonic oscillator basics
The harmonic oscillator is one of the most important models in all of physics. Any system sitting near a stable equilibrium can be approximated as a harmonic oscillator (since any smooth potential looks parabolic near its minimum), which is why this model shows up everywhere in statistical mechanics.
Simple harmonic motion
Simple harmonic motion occurs whenever a restoring force is proportional to displacement from equilibrium. Hooke's law captures this:
where is the spring constant and is displacement from equilibrium. The motion is sinusoidal with constant amplitude and frequency. Classic examples include a mass on a spring and a pendulum at small angles.
Potential energy function
The potential energy for a harmonic oscillator has a quadratic form:
This traces out a parabola on a vs. graph, with the minimum at the equilibrium position (). The restoring force follows directly from the potential: . The quadratic shape is the key feature. Any potential that's approximately quadratic near its minimum will produce harmonic-oscillator-like behavior.
Equation of motion
Combining Newton's second law () with Hooke's law gives:
where the angular frequency is . This relates to the ordinary frequency by . The general solution is sinusoidal:
where is the amplitude and is the phase, both set by initial conditions.
Mathematical description
Differential equation
The harmonic oscillator equation is a second-order linear ODE. Because it's linear, superposition applies: any linear combination of solutions is also a solution. This property becomes crucial when you move to coupled oscillators and normal modes.
General solution
The standard solution is:
An equivalent form uses complex exponentials: . The complex form is often more convenient for calculations, especially with driven oscillators. The velocity follows by differentiation:
Initial conditions (starting position and velocity) pin down and .
Phase space representation
Phase space plots position on one axis and momentum on the other. For a simple harmonic oscillator, the trajectory in phase space is an ellipse (or a circle if you scale the axes appropriately). The system traces this closed curve repeatedly, and the area enclosed is proportional to the total energy. Phase space is central to statistical mechanics because Liouville's theorem governs how probability distributions evolve in it.
Energy considerations
Kinetic vs. potential energy
- Kinetic energy:
- Potential energy:
Energy sloshes back and forth between these two forms during oscillation. At the equilibrium position (), all the energy is kinetic. At maximum displacement (), all the energy is potential.
Total energy conservation
For an ideal (undamped) oscillator, the total energy is constant:
This follows directly from energy conservation: what's lost in kinetic energy at the turning points is gained in potential energy, and vice versa. The total energy depends only on the amplitude, not on where the oscillator is in its cycle.
Virial theorem application
For the harmonic oscillator specifically, the virial theorem states that the time-averaged kinetic and potential energies are equal:
This result is extremely useful in statistical mechanics. When you combine it with the equipartition theorem, you can immediately read off that each quadratic term in the Hamiltonian contributes to the average energy.
Classical vs. quantum oscillators
Understanding where classical mechanics breaks down is essential for knowing when your statistical mechanics results are trustworthy.
Key differences
- A classical oscillator can have any energy, continuously. A quantum oscillator is restricted to discrete levels: .
- A classical oscillator can sit perfectly still at with zero energy. A quantum oscillator always has a ground-state energy of (zero-point energy).
- The quantum oscillator exhibits wave-like behavior and obeys the uncertainty principle, so it can never have simultaneously well-defined position and momentum.

Correspondence principle
Quantum mechanics reduces to classical mechanics for large quantum numbers. When is large, the spacing between energy levels () becomes negligible compared to the total energy, and the quantum probability distribution for position starts to resemble the classical one (which peaks near the turning points where the oscillator moves slowly).
Energy level comparisons
The critical comparison for statistical mechanics is between the thermal energy scale and the quantum energy scale:
- When (high temperature), many energy levels are thermally accessible, and the classical treatment works well.
- When (low temperature), only the lowest few levels matter, and you must use the quantum treatment.
The crossover temperature is roughly . For most macroscopic mechanical oscillators, is absurdly low, so classical mechanics is fine. For molecular vibrations, can be hundreds or thousands of kelvin.
Damped harmonic oscillators
Real oscillators lose energy to their surroundings. Damping introduces irreversibility, which connects directly to how systems approach thermal equilibrium.
Damping force introduction
A simple model adds a velocity-dependent drag force , where is the damping coefficient. The equation of motion becomes:
The result is oscillations whose amplitude decays exponentially over time.
Types of damping
The behavior depends on the damping ratio :
- Underdamped (): The system oscillates with exponentially decaying amplitude. Most physical oscillators fall here.
- Critically damped (): The system returns to equilibrium as fast as possible without oscillating. This is the design target for things like door closers and shock absorbers.
- Overdamped (): The system creeps back to equilibrium slowly, with no oscillation at all.
Decay time and Q factor
- The decay time sets the timescale over which oscillations die out.
- The quality factor measures how many radians the oscillator swings through before its energy drops significantly. High means low damping and long-lived oscillations. Specifically, the oscillator loses roughly a fraction of its stored energy per cycle.
Driven harmonic oscillators
Adding an external time-dependent force models how systems absorb energy from their environment, which is directly relevant to how oscillators reach steady states in statistical mechanics.
Forcing function
A sinusoidal driving force gives:
After transients die out, the system settles into a steady-state oscillation at the driving frequency (not the natural frequency ).
Resonance phenomenon
Resonance occurs when the driving frequency approaches the natural frequency of the oscillator. At resonance, energy transfer from the driving force is maximally efficient, and the amplitude peaks. For a damped oscillator, the resonance frequency is slightly shifted:
The peak amplitude at resonance is limited by damping. Lower damping (higher ) means a sharper, taller resonance peak.
Frequency response
- The amplitude response curve shows a peak near , with a width inversely proportional to .
- The phase lag between the driving force and the oscillator's response shifts from near 0 (well below resonance) to (at resonance) to (well above resonance).
- The bandwidth of the resonance peak is approximately .
Coupled oscillators
When multiple oscillators interact, new collective behaviors emerge. This is the starting point for understanding phonons in solids and other many-body phenomena.
Normal modes
Normal modes are the independent oscillation patterns of a coupled system. Each mode has its own characteristic frequency and shape. The number of normal modes equals the number of degrees of freedom. Any general motion of the system can be written as a superposition of these normal modes, which is what makes them so powerful: they decouple the problem.
Energy transfer between oscillators
Coupling allows energy to flow between oscillators. The rate of transfer depends on the coupling strength and how close the oscillators' natural frequencies are. When two oscillators are weakly coupled and nearly resonant, energy can slosh back and forth periodically between them. In a large system of coupled oscillators, this energy redistribution is the microscopic mechanism behind thermalization.

Beating phenomenon
When two oscillations with slightly different frequencies and are superposed, the result is an oscillation at the average frequency with an amplitude that modulates at the beat frequency:
Beats are easily observed in coupled oscillators and provide a sensitive way to measure small frequency differences.
Statistical mechanics applications
This is where harmonic oscillators connect to thermodynamics. The simplicity of the harmonic oscillator Hamiltonian makes exact calculations possible, which is rare in statistical mechanics.
Equipartition theorem
The equipartition theorem states that each quadratic term in the Hamiltonian contributes to the average energy in thermal equilibrium. A one-dimensional harmonic oscillator has two quadratic terms (one kinetic, one potential), so:
This is a purely classical result. It holds when but fails at low temperatures where quantum effects freeze out degrees of freedom.
Boltzmann distribution
The probability of a classical oscillator having energy is given by the Boltzmann factor:
For a quantum oscillator, the probability of occupying the th level is . These distributions are the starting point for computing all thermodynamic averages and deriving the partition function.
Partition function derivation
The partition function sums (or integrates) over all accessible states:
- Classical: , where the factor of ensures correct dimensionless counting. For a 1D harmonic oscillator, this evaluates to .
- Quantum:
Once you have , all thermodynamic quantities follow. The Helmholtz free energy is .
Thermodynamic properties
Heat capacity calculations
The heat capacity at constant volume is:
For a classical oscillator, , so per oscillator. This is the basis of the Dulong-Petit law: a solid with atoms (each modeled as 3 independent oscillators) has .
At low temperatures, quantum effects suppress the heat capacity. The Einstein model (all oscillators at one frequency) captures the exponential freeze-out. The Debye model (a spectrum of frequencies) gives the more accurate behavior at low .
Entropy considerations
Entropy can be computed from the partition function via . For a classical oscillator, entropy increases logarithmically with temperature. For a quantum oscillator, entropy approaches zero as , consistent with the Third Law of Thermodynamics. The contrast between these two behaviors is another way to see where the classical approximation breaks down.
Free energy analysis
The Helmholtz free energy is the central thermodynamic potential for systems at constant temperature and volume. From , you can derive:
- Entropy:
- Internal energy:
- Pressure:
For systems at constant pressure, the Gibbs free energy is the relevant quantity. Equilibrium states minimize the appropriate free energy.
Experimental relevance
Mechanical systems examples
- Seismographs use mass-spring systems to detect ground motion; the instrument's response depends on its natural frequency and damping.
- Atomic force microscopy (AFM) measures forces at the nanoscale by monitoring the oscillation of a tiny cantilever, where shifts in frequency or amplitude reveal surface properties.
- Torsional pendulums appear in magnetometers and precision measurements of gravitational constants.
Electrical circuit analogies
The analogy between mechanical and electrical oscillators is exact: an LC circuit behaves as an undamped harmonic oscillator (with and ), while an RLC circuit models a damped or driven oscillator (with ). Quartz crystal oscillators exploit the mechanical resonance of a piezoelectric crystal to achieve extremely stable frequencies for timekeeping.
Spectroscopy applications
Molecular vibrations are well-approximated as harmonic oscillators near equilibrium. Infrared spectroscopy probes these vibrations directly by measuring which frequencies a molecule absorbs. Raman spectroscopy detects vibrational frequencies through inelastic light scattering. The harmonic model predicts equally spaced vibrational energy levels; deviations from equal spacing reveal anharmonic corrections, which carry information about bond dissociation and molecular geometry.