Two systems show up again and again as textbook examples of SHM: a block attached to a spring and a simple pendulum. Both produce a restoring force proportional to displacement, so both oscillate harmonically (for small displacements in the pendulum's case).
Spring–mass system. A mass $m$ attached to a spring of force constant $k$ obeys Hooke's law, $F=-kx$. Comparing with $F=-m\omega^2 x$ gives $\omega^2=\frac{k}{m}$, so $\omega=\sqrt{\frac{k}{m}}$ and the time period is $T=2\pi\sqrt{\frac{m}{k}}$. Notice that $T$ increases with mass and decreases with stiffness, and — importantly — the period of an ideal spring–mass oscillator is independent of $g$, so it would be the same on the Moon as on Earth.
- Springs in series: the effective force constant is smaller, $\frac{1}{k_s}=\frac{1}{k_1}+\frac{1}{k_2}$. For two identical springs of constant $k$, $k_s=\frac{k}{2}$ — the combination is softer, so the period is longer.
- Springs in parallel: the effective force constant adds, $k_p=k_1+k_2$. For two identical springs, $k_p=2k$ — the combination is stiffer, so the period is shorter.
Simple pendulum. A point mass (bob) on a light inextensible string of length $L$, displaced by a small angle, experiences a restoring force $-mg\sin\theta\approx -mg\theta$ (using the small-angle approximation $\sin\theta\approx\theta$ for $\theta$ in radians, valid for angles up to roughly $10^\circ$). This leads to SHM with $\omega=\sqrt{\frac{g}{L}}$ and time period $T=2\pi\sqrt{\frac{L}{g}}$. The period depends only on the length and on $g$ — it is independent of the mass of the bob and of the amplitude (for small swings). A longer pendulum, or a place with smaller $g$, swings more slowly.
Damped oscillations. Real oscillators lose energy to friction and air resistance. A damping force proportional to velocity, $F_d=-bv$, causes the amplitude to decay exponentially with time, $A(t)=A_0 e^{-bt/2m}$, while the frequency shifts slightly below the natural value. Light damping gives a slow ring-down; heavy damping (over-damping) returns the system to rest without oscillating.
Forced oscillations and resonance. If an external periodic force of frequency $\omega_d$ drives the oscillator, the system settles into steady oscillation at the driving frequency. When the driving frequency matches the system's natural frequency ($\omega_d\approx\omega_0$), the amplitude grows very large — this is resonance. Resonance explains why a pushed swing builds up, why soldiers break step on bridges, and how radios tune in. The less damped the system, the taller and narrower the resonance peak.