This page is the "no case left behind" companion to Second-order Linear ODEs — Superposition Principle & General Theory . We built the machinery there; here we run it against every kind of input a second-order linear ODE can hand you.
Intuition What "every scenario" means here
A second-order linear ODE lives or dies on the roots of its characteristic equation (the algebra trick from Characteristic equation — constant coefficient ODEs ). Those roots can be two different real numbers , one repeated real number , or a complex pair . Each case makes a different shaped solution. On top of that, the right-hand side (the forcing ) can be zero or not, and can even secretly overlap with a homogeneous solution (the dreaded "resonance"). We hit them all.
Read this as a checklist. Every cell below is covered by at least one worked example.
Cell
What makes it special
Solution shape
Example
A — real distinct roots (r 1 = r 2 )
discriminant > 0
c 1 e r 1 x + c 2 e r 2 x
Ex 1
B — repeated real root (r 1 = r 2 )
discriminant = 0 , degenerate
( c 1 + c 2 x ) e r x
Ex 2
C — complex roots (α ± i β )
discriminant < 0 , oscillation
e α x ( c 1 cos β x + c 2 sin β x )
Ex 3
D — non-homogeneous, ordinary forcing
RHS = 0 , no overlap
y h + y p
Ex 4
E — resonance (forcing = homogeneous soln)
naive guess fails, multiply by x
y h + x ⋅ ( … )
Ex 5
F — variable coefficients (Euler)
p , q depend on x
power-law solutions
Ex 6
G — sign of discriminant at the boundary
limiting behaviour as case B→A/C
—
Ex 7
H — real-world word problem
spring / RLC circuit
case C in disguise
Ex 8
Cells to watch for degeneracy/limits: B (roots collide), E (particular guess collides with homogeneous), G (what happens between cases).
y ′′ + 5 y ′ + 6 y = 0 , with y ( 0 ) = 1 , y ′ ( 0 ) = 0 .
Forecast: guess the two roots in your head before reading on — factor r 2 + 5 r + 6 .
Step 1. Substitute the trial y = e r x . Then y ′ = r e r x , y ′′ = r 2 e r x , and the equation becomes ( r 2 + 5 r + 6 ) e r x = 0 .
Why this step? e r x is the one function whose derivatives are just copies of itself, so calculus collapses into the algebra of Characteristic equation — constant coefficient ODEs . Since e r x = 0 , we may cancel it.
Step 2. Solve r 2 + 5 r + 6 = ( r + 2 ) ( r + 3 ) = 0 ⇒ r = − 2 , r = − 3 .
Why this step? Two distinct real roots means two genuinely different exponential solutions.
Step 3. Fundamental set y 1 = e − 2 x , y 2 = e − 3 x ; check independence with the Wronskian:
W = e − 2 x − 2 e − 2 x e − 3 x − 3 e − 3 x = − 3 e − 5 x − ( − 2 e − 5 x ) = − e − 5 x = 0.
Why this step? W = 0 (anywhere) certifies a fundamental set, so y = c 1 e − 2 x + c 2 e − 3 x is every solution.
Step 4. Apply ICs. y ( 0 ) = c 1 + c 2 = 1 . y ′ = − 2 c 1 e − 2 x − 3 c 2 e − 3 x , so y ′ ( 0 ) = − 2 c 1 − 3 c 2 = 0 . Solving: c 2 = − 2 , c 1 = 3 .
Why this step? Two initial conditions pin the two constants uniquely (Existence & Uniqueness).
Answer: y = 3 e − 2 x − 2 e − 3 x .
Verify: y ( 0 ) = 3 − 2 = 1 ✔; y ′ ( 0 ) = − 6 + 6 = 0 ✔. And y ′′ + 5 y ′ + 6 y : each term e − 2 x contributes ( 4 − 10 + 6 ) = 0 , each e − 3 x contributes ( 9 − 15 + 6 ) = 0 . ✔
y ′′ − 4 y ′ + 4 y = 0 , with y ( 0 ) = 1 , y ′ ( 0 ) = 5 .
Forecast: the discriminant is exactly zero here. What second solution do you use when the two roots merge into one ?
Step 1. Characteristic equation: r 2 − 4 r + 4 = ( r − 2 ) 2 = 0 ⇒ r = 2 (twice).
Why this step? Discriminant b 2 − 4 a c = 16 − 16 = 0 : a double root . This is the degenerate case where the naive method gives only one function e 2 x .
Step 2. We need a second independent solution. Claim: y 2 = x e 2 x works. Check by substitution: y 2 ′ = ( 1 + 2 x ) e 2 x , y 2 ′′ = ( 4 + 4 x ) e 2 x , so
y 2 ′′ − 4 y 2 ′ + 4 y 2 = e 2 x [ ( 4 + 4 x ) − 4 ( 1 + 2 x ) + 4 x ] = e 2 x ⋅ 0 = 0.✔
Why this step? When roots collide, Variation of parameters (or a limiting argument) tells us to multiply the repeated solution by x — it is independent of e 2 x because x is not a constant.
Step 3. General solution y = ( c 1 + c 2 x ) e 2 x . Apply ICs: y ( 0 ) = c 1 = 1 . y ′ = ( c 2 + 2 c 1 + 2 c 2 x ) e 2 x , so y ′ ( 0 ) = c 2 + 2 c 1 = 5 ⇒ c 2 = 3 .
Why this step? Same "two ICs → two constants" logic; the shape just changed.
Answer: y = ( 1 + 3 x ) e 2 x .
Verify: y ( 0 ) = 1 ✔; y ′ ( 0 ) = 3 + 2 = 5 ✔.
y ′′ + 2 y ′ + 5 y = 0 , with y ( 0 ) = 0 , y ′ ( 0 ) = 4 .
Forecast: discriminant negative → the roots are complex. Do you expect the answer to decay , grow , or oscillate ? Both, actually.
Step 1. Characteristic: r 2 + 2 r + 5 = 0 . By the quadratic formula r = 2 − 2 ± 4 − 20 = 2 − 2 ± − 16 = − 1 ± 2 i .
Why this step? − 16 = 4 i where i 2 = − 1 (the imaginary unit). Negative discriminant forces a complex conjugate pair α ± i β with α = − 1 , β = 2 .
Step 2. Convert to real form. e ( − 1 + 2 i ) x = e − x ( cos 2 x + i sin 2 x ) by Euler's formula. Taking real and imaginary parts gives two real solutions e − x cos 2 x and e − x sin 2 x . So
y = e − x ( c 1 cos 2 x + c 2 sin 2 x ) .
Why this step? We want real functions for a real physical quantity. α = − 1 is the decay rate ; β = 2 is the oscillation frequency . See the picture below: the exponential envelope squeezes a sine.
Step 3. ICs. y ( 0 ) = c 1 = 0 . Differentiate: y ′ = e − x [ ( − c 1 + 2 c 2 ) cos 2 x + ( − c 2 − 2 c 1 ) sin 2 x ] . At x = 0 : y ′ ( 0 ) = − c 1 + 2 c 2 = 4 . With c 1 = 0 , c 2 = 2 .
Why this step? Standard two-IC pinning; the derivative mixes the sine and cosine, which is why both must be present.
Answer: y = 2 e − x sin 2 x .
Verify: y ( 0 ) = 0 ✔; y ′ ( 0 ) = 2 ⋅ 1 ⋅ 1 = 2 cos 0 = 2 … wait — y ′ = 2 e − x ( − sin 2 x + 2 cos 2 x ) , so y ′ ( 0 ) = 2 ( 0 + 2 ) = 4 ✔.
y ′′ + y = 3 x (general solution).
Forecast: the forcing 3 x is a straight line. Guess the shape of one particular solution before you compute.
Step 1. Homogeneous part: r 2 + 1 = 0 ⇒ r = ± i , so y h = c 1 cos x + c 2 sin x .
Why this step? By the structure theorem, every solution is y h + y p . Build y h first.
Step 2. Particular solution via Method of undetermined coefficients : the RHS is degree-1 polynomial, so try y p = A x + B . Then y p ′′ = 0 , and 0 + ( A x + B ) = 3 x forces A = 3 , B = 0 .
Why this step? L maps polynomials to polynomials of the same degree here, so a linear guess is closed under the operation — no need for anything fancier. Crucially, x is not a homogeneous solution (those are sines/cosines), so no resonance.
Step 3. Assemble: y = c 1 cos x + c 2 sin x + 3 x .
Why this step? Structure theorem: general = homogeneous + one particular.
Verify: y ′′ = − c 1 cos x − c 2 sin x , so y ′′ + y = ( − c 1 cos x − c 2 sin x ) + ( c 1 cos x + c 2 sin x + 3 x ) = 3 x ✔.
y ′′ + y = cos x (general solution).
Forecast: try the "obvious" guess y p = A cos x + B sin x — and watch it explode into nonsense . Why?
Step 1. Homogeneous: y h = c 1 cos x + c 2 sin x (same as Ex 4).
Step 2. The forcing cos x is already a homogeneous solution . Plugging A cos x + B sin x into L = d x 2 d 2 + 1 gives exactly 0 — you can never produce cos x on the right. This is resonance .
Why this step? When the input frequency matches a natural frequency, the naive family lies in the kernel of L . The fix (from Method of undetermined coefficients ) is to multiply the trial by x .
Step 3. Try y p = x ( A cos x + B sin x ) . Differentiate:
y p ′ = A cos x + B sin x + x ( − A sin x + B cos x ) ,
y p ′′ = − 2 A sin x + 2 B cos x + x ( − A cos x − B sin x ) .
Then y p ′′ + y p = − 2 A sin x + 2 B cos x . Set equal to cos x : − 2 A = 0 , 2 B = 1 ⇒ A = 0 , B = 2 1 .
Why this step? The x -multiplied terms cancel against y p , leaving only the derivative-of-envelope terms — exactly what survives to match the forcing.
Answer: y = c 1 cos x + c 2 sin x + 2 x sin x .
Verify: with y p = 2 1 x sin x : y p ′ = 2 1 sin x + 2 1 x cos x , y p ′′ = cos x − 2 1 x sin x , so y p ′′ + y p = cos x ✔. The amplitude grows linearly with x — the physical signature of resonance.
x 2 y ′′ − 2 x y ′ + 2 y = 0 for x > 0 .
Forecast: here p , q depend on x , so exponentials are the wrong guess. What power of x could work?
Step 1. The coefficients scale so that each term becomes degree-matched if y = x m : then x 2 y ′′ = m ( m − 1 ) x m , − 2 x y ′ = − 2 m x m , 2 y = 2 x m .
Why this step? x r is to Euler equations what e r x is to constant-coefficient ones — each derivative lowers the power by one and multiplies by a factor , so x 2 ⋅ ( stuff ) restores the same power x m . Everything collapses to algebra again.
Step 2. Factor out x m : m ( m − 1 ) − 2 m + 2 = m 2 − 3 m + 2 = ( m − 1 ) ( m − 2 ) = 0 ⇒ m = 1 , 2 .
Why this step? Two distinct real exponents → two independent power-law solutions x 1 and x 2 .
Step 3. General solution y = c 1 x + c 2 x 2 . Independence check via Wronskian:
W = x 1 x 2 2 x = 2 x 2 − x 2 = x 2 = 0 ( for x > 0 ) .✔
Why this step? Nonzero Wronskian on the interval x > 0 confirms a fundamental set (compare Abel's theorem , which explains why W can't sneakily vanish).
Answer: y = c 1 x + c 2 x 2 .
Verify: for x 2 : x 2 ( 2 ) − 2 x ( 2 x ) + 2 x 2 = 2 x 2 − 4 x 2 + 2 x 2 = 0 ✔. For x : x 2 ( 0 ) − 2 x ( 1 ) + 2 x = 0 ✔.
Worked example What happens to
y ′′ + 2 ε y ′ + y = 0 as the damping ε crosses 1 ?
Forecast: at exactly ε = 1 you sit on the fence between oscillation (Cell C) and pure decay (Cell A). Predict which side is which.
Step 1. Characteristic roots: r = − ε ± ε 2 − 1 .
Why this step? The whole story is the sign of the discriminant ε 2 − 1 .
Step 2. Three regimes:
ε < 1 (Cell C ): ε 2 − 1 < 0 , roots − ε ± i 1 − ε 2 → decaying oscillation.
ε = 1 (Cell B ): discriminant exactly 0 , double root r = − 1 → critically damped ( c 1 + c 2 x ) e − x .
ε > 1 (Cell A ): ε 2 − 1 > 0 , two real negative roots → overdamped, no oscillation.
Why this step? This is exactly the limit where Cell C degenerates into Cell B and then splits into Cell A. As ε → 1 − , the frequency 1 − ε 2 → 0 : the oscillation slows to a stop, and the two complex roots slide together onto the real axis.
Verify (at ε = 1 ): double root r = − 1 from r 2 + 2 r + 1 = ( r + 1 ) 2 ; solution ( c 1 + c 2 x ) e − x satisfies the ODE (same check pattern as Ex 2). As ε = 0.5 : roots − 0.5 ± i 0.866 , frequency ≈ 0.866 > 0 (oscillates). As ε = 2 : roots − 2 ± 3 , both real negative (decays, no wiggle). ✔
Worked example A mass on a spring obeys
m u ¨ + c u ˙ + k u = 0 with m = 1 kg , c = 2 kg/s , k = 5 N/m . The mass starts at u ( 0 ) = 0.1 m , at rest u ˙ ( 0 ) = 0 . Find u ( t ) .
Forecast: damping c = 2 , stiffness k = 5 — is this over-, critically-, or under-damped? Guess before computing.
Step 1. Divide by m = 1 : u ¨ + 2 u ˙ + 5 u = 0 . Characteristic r 2 + 2 r + 5 = 0 ⇒ r = − 1 ± 2 i (this is exactly Ex 3's equation!).
Why this step? Newton's law for a damped spring is a constant-coefficient second-order linear ODE — same machine, physical meaning attached. Discriminant 4 − 20 < 0 ⇒ underdamped (it will oscillate as it decays).
Step 2. General solution u ( t ) = e − t ( c 1 cos 2 t + c 2 sin 2 t ) . Decay rate 1 s − 1 , angular frequency 2 rad/s .
Why this step? Real form is what a displacement (a real, measurable metres value) demands.
Step 3. ICs. u ( 0 ) = c 1 = 0.1 . u ˙ = e − t [( − c 1 + 2 c 2 ) cos 2 t + ( − c 2 − 2 c 1 ) sin 2 t ] , so u ˙ ( 0 ) = − c 1 + 2 c 2 = 0 ⇒ c 2 = c 1 /2 = 0.05 .
Why this step? Starting from rest (u ˙ ( 0 ) = 0 ) and a known displacement gives the two data needed.
Answer: u ( t ) = e − t ( 0.1 cos 2 t + 0.05 sin 2 t ) m .
Verify: units — every term is in metres (coefficients metres, trig/exp dimensionless), t in seconds inside dimensionless e − t and cos 2 t ✔. u ( 0 ) = 0.1 m ✔. u ˙ ( 0 ) = − 0.1 + 2 ( 0.05 ) = 0 ✔. Physically: amplitude shrinks by factor e − 1 ≈ 0.37 each second while wobbling — a plausible damped spring.
Recall Which root case gives which shape?
Two real distinct roots → sum of exponentials ::: c 1 e r 1 x + c 2 e r 2 x (Cell A)
Repeated real root r → ::: ( c 1 + c 2 x ) e r x (Cell B, multiply by x )
Complex α ± i β → ::: e α x ( c 1 cos β x + c 2 sin β x ) (Cell C)
Forcing equals a homogeneous solution → ::: resonance, multiply trial by x (Cell E)
Mnemonic Distinct–Double–Complex = "Split, Stick, Spin"
Split (two exponentials), Stick (the extra x glues on for the double root), Spin (sine/cosine oscillation for complex roots).
Back to the parent: Second-order Linear ODEs — Superposition Principle & General Theory . For the existence guarantee behind every "this captures all solutions", see Existence and uniqueness theorems for ODEs ; for the vector-space framing of the two-constant family, Linear algebra — vector spaces and bases .