Differential Equations

Second-Order Differential Equations

From the harmonic oscillator to resonance — three cases of the characteristic equation

A second-order linear ODE has the form ay'' + by' + cy = f(x). The characteristic equation ar² + br + c = 0 splits into three cases — real distinct roots, a repeated root, or a pair of complex roots — and each produces a different family of solutions. Underdamped, critically damped, and overdamped oscillators are exactly these three cases in physical disguise.

  • Standard formay'' + by' + cy = f(x)
  • Characteristic equationar² + br + c = 0
  • Harmonic motiony'' + ω²y = 0
  • Damped oscillatory'' + 2γy' + ω²y = 0
  • Initial conditions neededy(x₀) and y'(x₀)

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

What a second-order ODE is

A second-order differential equation involves the unknown function y(x), its first derivative y', and its second derivative y'' — but nothing higher. The most useful subclass is linear with constant coefficients:

ay'' + by' + cy = f(x).

This single template covers a huge swath of physics. Newton's second law for a spring-mass-damper is m x'' + γ x' + k x = F(t) — exactly that form. RLC circuits, simple pendulums (small angle), torsional vibrations, and small oscillations of any conservative system reduce to it.

An IVP for a second-order ODE needs two initial conditions, typically y(x₀) and y'(x₀) — position and velocity at one moment. That uniquely determines the future.

Homogeneous case: characteristic equation

When f(x) = 0, the equation ay'' + by' + cy = 0 is homogeneous. The trick is to guess y = e^{rx}. Substituting gives (ar² + br + c) e^{rx} = 0, so any r satisfying the characteristic equation

ar² + br + c = 0

produces a solution. The discriminant Δ = b² − 4ac distinguishes three cases.

Case 1: Two real distinct roots (Δ > 0)

If r₁ ≠ r₂ are real, the general solution is y = c₁ e^{r₁x} + c₂ e^{r₂x}. Each term decays or grows exponentially; together they describe overdamped motion.

Case 2: Repeated real root (Δ = 0)

If r is a double root, you only get one exponential e^{rx}, but you need two independent solutions. The second is x · e^{rx}. The general solution is y = (c₁ + c₂ x) e^{rx} — critically damped.

Case 3: Complex conjugate roots (Δ < 0)

If r = α ± iβ, the solutions e^{(α+iβ)x} and e^{(α−iβ)x} can be combined using Euler's formula into real-valued solutions e^{αx} cos(βx) and e^{αx} sin(βx). The general solution is y = e^{αx}(c₁ cos βx + c₂ sin βx) — underdamped oscillation, decaying in amplitude when α < 0.

Three cases of the characteristic equation

DiscriminantRootsGeneral solutionPhysical regimeBehavior
Δ > 0r₁, r₂ real, distinctc₁ e^{r₁x} + c₂ e^{r₂x}OverdampedSlow decay, no oscillation
Δ = 0r repeated(c₁ + c₂ x) e^{rx}Critically dampedFastest non-overshooting return
Δ < 0α ± iβe^{αx}(c₁ cos βx + c₂ sin βx)UnderdampedDecaying oscillation
Δ < 0, α = 0±iβc₁ cos βx + c₂ sin βxUndamped (SHM)Pure harmonic oscillation
Δ < 0, α > 0α ± iβe^{αx}(c₁ cos βx + c₂ sin βx)Negative dampingGrowing oscillation (instability)
b = 0, c < 0±√(−c/a) realc₁ e^{rx} + c₂ e^{−rx}Inverted pendulumExponential drift away from equilibrium

Worked example: simple harmonic motion

The quintessential second-order ODE is y'' + ω²y = 0. Characteristic equation: r² + ω² = 0, roots r = ±iω. Complex case with α = 0, β = ω. The general solution is

y(t) = c₁ cos(ωt) + c₂ sin(ωt) = A cos(ωt − φ),

where A = √(c₁² + c₂²) is the amplitude and φ is a phase shift. The frequency ω = √(k/m) for a spring of stiffness k and mass m. The period is T = 2π/ω. This solution describes pendulums (small angle), masses on springs, LC circuits, and the basic oscillation of every linear system.

Worked example: the damped oscillator

Add a friction term: y'' + 2γy' + ω²y = 0. Characteristic equation: r² + 2γr + ω² = 0, with roots r = −γ ± √(γ² − ω²).

  • Overdamped (γ > ω): both roots real and negative. Solution decays without oscillating. A heavy door with strong dashpot.
  • Critically damped (γ = ω): repeated root r = −γ. Solution y = (c₁ + c₂ t) e^{−γt} returns to zero fastest without overshoot. The "just right" damping for car shock absorbers and analog meter needles.
  • Underdamped (γ < ω): complex roots −γ ± i ω_d where ω_d = √(ω² − γ²) is the damped frequency. Solution y = A e^{−γt} cos(ω_d t − φ) oscillates with exponentially shrinking amplitude. Real-world pendulums, plucked guitar strings.

The dimensionless ratio Q = ω/(2γ) (the "quality factor") quantifies how lightly damped the system is — high Q means many oscillations before decay.

Non-homogeneous equations: superposition and forced response

For ay'' + by' + cy = f(x) with f ≠ 0, the general solution is

y = y_h + y_p,

where y_h is the homogeneous solution (free response) and y_p is any particular solution to the full equation (forced response). Two standard methods to find y_p:

  1. Undetermined coefficients. When f(x) is a polynomial, exponential, sine/cosine, or product thereof, guess a y_p with the same form (multiplied by x if it overlaps the homogeneous solution) and solve for the constants.
  2. Variation of parameters. Always works: write y_p = u₁(x) y₁(x) + u₂(x) y₂(x) where y₁, y₂ are homogeneous solutions, and derive integrals for u₁, u₂.

Example: y'' + y = e^x. Homogeneous: y_h = c₁ cos x + c₂ sin x. Try y_p = A e^x; plugging in: 2A e^x = e^x, so A = 1/2. Total solution y = c₁ cos x + c₂ sin x + (1/2) e^x.

Resonance

Force the undamped oscillator at its natural frequency: y'' + ω²y = cos(ωt). Trying y_p = A cos(ωt) fails — that's already a homogeneous solution. Instead try y_p = t(A cos ωt + B sin ωt). The factor of t makes the amplitude grow without bound — this is resonance. With damping the response is finite but peaks sharply when the forcing frequency matches ω_d.

Resonance is the mechanism behind tuning forks, MRI machines, the destruction of the Tacoma Narrows Bridge in 1940 (mostly aeroelastic flutter, not pure resonance, but the term stuck), and why marching soldiers break stride on suspension bridges.

Where second-order ODEs show up

  • Mechanical oscillators. Springs, pendulums, vibrating strings, MEMS resonators — all governed by m x'' + γ x' + k x = F(t).
  • RLC circuits. A series RLC circuit obeys L Q'' + R Q' + Q/C = V(t), structurally identical to the spring-mass-damper.
  • Quantum mechanics. The time-independent Schrödinger equation for a one-dimensional particle is a second-order linear ODE in space.
  • Beam bending. The Euler–Bernoulli beam equation for static deflection is fourth order, but its small-amplitude vibration mode equation reduces to second order in time.
  • Population dynamics with delay. Predator-prey models can be linearized near equilibrium into a 2×2 linear system equivalent to a second-order ODE.
  • Control theory. Second-order systems are the bread and butter of step-response analysis, with rise time, overshoot, and settling time directly readable from Δ.

Common mistakes

  • Sign error in the characteristic equation. The equation y'' − ω²y = 0 has roots ±ω (real, exponential), not ±iω. The sign of the y coefficient flips the entire qualitative behavior — oscillation vs growth.
  • Forgetting the second linearly independent solution at a repeated root. If r is a double root, y₁ = e^{rx} alone isn't enough. The second solution is x · e^{rx}, not another e^{rx} with a different constant.
  • Wrong guess in undetermined coefficients. If your trial particular solution overlaps the homogeneous solution, multiply by x (or x² for double overlap). Otherwise the system of equations has no solution.
  • Confusing damping coefficient. Some books write y'' + 2γy' + ω²y = 0 (factor of 2γ); others write y'' + 2ζω y' + ω²y = 0 (using damping ratio ζ). Always check which convention the problem uses.
  • Treating non-constant coefficients with the same trick. The characteristic-equation method only works when a, b, c are constants. Variable-coefficient ODEs (like y'' + p(x) y' + q(x) y = 0) generally need power series, Frobenius, or special-function methods.
  • Mixing up amplitude and energy. A damped oscillator's amplitude decays as e^{−γt}; its energy decays as e^{−2γt} since energy ~ amplitude². Half-lives differ by a factor of two.

Frequently asked questions

What is a second-order differential equation?

An ODE that involves y'' but no higher derivatives. The standard linear form is ay'' + by' + cy = f(x). Newton's F = ma is a second-order ODE for position; most of classical mechanics lives there.

What is the characteristic equation?

For ay'' + by' + cy = 0, plug in y = e^{rx} to get ar² + br + c = 0. Its roots determine the form of the solution: two real → exponentials, repeated → exponential times x, complex → damped sinusoids.

How does a damped oscillator's behavior depend on damping strength?

For y'' + 2γy' + ω²y = 0, discriminant 4γ² − 4ω² decides. γ > ω: overdamped (real distinct roots, pure decay). γ = ω: critically damped (repeated root, fastest non-overshoot return). γ < ω: underdamped (complex roots, decaying oscillation).

Why are solutions to homogeneous linear ODEs spanned by two functions?

The solution space of an n-th order linear homogeneous ODE is n-dimensional. Second order needs two linearly independent solutions y₁, y₂; every solution is c₁y₁ + c₂y₂, with the constants pinned by y(x₀) and y'(x₀).

How do you solve a non-homogeneous equation like y'' + y = sin x?

Solve the homogeneous part: y_h = c₁ cos x + c₂ sin x. For y_p, sin x is already in y_h, so try y_p = x(A cos x + B sin x); plugging in gives A = −1/2, B = 0. Final answer: y = c₁ cos x + c₂ sin x − (x/2) cos x.

What is resonance?

Forcing a system at one of its natural frequencies. In y'' + ω²y = cos(ωt), the forcing matches the natural frequency, and the particular solution gains a factor of t, growing unboundedly. Real-world systems with damping show a sharp finite peak instead.