A mass on a spring is the simplest non-trivial mechanical system. Pull it from equilibrium, release it, and it oscillates back and forth in regular, predictable, sinusoidal motion. Galileo timed pendulums in the 1580s using his own pulse and noticed that the period was independent of amplitude. Robert Hooke (1660) wrote down F = −kx — the linear restoring force that defines the harmonic oscillator — in an anagram (ceiiinosssttuv) so he could establish priority without revealing the result. The deeper reason for the harmonic oscillator's ubiquity took two more centuries to articulate: every smooth potential, near a minimum, looks like a parabola; every system near equilibrium oscillates like a spring. The harmonic oscillator is the first non-trivial system in nearly every physics course because it is the first non-trivial system in nearly every physical situation.
The equation of motion is m·d²x/dt² = −k·x, where k > 0 is the spring constant and x is the displacement from equilibrium. The general solution is x(t) = A·cos(ωt + φ), where ω = √(k/m) is the angular frequency and A, φ are determined by initial conditions. The motion is periodic with period T = 2π/ω = 2π·√(m/k). Energy oscillates between kinetic and potential forms, with the total ½kA² constant. Damped oscillations: add friction (F_friction = −b·dx/dt); the equation becomes m·ẍ + b·ẋ + k·x = 0, with solutions that decay exponentially while oscillating. Driven oscillations: add a periodic forcing term and the system resonates at frequencies near ω₀, with amplitude inversely proportional to damping at exact resonance. Resonance is responsible for the Tacoma Narrows Bridge collapse (1940), radio tuning, the way a child pumps a swing, and the destruction of wine glasses by sound at the right pitch. Coupled harmonic oscillators (multiple masses connected by springs) decompose into normal modes — independent oscillations at characteristic frequencies — by diagonalizing the coupling matrix. Continuous systems (vibrating strings, drumheads, sound waves in air, light in vacuum) are limits of infinitely-many coupled oscillators; their normal modes are the Fourier components that decompose any oscillation into a sum of sinusoids. Quantum harmonic oscillator: replace the classical equation with the Schrödinger version, and the energy levels become quantized — Eₙ = (n + ½)·ℏω for n = 0, 1, 2, …, including a zero-point energy of ½ℏω at the ground state. Quantum field theory treats every field as a continuum of harmonic oscillators, one per momentum mode, whose quantized excitations are the particles of the theory. The harmonic oscillator is the most-solved equation in physics — solved exactly in classical mechanics, exactly in quantum mechanics, exactly in quantum field theory, and approximately in nearly every regime where solutions are wanted.
Mechanical engineering designs around oscillator dynamics in nearly every product that moves: vehicle suspensions, building dampers (the tuned mass damper at the top of Taipei 101 prevents earthquake oscillation), MEMS resonators (in every smartphone accelerometer and gyroscope), quartz crystal oscillators (the heart of every electronic clock and timing system), atomic clocks (which use atomic transitions as ultra-stable harmonic oscillators). Lasers are coherent harmonic oscillators of light. Music is harmonic oscillators in air. Quantum computing with trapped ions uses the trapped-ion harmonic-oscillator modes for two-qubit gate operations. Gravitational-wave detection (LIGO, Virgo) uses suspended-mass interferometers as the most sensitive harmonic oscillators ever built. The little equation Hooke encrypted as an anagram is, in retrospect, the master equation of nearly every measurement device humans have built.