Basics of Second-Order Differential Equations

Learn the standard solution patterns for second-order linear ODEs with constant coefficients: characteristic equation, forcing, and damping cases.

  • University Physics Year 1
On this page

A second-order linear ODE with constant coefficients has the form

a d²y/dx² + b dy/dx + c y = f(x),

where a,b,c are constants and f(x) is the forcing (also called a source term).

Why physics needs this (examples you can click)
Vocabulary
  • Homogeneous: f(x) = 0
  • Forced / nonhomogeneous: f(x) ≠ 0
  • The full solution is usually: general solution = homogeneous part + particular part
Template (constant coefficients + forcing)
  1. Solve the homogeneous equation with the characteristic polynomial.
  2. If forced, guess a particular solution yₚ (undetermined coefficients) and use the resonance rule if needed.
  3. Add: y = yₕ + yₚ.
  4. Apply two conditions (e.g. y(0) and y'(0)) to determine constants.

1) Homogeneous constant-coefficient case

Start with:

a y'' + b y' + c y = 0.

Step A: characteristic equation

Assume a trial solution y = e^rx. Substitution gives the characteristic equation:

ar² + br + c = 0.

Let its roots be r₁ and r₂. The solution form depends on the root type.

Case 1: two distinct real roots (r₁ ≠ r₂)

y = C₁e^r₁x + C₂e^r₂x.

Example: y''-5y' + 6y = 0
Characteristic equation: r²-5r + 6 = 0 = (r-2)(r-3), so:

y = C₁e^2x + C₂e^3x.

Case 2: repeated real root (r₁ = r₂ = r)

y = (C₁ + C₂x)e^rx.

Example: y''-4y' + 4y = 0
Characteristic: r²-4r + 4 = (r-2)², so:

y = (C₁ + C₂x)e^2x.

Case 3: complex roots (r = α± iβ)

y = e^(α x)(C₁ cos(β x) + C₂ sin(β x)).

Example: y'' + y = 0
Characteristic: r² + 1 = 0 ⇒ r = ± i, so:

y = C₁ cos x + C₂ sin x.

Step B: apply initial conditions (don’t skip this in physics)

Second-order solutions have two constants, so you typically need two conditions (often y(0) and y'(0)).

Example: solve

y'' + y = 0, y(0) = 0, y'(0) = 2.

General solution:

y = C₁ cos x + C₂ sin x.

Apply y(0) = 0:

0 = C₁.

Differentiate: y' = -C₁ sin x + C₂ cos x, so y'(0) = C₂ = 2.

Final answer:

y(x) = 2 sin x.

2) Forced (nonhomogeneous) case

Now consider:

a y'' + b y' + c y = f(x).

The standard structure is:

y(x) = yₕ(x) + yₚ(x),

where yₕ solves the homogeneous equation and yₚ is any one particular solution.

Undetermined coefficients (common physics forcing)

If f(x) is built from polynomials, exponentials, and sines/cosines (and products of these), you can often guess a suitable yₚ.

Common trial forms:

  • f(x) = Pₙ(x) (polynomial of degree n) → try yₚ = polynomial of degree n
  • f(x) = e^kx → try yₚ = Ae^kx
  • f(x) = cos(ω x) or sin(ω x) → try yₚ = A cos(ω x) + B sin(ω x)
  • Products like e^kx cos(ω x) → try yₚ = e^kx(A cos(ω x) + B sin(ω x))
Resonance rule (why guesses sometimes need an extra x)

If your guessed yₚ overlaps with a term already present in yₕ, multiply the guess by x (or by x², etc.) until it becomes linearly independent of yₕ.

Pitfalls (forced problems)
  • If you forget to check for overlap with yₕ, you can waste time because your substituted coefficients will all come out zero.
  • After finding yₚ, always write the final answer as y = yₕ + yₚ (then apply initial conditions if given).

Worked example (non-resonant)

Solve

y'' + y = cos(2x).

Homogeneous solution: yₕ = C₁ cos x + C₂ sin x.

Try a particular solution yₚ = A cos(2x) + B sin(2x). Then yₚ'' = -4A cos(2x)-4B sin(2x), so:

yₚ'' + yₚ = (-3A) cos(2x) + (-3B) sin(2x) = cos(2x).

Match coefficients:

-3A = 1 ⇒ A = -1/3, -3B = 0 ⇒ B = 0.

So a particular solution is yₚ = -1/3 cos(2x), and the general solution is:

y = C₁ cos x + C₂ sin x - 1/3 cos(2x).

Worked example (resonant forcing)

Solve

y'' + y = sin x.

The homogeneous solution is yₕ = C₁ cos x + C₂ sin x, which already contains sin x.

Start with the usual sinusoid guess and apply the resonance rule:

yₚ = x(A cos x + B sin x).

Substitute into y'' + y = sin x (the x terms cancel), giving:

-2A sin x + 2B cos x = sin x.

So A = -1/2 and B = 0, and a particular solution is:

yₚ = -x/2 cos x.

3) How this maps to damping in physics

Many “damped oscillator” models look like:

m x'' + b x' + kx = 0.

Divide by m:

x'' + 2β x' + ω₀² x = 0,

where

2β = b/m, ω₀² = k/m.
  • Underdamped: β < ω₀ (oscillatory decay)
  • Critically damped: β = ω₀
  • Overdamped: β > ω₀ (no oscillation)

Physics link: this is the same classification used in the free transient of a series RLC circuit:


Practice (with hints + answers)

1) Solve: y'' - 2y' - 3y = 0

Hint: Characteristic equation r²-2r-3 = 0.

Answer: (r-3)(r + 1) = 0 so r = 3,-1:

y = C₁e^3x + C₂e^(-x).
2) Find a particular solution form: y'' + 4y = cos(3x)

Hint: Try yₚ = A cos(3x) + B sin(3x) (non-resonant because ω = 3 vs natural ω₀ = 2).

Answer: The trial form is correct:

yₚ = A cos(3x) + B sin(3x).

(Substitute to solve for A,B if required.)

3) Resonance check: y'' + y = sin x. What must you multiply your sinusoid guess by?

Hint: sin x already appears in yₕ for y'' + y = 0.

Answer: Multiply by x:

yₚ = x(A cos x + B sin x).
4) Damping classification: m x'' + b x' + kx = 0. What are β and ω₀?

Hint: Divide by m and compare with x'' + 2β x' + ω₀² x = 0.

Answer:

2β = b/m, ω₀² = k/m.

Common mistakes

  • Forgetting that second-order ODEs need two conditions (e.g. y(0) and y'(0)).
  • Dropping the “+ C” idea when integrating or simplifying (constants matter).
  • Guessing a yₚ that duplicates yₕ (fix with the resonance rule).

This is the end of the basic walkthrough for second-order differential equations.

Back to Second Order Differential Equations Back to Mathematics for Undergraduate Physics