---
title: Mechanical and Electrical Vibrations
module: Second-Order Linear Equations
moduleNumber: 3
lessonNumber: 5
order: 305
summary: >
  A spring-mass-damper obeys a second-order linear equation, and so does a
  series RLC circuit, with the same mathematics governing both. Free undamped
  motion is a pure sinusoid; damping adds a decaying envelope with three regimes;
  periodic forcing produces a transient that dies out and a steady-state
  oscillation whose amplitude peaks sharply near the natural frequency, the
  phenomenon of resonance.
topics: [Second-Order Linear Equations]
draft: false
sources:
  - book: Boyce
    ref: "Ch. 3 — §3.7 Mechanical and Electrical Vibrations; §3.8 Forced Periodic Vibrations"
  - book: Simmons
    ref: "Ch. 3 §20 Vibrations in Mechanical and Electrical Systems"
---

The constant-coefficient second-order equation models oscillation. A mass on a
spring, a pendulum at small amplitude, the current in a radio tuning circuit,
and the sway of a bridge all obey the same equation. Newton's law for a
spring-mass-damper produces it; the discriminant of its characteristic equation
splits free motion into the undamped, underdamped, critically damped, and
overdamped regimes; a periodic driving force exposes resonance; and a series RLC
circuit satisfies an identical equation, so every mechanical result transfers to
circuits by relabeling the constants.

## The spring-mass-damper equation

Consider a mass $m$ on a spring, displaced $u(t)$ from equilibrium (positive
downward). Four forces act on it.

- **Gravity** $w = mg$, downward and constant.
- **Spring force** $F_s = -k(L + u)$ by Hooke's law, where $L$ is the static
  stretch and $k > 0$ the spring constant; it always restores toward the natural
  length.
- **Damping force** $F_d = -\gamma u'$, opposing the velocity, with damping
  constant $\gamma > 0$ (viscous damping from a dashpot, air resistance, or
  internal friction).
- **External force** $F(t)$, an applied or driving force.

At equilibrium the mass hangs at rest, so $mg - kL = 0$. Newton's law
$m u'' = w + F_s + F_d + F$ then simplifies, since the constant gravity and
static-stretch terms cancel, to the **equation of motion**

$$
m u'' + \gamma u' + k u = F(t), \tag{M}
$$

a second-order linear constant-coefficient equation, with initial conditions
$u(0) = u_0$ (initial position) and $u'(0) = v_0$ (initial velocity).

$$
% caption: Spring-mass-damper: the spring pulls back with $-ku$, the dashpot
% resists motion with $-\gamma u'$, and any drive $F(t)$ acts on the mass $m$.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{2A6F97}
  % ceiling
  \draw[thick] (-1.4,3.2) -- (2.6,3.2);
  \foreach \x in {-1.2,-0.8,-0.4,0.0,0.4,0.8,1.2,1.6,2.0,2.4}
    \draw[black] (\x,3.2) -- (\x-0.22,3.44);
  % spring (left)
  \draw[black!70, thick] (0,3.2) -- (0,2.9)
    -- (-0.25,2.75) -- (0.25,2.55) -- (-0.25,2.35) -- (0.25,2.15)
    -- (-0.25,1.95) -- (0.25,1.75) -- (0,1.6) -- (0,1.35);
  \node[black, anchor=east, font=\scriptsize] at (-0.28,2.4) {spring $k$};
  % dashpot (right)
  \draw[black!70, thick] (1.2,3.2) -- (1.2,2.6);
  \draw[black!70, thick] (0.95,2.6) rectangle (1.45,2.05);
  \draw[black!70, thick, fill=black!12] (0.98,2.5) rectangle (1.42,2.28);
  \draw[black!70, thick] (1.2,2.28) -- (1.2,1.35);
  \node[black, anchor=west, font=\scriptsize] at (1.5,2.35) {dashpot};
  % mass
  \draw[thick, fill=black!8] (-0.5,0.55) rectangle (1.7,1.35);
  \node at (0.6,0.95) {mass $m$};
  % displacement arrow
  \draw[->, thick] (2.2,0.95) -- (2.2,0.1);
  \node[anchor=west, font=\scriptsize] at (2.25,0.5) {$u(t)$};
  % force labels
  \draw[->, black!70, thick] (0.6,0.5) -- (0.6,-0.4);
  \node[black!70, anchor=north, font=\scriptsize] at (0.6,-0.4) {drive $F(t)$};
\end{tikzpicture}
$$

## Free undamped vibration

With no drive and no damping ($F = 0$, $\gamma = 0$), equation (M) is
$m u'' + k u = 0$. The characteristic roots are purely imaginary
$r = \pm i\omega_0$, where

$$
\omega_0 = \sqrt{\frac{k}{m}}
$$

is the **natural frequency**. The general solution is
$u = A\cos(\omega_0 t) + B\sin(\omega_0 t)$, which can be written as a single
shifted cosine

$$
u = R\cos(\omega_0 t - \delta), \qquad R = \sqrt{A^2 + B^2}, \quad
\tan\delta = \frac{B}{A}.
$$

> **Definition (Amplitude, phase, period).** In $u = R\cos(\omega_0 t - \delta)$,
> $R$ is the **amplitude** (peak displacement), $\delta$ the **phase** (time
> shift of the peak), and $T = 2\pi/\omega_0$ the **period**. The motion is
> **simple harmonic**: a fixed-amplitude sinusoid repeating forever, since
> nothing dissipates its energy.

Only the amplitude and phase depend on initial conditions; the frequency
$\omega_0$ is set by the physical constants $k$ and $m$ alone. A stiffer spring
or a lighter mass oscillates faster.

## Free damped vibration

Restore damping ($\gamma > 0$, still $F = 0$): $m u'' + \gamma u' + k u = 0$,
with characteristic roots

$$
r = \frac{-\gamma \pm \sqrt{\gamma^2 - 4km}}{2m}.
$$

Because $\gamma, k, m > 0$, both roots have negative real part, so every solution
decays to zero: damping dissipates the energy and the motion dies out. The
discriminant $\gamma^2 - 4km$ splits the behavior into three regimes.

- **Underdamped** ($\gamma^2 < 4km$): complex roots, so
  $u = R e^{-\gamma t/(2m)}\cos(\mu t - \delta)$ with
  $\mu = \sqrt{4km - \gamma^2}/(2m)$. The motion oscillates inside a decaying
  envelope $\pm R e^{-\gamma t/(2m)}$.
- **Critically damped** ($\gamma^2 = 4km$): a repeated real root, so
  $u = (A + Bt)e^{-\gamma t/(2m)}$. The fastest return to equilibrium without
  oscillating.
- **Overdamped** ($\gamma^2 > 4km$): two distinct negative real roots, so
  $u = A e^{r_1 t} + B e^{r_2 t}$. The mass creeps back to equilibrium without
  oscillating, more slowly than critical.

In the underdamped case the motion is not periodic (the envelope shrinks), but
$\mu$ still sets the spacing of the peaks. It is called the **quasi-frequency**
and $T_d = 2\pi/\mu$ the **quasi-period**. Comparing to the undamped frequency,

$$
\frac{\mu}{\omega_0} = \sqrt{1 - \frac{\gamma^2}{4km}} \approx 1 - \frac{\gamma^2}{8km}
$$

for small damping, so light damping lowers the frequency only slightly while
still forcing the amplitude to decay. The controlling quantity is the
dimensionless ratio $\gamma^2/(4km)$, not $\gamma$ alone; whether damping is
"large" or "small" is judged against $4km$.

$$
% caption: Underdamped free motion: an oscillation at the quasi-frequency
% trapped inside the decaying envelope set by the damping term.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{2A6F97}
  \draw[->, thick] (-0.3,0) -- (6.4,0) node[right] {$t$};
  \draw[->, thick] (0,-2.2) -- (0,2.4) node[above] {$u$};
  % envelopes
  \draw[black, dashed, thick] (0,2.0) .. controls (1.6,1.25) and (3.2,0.75) .. (6.2,0.32);
  \draw[black, dashed, thick] (0,-2.0) .. controls (1.6,-1.25) and (3.2,-0.75) .. (6.2,-0.32);
  \node[black, anchor=south west, font=\scriptsize] at (4.2,0.36) {decaying envelope};
  % oscillation
  \draw[acc, very thick]
    (0,2.0) .. controls (0.5,1.55) and (0.72,0.0) .. (1.05,-1.5)
    .. controls (1.32,-1.28) and (1.58,-0.1) .. (1.95,1.15)
    .. controls (2.22,1.08) and (2.48,0.1) .. (2.85,-0.92)
    .. controls (3.12,-0.86) and (3.38,-0.05) .. (3.75,0.72)
    .. controls (4.05,0.68) and (4.32,0.05) .. (4.7,-0.55)
    .. controls (5.0,-0.52) and (5.28,-0.05) .. (5.65,0.42)
    .. controls (5.9,0.4) and (6.05,0.08) .. (6.2,-0.3);
\end{tikzpicture}
$$

> **Worked example (Underdamped spring-mass).** A spring-mass system obeys
> $u'' + \tfrac{1}{8}u' + u = 0$ ($u$ in feet, $t$ in seconds) with $u(0) = 2$,
> $u'(0) = 0$. The characteristic equation $r^2 + \tfrac{1}{8}r + 1 = 0$ has
> roots
> $$
> r = \frac{-\tfrac{1}{8} \pm \sqrt{\tfrac{1}{64} - 4}}{2}
>   = -\frac{1}{16} \pm i\,\frac{\sqrt{255}}{16},
> $$
> so damping is light and the motion is underdamped. The quasi-frequency is
> $\mu = \sqrt{255}/16 \approx 0.998$ and the quasi-period
> $T_d = 2\pi/\mu \approx 6.30$ s, both just under the undamped values
> $\omega_0 = 1$, $T = 2\pi$. Writing
> $u = e^{-t/16}\bigl(A\cos\mu t + B\sin\mu t\bigr)$ and imposing the data:
> $u(0) = A = 2$, and $u'(0) = -\tfrac{1}{16}A + \mu B = 0$ gives
> $B = A/(16\mu) = 2/\sqrt{255}$. Thus
> $$
> u = e^{-t/16}\left(2\cos\frac{\sqrt{255}}{16}t
>   + \frac{2}{\sqrt{255}}\sin\frac{\sqrt{255}}{16}t\right),
> $$
> an oscillation at $\mu \approx 0.998$ inside the decaying envelope
> $\pm R\,e^{-t/16}$.

## Forced vibration and resonance

Now drive the system with a periodic force $F(t) = F_0\cos(\omega t)$:

$$
m u'' + \gamma u' + k u = F_0\cos(\omega t). \tag{F}
$$

By the [nonhomogeneous structure](/differential-equations/second-order-linear/nonhomogeneous-undetermined-coefficients),
the solution is $u = u_c(t) + U(t)$. Since the roots of the damped homogeneous
equation have negative real part, $u_c \to 0$: it is the **transient**, present
only long enough to satisfy initial conditions. The particular solution
$U(t) = R\cos(\omega t - \delta)$ oscillates at the _driving_ frequency $\omega$
and persists; it is the **steady-state** or forced response.

> **Definition (Transient and steady state).** For a damped forced system, the
> **transient** $u_c$ is the decaying homogeneous part that vanishes as
> $t \to \infty$; the **steady state** $U$ is the particular solution that
> continues at the forcing frequency. After a few time constants the response is
> effectively $U$ alone.

Substituting $U = R\cos(\omega t - \delta)$ into (F) and solving for the
amplitude gives

$$
R = \frac{F_0}{\sqrt{m^2(\omega_0^2 - \omega^2)^2 + \gamma^2\omega^2}}, \qquad
\omega_0^2 = \frac{k}{m}.
$$

The amplitude depends strongly on how close the drive frequency $\omega$ is to
the natural frequency $\omega_0$. At low frequency ($\omega \to 0$) it
approaches the static deflection $F_0/k$; at high frequency ($\omega \to \infty$)
it falls to zero; in between it peaks. Setting $\d R/\d\omega = 0$ locates the peak
at

$$
\omega_{\max}^2 = \omega_0^2 - \frac{\gamma^2}{2m^2} = \omega_0^2\left(1 - \frac{\gamma^2}{2mk}\right),
$$

slightly below $\omega_0$, with maximum amplitude

$$
R_{\max} = \frac{F_0}{\gamma\omega_0\sqrt{1 - \gamma^2/(4mk)}} \approx \frac{F_0}{\gamma\omega_0}
$$

for small $\gamma$. As the damping shrinks, $R_{\max}$ grows without bound: a
lightly damped system driven near its natural frequency responds enormously to a
small force. This is **resonance**.

> **Definition (Resonance).** The sharp growth of steady-state amplitude when the
> forcing frequency $\omega$ approaches the natural frequency $\omega_0$ of a
> lightly damped system. The peak amplitude scales as $F_0/(\gamma\omega_0)$, so
> it is largest when damping $\gamma$ is smallest.

> **Worked example (Resonant amplification).** Take $m = 1$, $k = 1$
> (so $\omega_0 = 1$), light damping $\gamma = 0.2$, and drive amplitude
> $F_0 = 1$. The steady-state amplitude is
> $$
> R(\omega) = \frac{1}{\sqrt{(1 - \omega^2)^2 + 0.04\,\omega^2}}.
> $$
> At $\omega \to 0$ it is the static deflection $F_0/k = 1$. The peak sits at
> $$
> \omega_{\max} = \sqrt{\omega_0^2 - \tfrac{\gamma^2}{2m^2}}
>   = \sqrt{1 - 0.02} \approx 0.990,
> $$
> with
> $$
> R_{\max} = \frac{F_0}{\gamma\omega_0\sqrt{1 - \gamma^2/(4mk)}}
>   = \frac{1}{0.2\sqrt{0.99}} \approx 5.03.
> $$
> A drive of unit amplitude produces a response of amplitude $5.03$: a fivefold
> amplification, entirely a consequence of the small damping.

Resonance is a design concern in both directions. In structures (bridges,
buildings, machinery) it must be avoided or damped, because a modest periodic
input at the wrong frequency can drive destructive amplitudes. In instruments
(radio tuners, seismographs) it is exploited, using a sharp resonant peak to
select or amplify a weak signal at a chosen frequency.

$$
% caption: Steady-state amplitude versus forcing frequency: lighter damping
% gives a taller, narrower resonant peak just below the natural frequency.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{2A6F97}
  \draw[->, thick] (-0.2,0) -- (6.2,0) node[right] {forcing frequency};
  \draw[->, thick] (0,-0.2) -- (0,3.4) node[above] {amplitude $R$};
  % natural frequency marker
  \draw[black, dashed] (3.0,0) -- (3.0,3.2);
  \node[black, anchor=north, font=\scriptsize] at (3.0,-0.05) {natural freq.};
  % low damping: tall narrow peak
  \draw[acc, very thick] (0,0.85) .. controls (1.4,1.0) and (2.3,1.6) .. (2.85,3.05)
    .. controls (3.1,3.15) and (3.35,1.7) .. (3.9,0.95)
    .. controls (4.6,0.55) and (5.4,0.35) .. (6.0,0.25);
  \node[acc, anchor=west, font=\scriptsize] at (2.9,3.1) {small damping};
  % higher damping: low broad hump
  \draw[black, thick] (0,0.85) .. controls (1.4,0.95) and (2.4,1.15) .. (3.0,1.2)
    .. controls (3.8,1.12) and (4.8,0.7) .. (6.0,0.4);
  \node[black, anchor=west, font=\scriptsize] at (4.0,1.05) {large damping};
\end{tikzpicture}
$$

The transient-plus-steady-state split is visible in any driven solution: an
initial stretch where the decaying $u_c$ distorts the motion, settling into a
clean oscillation at the driving frequency.

$$
% caption: A driven damped solution: the transient decays away and the response
% converges to the steady-state oscillation at the forcing frequency.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{2A6F97}
  \draw[->, thick] (-0.3,0) -- (6.4,0) node[right] {$t$};
  \draw[->, thick] (0,-1.9) -- (0,2.3) node[above] {$u$};
  % steady state reference (dashed) small amplitude
  \draw[black, dashed, thick]
    (0,0.0) .. controls (0.35,0.9) and (0.7,0.9) .. (1.05,0.0)
    .. controls (1.4,-0.9) and (1.75,-0.9) .. (2.1,0.0)
    .. controls (2.45,0.9) and (2.8,0.9) .. (3.15,0.0)
    .. controls (3.5,-0.9) and (3.85,-0.9) .. (4.2,0.0)
    .. controls (4.55,0.9) and (4.9,0.9) .. (5.25,0.0)
    .. controls (5.6,-0.9) and (5.95,-0.9) .. (6.3,0.0);
  \node[black, anchor=south, font=\scriptsize] at (5.3,0.7) {steady state};
  % full solution: large early amplitude decaying to steady state
  \draw[acc, very thick]
    (0,1.9) .. controls (0.4,1.7) and (0.7,0.2) .. (1.05,-1.35)
    .. controls (1.4,-1.1) and (1.75,-0.2) .. (2.1,0.55)
    .. controls (2.45,1.1) and (2.8,1.05) .. (3.15,0.1)
    .. controls (3.5,-0.85) and (3.85,-0.9) .. (4.2,0.02)
    .. controls (4.55,0.88) and (4.9,0.9) .. (5.25,0.0)
    .. controls (5.6,-0.9) and (5.95,-0.88) .. (6.3,0.02);
\end{tikzpicture}
$$

## Beats

With no damping, a drive at a frequency $\omega$ near but not equal to
$\omega_0$ produces neither a decaying transient nor unbounded resonance, but
**beats**: a fast oscillation whose amplitude is itself slowly modulated.

> **Worked example (Beats).** Solve $u'' + u = \tfrac{1}{2}\cos(0.8t)$ with
> $u(0) = 0$, $u'(0) = 0$. Here $m = 1$, $\omega_0 = 1$, $\omega = 0.8$, and the
> zero-data solution is
> $$
> u = \frac{F_0}{m(\omega_0^2 - \omega^2)}\bigl(\cos\omega t - \cos\omega_0 t\bigr)
>   = \frac{0.5}{1 - 0.64}\bigl(\cos 0.8t - \cos t\bigr).
> $$
> The identity $\cos B - \cos A = 2\sin\tfrac{A+B}{2}\sin\tfrac{A-B}{2}$ with
> $A = t$, $B = 0.8t$ turns the difference into a product,
> $$
> u = 2.778\,\sin(0.1t)\,\sin(0.9t),
> $$
> a fast oscillation at frequency $0.9$ inside a slow envelope
> $\pm 2.778\sin(0.1t)$. The envelope swells and collapses with period
> $2\pi/0.1 = 20\pi$, one beat.

$$
% caption: Beats: the fast oscillation at frequency $0.9$ is trapped inside a
% slow envelope at frequency $0.1$ that swells to a maximum and collapses.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{2A6F97}
  \draw[->, thick] (-0.3,0) -- (6.9,0) node[right] {$t$};
  \draw[->, thick] (0,-2.1) -- (0,2.2) node[above] {$u$};
  \draw[black, dashed, thick]
    (0,0) .. controls (1.3,1.05) and (2.2,1.7) .. (3.2,1.72)
    .. controls (4.2,1.7) and (5.1,1.05) .. (6.4,0.02);
  \draw[black, dashed, thick]
    (0,0) .. controls (1.3,-1.05) and (2.2,-1.7) .. (3.2,-1.72)
    .. controls (4.2,-1.7) and (5.1,-1.05) .. (6.4,-0.02);
  \node[black, anchor=south west, font=\scriptsize] at (3.3,1.72) {slow envelope};
  \draw[acc, very thick]
    (0,0) .. controls (0.2,0.29) and (0.5,0.29) .. (0.68,0)
    .. controls (0.85,-0.8) and (1.15,-0.8) .. (1.33,0)
    .. controls (1.5,1.23) and (1.8,1.23) .. (1.98,0)
    .. controls (2.15,-1.54) and (2.45,-1.54) .. (2.63,0)
    .. controls (2.8,1.69) and (3.1,1.69) .. (3.28,0)
    .. controls (3.45,-1.67) and (3.75,-1.67) .. (3.93,0)
    .. controls (4.1,1.48) and (4.4,1.48) .. (4.58,0)
    .. controls (4.75,-1.14) and (5.05,-1.14) .. (5.23,0)
    .. controls (5.4,0.7) and (5.7,0.7) .. (5.88,0)
    .. controls (6.0,-0.29) and (6.2,-0.29) .. (6.4,0);
\end{tikzpicture}
$$

## The electrical analogy

A series circuit with inductance $L$, resistance $R$, capacitance $C$, and
impressed voltage $E(t)$ obeys Kirchhoff's voltage law: the applied voltage
equals the sum of the drops across the three elements. With charge $Q$ on the
capacitor and current $I = Q'$, the drops are $RI$ (resistor), $Q/C$
(capacitor), and $LI'$ (inductor), giving

$$
L Q'' + R Q' + \frac{1}{C} Q = E(t). \tag{E}
$$

Equation (E) has exactly the form of the mechanical equation (M). Every result
above transfers by matching the roles term by term.

| Mechanical (spring-mass) | Electrical (series RLC) | Role |
| --- | --- | --- |
| displacement $u$ | charge $Q$ | state variable |
| mass $m$ | inductance $L$ | inertia |
| damping $\gamma$ | resistance $R$ | dissipation |
| spring constant $k$ | inverse capacitance $1/C$ | restoring stiffness |
| external force $F(t)$ | impressed voltage $E(t)$ | driving input |
| natural frequency $\sqrt{k/m}$ | $\sqrt{1/(LC)}$ | undriven oscillation rate |

> **Worked example (Series RLC circuit).** A circuit with $L = 1$ H,
> $R = 100\ \Omega$, $C = 10^{-4}$ F and no source obeys
> $Q'' + 100\,Q' + 10^{4}\,Q = 0$. Its natural frequency is
> $\omega_0 = 1/\sqrt{LC} = 100$ rad/s. The characteristic equation
> $r^2 + 100r + 10^4 = 0$ has discriminant $10^4 - 4\cdot 10^4 < 0$, so the
> circuit is underdamped, with roots
> $$
> r = \frac{-100 \pm \sqrt{-3\cdot 10^4}}{2} = -50 \pm i\,50\sqrt{3}.
> $$
> The charge is $Q(t) = e^{-50t}\bigl(A\cos(50\sqrt{3}\,t) +
> B\sin(50\sqrt{3}\,t)\bigr)$: an oscillation at the quasi-frequency
> $50\sqrt{3} \approx 86.6$ rad/s decaying under the $e^{-50t}$ envelope set by
> the resistance. Matching the roles $L \leftrightarrow m$,
> $R \leftrightarrow \gamma$, $1/C \leftrightarrow k$ makes this the same
> computation as the underdamped spring-mass above.

The correspondence is exact: the two are the same initial value problem
with relabeled constants. Solving the second-order constant-coefficient equation
once yields the behavior of every system it models: mechanical oscillators,
electric circuits, and, with the same three damping regimes and the same
resonance peak, many others.[^boyce37][^boyce38][^simmons20]

[^boyce37]: **Boyce**, _Elementary Differential Equations_, §3.7 — Mechanical and Electrical Vibrations: derivation of $mu'' + \gamma u' + ku = F(t)$, undamped simple harmonic motion $R\cos(\omega_0 t - \delta)$, the three damping regimes and quasi-frequency, and the series-RLC equation $LQ'' + RQ' + Q/C = E(t)$.
[^boyce38]: **Boyce**, _Elementary Differential Equations_, §3.8 — Forced Periodic Vibrations: the transient/steady-state decomposition, the steady-state amplitude formula, and the resonance peak at $\omega_{\max}$.
[^simmons20]: **Simmons**, _Differential Equations with Applications and Historical Notes_, §20 — Vibrations in Mechanical and Electrical Systems: the unified treatment of the spring-mass oscillator and the electric circuit as one equation.
