A harmonic oscillator is a physical or mathematical system whose displacement from equilibrium produces a restoring influence proportional to that displacement. In its simplest mechanical form, a mass attached to an ideal spring obeys , where is the mass, the displacement, and the spring constant. The resulting motion is sinusoidal, with a frequency independent of amplitude. The term also encompasses analogous electrical systems and, with appropriate qualifications, oscillators subject to damping or external driving.
The harmonic oscillator is central to classical mechanics, quantum mechanics, and the theory of waves because many systems behave approximately harmonically near stable equilibrium. Vibrating molecules, mechanical resonators, electrical circuits, and the independent modes of an electromagnetic field can all be described using closely related equations. Its importance therefore extends beyond any particular apparatus: it provides an exactly solvable reference model against which dissipation, coupling, thermal fluctuations, and nonlinear effects can be measured.
Definition, origins, and the harmonic approximation
The defining property of a simple harmonic oscillator is a linear restoring force:
The minus sign indicates that the force points toward the equilibrium position . For an ideal spring, this relation is Hooke’s law, published by Robert Hooke in 1678. Together with Newton’s laws of motion, it yields the standard oscillator equation. The same mathematical structure applies when the coordinate is an angle, an electrical charge, or another generalized displacement, rather than a distance.
The harmonic model emerged from several strands of early modern mechanics. Galileo Galilei investigated pendulum motion and its approximate independence of period from amplitude. Christiaan Huygens’s Horologium Oscillatorium, published in 1673, developed pendulum theory and distinguished the circular pendulum from the exactly isochronous cycloidal pendulum. Isaac Newton incorporated oscillatory motion into the framework of dynamics in the Principia of 1687. These developments connected timekeeping, mathematical descriptions of periodic motion, and the mechanics of restoring forces.
The model’s broad applicability follows from the local shape of potential energy. For a smooth potential near an equilibrium , write . A Taylor expansion gives
At equilibrium, . If , the leading displacement-dependent term is quadratic, and
The effective stiffness is therefore . The harmonic approximation is valid when higher-order terms remain small over the range of motion being considered.
A stable equilibrium is not, by itself, sufficient to guarantee a harmonic leading approximation. For example, a potential proportional to has a stable minimum but zero quadratic curvature there. Conversely, negative curvature produces exponential departure from equilibrium rather than oscillation. In systems with several coordinates, stability depends on the curvature in every independent direction. These distinctions explain why harmonic behavior is widespread but not universal: it requires a suitable local minimum, an appropriate inertial response, and amplitudes small enough that linearization remains accurate.
Free motion, energy, and phase-space geometry
For an undamped oscillator with constant mass and stiffness,
Its natural angular frequency is
and its general real solution is
The amplitude and phase are determined by the initial displacement and velocity. The ordinary frequency is , and the period is . Angular frequency is conventionally expressed in radians per second, whereas ordinary frequency is expressed in hertz. Confusing these quantities introduces a factor of .
Velocity and acceleration follow directly:
Velocity has its greatest magnitude at equilibrium and vanishes at the turning points. Acceleration has the opposite pattern: its magnitude is greatest at the turning points and zero at equilibrium. A defining feature of the ideal oscillator is that changing does not change . This amplitude independence, or isochronism, is only approximate in most physical devices.
The conserved mechanical energy is
It alternates between kinetic energy and elastic potential energy. Averaged over a complete cycle, each contribution equals . The instantaneous exchange is reversible: an ideal oscillator does not consume energy merely because it is moving. Energy must be supplied continuously only if losses are present or if the motion is otherwise altered by external interactions.
In phase space, using position and momentum , a trajectory of fixed energy satisfies
This is an ellipse, becoming a circle after suitable rescaling of the axes. The Hamiltonian is the same quadratic expression, and the Lagrangian is
These formulations make the oscillator a basic example in analytical mechanics. Its action variable,
is especially useful when parameters vary slowly: under appropriate adiabatic conditions, , rather than energy itself, is approximately conserved. If the stiffness slowly increases, the frequency and energy can rise while this action remains nearly unchanged.
Damping and the loss of mechanical energy
Real oscillators exchange energy with their surroundings. A common approximation represents the resisting force as proportional to velocity:
where is a damping coefficient. This model of damping describes viscous drag at sufficiently low speeds and approximates many electrical and mechanical losses over limited frequency ranges. Defining
the characteristic exponents are
Their form determines whether displacement oscillates while returning toward equilibrium.
For underdamping, , the displacement is
The envelope decays exponentially, and the damped frequency is lower than the undamped natural frequency. At critical damping, , the solution is . For overdamping, , it is a sum of two decaying exponentials. Critical damping marks the boundary between oscillatory and nonoscillatory relaxation for this linear model; whether a particular trajectory crosses equilibrium also depends on its initial conditions.
The exact rate of change of mechanical energy is
Energy therefore never increases in the unforced system. In weak damping, the energy averaged over the rapid oscillation decays approximately as . This differs from the amplitude envelope, which decays as . The distinction is important in interpreting ring-down measurements, because an energy decay time is half the corresponding amplitude decay time.
A useful measure of weak damping is the quality factor,
For a lightly damped oscillator it is approximately times the stored energy divided by the energy lost per cycle. A large means that oscillations persist for many periods and that the frequency response is narrow. Nevertheless, constant viscous damping is not a universal loss law. Dry friction, fluid turbulence, material hysteresis, radiation, and coupling to other modes can produce nonexponential decay or frequency-dependent damping. Consequently, a measured quality factor characterizes an operating regime as well as a device, and a single coefficient may not describe all amplitudes, temperatures, or frequencies.
Periodic forcing and resonance
An oscillator driven by a sinusoidal force satisfies
Its motion is the sum of a transient solution and a forced solution. With positive damping, the transient decays, leaving a steady response at the driving frequency:
The displacement amplitude is
and the phase lag is specified by
The two-argument arctangent places the phase in the correct quadrant.
At low frequency, inertia is relatively unimportant and displacement is nearly in phase with the force. Near the natural frequency, the response becomes large and its phase changes rapidly. At , displacement lags the force by , so velocity is in phase with the force. Far above the natural frequency, inertia dominates and displacement approaches opposition of phase with the driving force. This frequency-dependent enhancement is resonance, although the precise resonant frequency depends on which response is being measured.
For displacement amplitude, the maximum occurs at
provided . Stronger damping removes the nonzero-frequency displacement peak. By contrast, with frequency-independent and constant force amplitude, the average power absorbed is
and its maximum occurs at . Thus “the resonance frequency” is not always a unique observable. In the weak-damping limit these distinctions become small, and the half-power angular-frequency bandwidth is approximately .
Without damping, a force exactly at produces a growing term
in addition to the free motion. The ideal model has no finite steady resonant amplitude. Physical systems eventually depart from this prediction through losses, nonlinear response, finite drive power, or structural limits. More generally, linear response allows an arbitrary drive to be decomposed into frequency components using the superposition principle. The complex susceptibility
for an convention gives both amplitude and phase. The same function describes filtering, transient response, and the way oscillators exchange energy with broadband disturbances.
Coupled oscillators and normal modes
When several oscillators interact, their coordinates need not oscillate independently. For small displacements about equilibrium, a conservative system can be written
where is the mass matrix and the stiffness matrix. A solution of the form requires
This generalized eigenvalue problem determines the frequencies and displacement patterns of the normal modes. For positive-definite mass and stiffness matrices, the squared frequencies are positive and the motion can be expressed as a superposition of independent harmonic modes.
Consider two equal masses, each attached to a fixed support by a spring of stiffness , and joined by another spring of stiffness . Their equations are
In the symmetric mode, , the joining spring is not stretched and the frequency is . In the antisymmetric mode, , the frequency is . An initial displacement of only one mass excites both modes. When their frequencies are close, their superposition produces beats and an alternating concentration of energy in the two masses.
For extended systems, the same idea connects oscillators to waves. A one-dimensional chain of identical masses , separated by lattice spacing and joined by springs of stiffness , has the dispersion relation
At long wavelengths, , frequency is approximately proportional to wave number, giving sound-like propagation. At shorter wavelengths the discrete structure matters. Quantizing the normal modes of a crystal produces phonons, the elementary excitations used to describe lattice vibrations in condensed-matter physics.
Normal-mode analysis also explains the organization of molecular vibrations. A free nonlinear molecule containing atoms has vibrational modes; a linear molecule has , after rigid translations and rotations are excluded. Modes are collective motions, not necessarily vibrations of a single isolated bond. In continuous systems, such as strings, membranes, or elastic solids, mode shapes solve differential eigenvalue equations rather than finite matrix equations. Boundary conditions determine the allowed frequencies. Coupling therefore does not invalidate the harmonic description: for a stable linear conservative system it changes the independent coordinates from individual displacements to collective patterns.
Mechanical, electrical, and electromagnetic realizations
The mass–spring oscillator is the simplest realization, but many mechanical systems have the same local dynamics. For a pendulum of length in a uniform gravitational field,
When , replacing by gives . Its period is then independent of the bob’s mass. A torsional oscillator instead obeys , where is the moment of inertia and is torsional stiffness. Such systems turn small torques into measurable angular displacements.
An ideal electrical circuit containing an inductor and capacitor obeys
where is capacitor charge. The corresponding energy is
Here inductance plays the role of mass, inverse capacitance plays the role of stiffness, and electric current corresponds to velocity. A series electrical resistance adds , exactly analogous to viscous damping. The oscillation exchanges energy between an electric field and a magnetic field, rather than between mechanical motion and spring deformation.
In electromagnetism, the field inside an ideal cavity can be decomposed into independent spatial modes. Each mode has a time-dependent amplitude satisfying a harmonic-oscillator equation. Quantization assigns discrete excitations to these modes, identified as photons. This construction explains why oscillator mathematics appears in both classical resonators and quantum electrodynamics. A real cavity loses energy through absorption and leakage, introducing finite linewidths and decay times.
Practical resonators include quartz timing elements, vibrating beams, tuning forks, and microfabricated cantilevers. Quartz devices use piezoelectric coupling to connect mechanical strain with an electrical signal. Their useful resonance requires an elastic mode, suitable geometry, and controlled coupling to the external circuit; it is not simply the frequency of an isolated atom. Small cantilevers can register additional attached mass through a resonance-frequency shift. If stiffness remains unchanged and an effective modal mass changes by a small amount,
Actual interpretation requires the location and spatial distribution of the added mass, because different parts of a mode contribute differently. Similar oscillator models describe vibration isolation and accelerometers, where the measurable displacement is the motion of a proof mass relative to its supporting frame.
Quantum states and quantized excitation
The quantum harmonic oscillator has the Hamiltonian operator
with , where is the reduced Planck constant. Solving the Schrödinger equation gives the discrete energies
Adjacent levels have equal spacing . This distinguishes the harmonic spectrum from many other bound-state spectra and makes it a particularly useful reference for more complicated quantum systems.
The ground state has nonzero zero-point energy . Its position-space wave function is Gaussian:
Its position and momentum uncertainties are
so , saturating the uncertainty principle. Zero-point energy does not mean that the ground state follows a classical trajectory. The ground-state probability distribution is stationary.
The algebraic solution introduces lowering and raising operators:
The Hamiltonian becomes
Acting with raises the excitation number by one, whereas lowers it. This language extends naturally to bosonic excitations in many-mode systems and to free quantum field theory, where the field is represented through oscillator-like modes. The interpretation of zero-point contributions in fields requires additional care and cannot be inferred solely from a single mechanical oscillator.
A coherent state is an eigenstate of . Its mean position and momentum execute classical harmonic motion while its Gaussian uncertainties remain constant. By contrast, an energy eigenstate has stationary probability density, even when its energy is large. Classical behavior therefore does not arise merely by assigning a large excitation number; the state and the observables being considered matter. Squeezed states redistribute uncertainty between position-like and momentum-like quadratures while respecting the uncertainty bound. These state families make the oscillator a central model for quantum optics, trapped-particle motion, and the boundary between quantum and classical descriptions.
Thermal equilibrium and fluctuations
In classical statistical mechanics, an oscillator in equilibrium at temperature has a probability density proportional to
where is the Boltzmann constant. The equipartition theorem assigns mean energy to each independent quadratic term. Consequently,
Thermal equilibrium therefore does not imply that the oscillator is motionless; it implies a stationary distribution of fluctuating states.
For the quantum oscillator, the canonical partition function is
The mean energy is
At high temperature, , this tends to the classical result. At low temperature, thermal excitation is suppressed and the mean energy approaches the zero-point value. The mean excitation number follows Bose–Einstein statistics with zero chemical potential.
The corresponding heat capacity of one mode is
It approaches at high temperature and falls toward zero at low temperature. In 1907, Albert Einstein used quantized oscillators to model the heat capacity of solids. His model treated atoms as independent oscillators with a single characteristic frequency. Peter Debye’s 1912 model instead incorporated a distribution of collective vibrational modes and obtained the low-temperature behavior of three-dimensional insulating crystals. Oscillator statistics also underlie the mode-by-mode description of blackbody radiation.
Thermal fluctuations and damping are linked rather than independent additions to dynamics. In a classical, memoryless approximation, a fluctuating oscillator satisfies
with
This is a form of the fluctuation–dissipation theorem: the environmental coupling that removes organized motion also supplies random forces. It connects oscillator theory to Brownian motion and sets thermal noise levels in sensitive instruments. At low temperatures or high frequencies, quantum noise and the frequency dependence of the environment require a more general treatment.
Spectroscopy, measurement, and parameter determination
The oscillator model gives a direct connection between measured frequencies and microscopic restoring forces. For an approximately isolated diatomic vibration,
where is the reduced mass. Replacing an atom with a heavier isotope generally lowers the vibrational frequency, provided the effective force constant changes little. Isotopic shifts therefore help identify vibrational assignments and distinguish mass effects from changes in bonding. For polyatomic molecules, the analogous analysis uses the mass-weighted curvature matrix of the molecular potential.
In infrared spectroscopy, the harmonic approximation gives a vibrational selection rule for an electric-dipole interaction linear in displacement. A mode must change the molecular electric dipole to be infrared active. In Raman spectroscopy, activity instead depends on a change in polarizability. These are distinct conditions: a mechanically allowed vibration need not appear in every kind of spectroscopy. Anharmonicity and higher-order dependence of the interaction on displacement permit additional transitions and shift the spectrum away from equally spaced harmonic levels.
Macroscopic oscillator parameters can be inferred from either free decay or driven response. In a ring-down experiment, an oscillator is excited and then allowed to decay. The oscillation period determines , while the ratio of successive amplitudes determines the logarithmic decrement:
For weak damping, . A driven frequency sweep instead measures the resonance curve and phase response. Fitting the full complex response often separates stiffness, inertia, damping, and background contributions more reliably than identifying the location of a single amplitude maximum.
Thermal motion provides another route to calibration. If displacement is measured in physical units and the mode is in classical thermal equilibrium, relates its variance to effective stiffness. Conversely, a known stiffness and temperature can calibrate displacement sensitivity. Such procedures depend on the definition of the measured mode coordinate, detector response, bandwidth, and subtraction of unrelated noise. Added sensors can themselves change the oscillator through loading or back-action. In precision metrology, frequency shifts caused by temperature, stress, amplitude, or environmental coupling must therefore be distinguished from the intended signal, with measurement uncertainty attached to the inferred parameters.
Anharmonicity, parametric excitation, and limits of the model
A harmonic potential is exactly quadratic. Real potentials usually contain higher-order terms:
These terms produce forces nonlinear in displacement. The approximation remains useful while their contributions are small relative to , but sufficiently large excursions alter the period, distort the waveform, and couple motions that were independent in the linear theory. The relevant criterion is not an absolute displacement: it is the displacement relative to the length scale over which the local curvature changes.
A widely used example is the Duffing equation,
For weak unforced nonlinearity, the frequency at amplitude is approximately
Positive produces hardening, with frequency increasing as amplitude grows; negative produces local softening. A negative quartic term alone does not define a globally confining potential, so stabilizing higher-order terms may be necessary outside the small-amplitude regime. Under driving, nonlinear resonators can exhibit bent resonance curves, multiple stable responses, and hysteresis.
For the circular pendulum, the first correction to the small-angle period is
with in radians. This provides a concrete limit to approximate isochronism. Molecular anharmonicity likewise reduces the equal-spacing pattern of the ideal quantum oscillator and allows a finite dissociation energy, which a purely quadratic potential cannot represent. In crystals, anharmonic mode coupling contributes to thermal expansion, finite phonon lifetimes, and the transport and redistribution of vibrational energy.
A different departure arises when parameters vary in time. If stiffness is modulated,
the equation has Mathieu-type behavior. Parametric resonance is strongest near , with additional instability regions at other frequency ratios. Energy is supplied by changing a system parameter rather than by applying an additive force. Damping creates a threshold for instability, and nonlinearities can limit the subsequent growth.
The oscillator description also fails when a small set of coordinates cannot represent the relevant dynamics, when environmental forces have long memory, or when fluctuations drive the system between distinct equilibria. Linearized models can still describe local motion within such systems, but their parameters and validity range must be specified. Weak nonlinearities may be treated with perturbation theory, whereas large-amplitude motion, strong mode coupling, and instability can require numerical dynamics or a different choice of physical model.