A second-order linear differential equation with constant coefficients has the form
ay′′+by′+cy=f(x)
where a, b and c are constants. It describes anything with inertia, damping and a restoring force: a mass on a spring, a pendulum at small angles, and the charge in a series RLC circuit. When f(x)=0 the equation is homogeneous (the system is left alone); otherwise f(x) is a forcing input.
The full solution is always two parts added together:
y=yh+yp
yh (the homogeneous or complementary solution) solves the equation with f=0 and carries the two arbitrary constants. yp (a particular solution) is any one function that produces f(x). The constants are fixed last, from the initial conditions.
The homogeneous solution: three cases
Try y=emx. Each derivative brings down a factor of m, so the equation becomes emx(am2+bm+c)=0. Since emx is never zero, m must solve the characteristic equation
am2+bm+c=0
The discriminant b2−4ac decides the form of the answer:
Homogeneous solutions by root type
Roots
Condition
y_h
Real, distinct: m1=m2
b2−4ac>0
C1em1x+C2em2x
Real, repeated: m
b2−4ac=0
(C1+C2x)emx
Complex: α±iβ
b2−4ac<0
eαx(C1cosβx+C2sinβx)
The repeated case needs the extra factor x because emx alone gives only one independent solution. The complex case is the same exponential form rewritten with Euler's formula, so the answer stays real.
Worked examples: one of each case
Distinct roots. Solve y′′−5y′+6y=0 with y(0)=1, y′(0)=0. The characteristic equation m2−5m+6=0 factors as (m−2)(m−3)=0, so y=C1e2x+C2e3x. The conditions give C1+C2=1 and 2C1+3C2=0, so C1=3 and C2=−2:
y=3e2x−2e3x
Repeated root. Solve y′′+4y′+4y=0 with y(0)=1, y′(0)=1. Here m2+4m+4=(m+2)2, so y=(C1+C2x)e−2x. Then y(0)=C1=1 and y′(0)=C2−2C1=1, so C2=3 and y=(1+3x)e−2x.
Complex roots. Solve y′′+2y′+5y=0 with y(0)=0, y′(0)=2. The roots of m2+2m+5=0 are −1±2i, so y=e−x(C1cos2x+C2sin2x). Then C1=0 and y′(0)=2C2=2, so y=e−xsin2x: an oscillation that dies away.
Each of these was checked by solving the equation numerically (fourth-order Runge-Kutta) and comparing with the formula at x=1.
The particular solution: undetermined coefficients
When f(x) is an exponential, a sine or cosine, a polynomial, or a product of these, guess a yp of the same shape with unknown coefficients, substitute, and match terms.
Standard guesses for y_p
f(x)
Try y_p
kerx
Aerx
kcosωx or ksinωx
Acosωx+Bsinωx
polynomial of degree n
general polynomial of degree n
erxcosωx
erx(Acosωx+Bsinωx)
Exponential input. For y′′+3y′+2y=4ex, try yp=Aex: then A+3A+2A=6A=4, so yp=32ex.
Sinusoidal input. For y′′+3y′+2y=10cosx, try yp=Acosx+Bsinx. Substituting and collecting terms:
cosx:A+3B=10,sinx:B−3A=0
So B=3A, then 10A=10, giving A=1, B=3 and yp=cosx+3sinx. You need both the cosine and the sine in the guess even though f has only a cosine, because the y′ term turns one into the other.
The resonance case. If your guess already solves the homogeneous equation, substituting it gives 0, never f. Multiply the guess by x (by x2 if that still fails). For y′′+y=sinx, the roots are ±i, so sinx and cosx are already in yh. Trying yp=x(Acosx+Bsinx) gives A=−21, B=0:
yp=−2xcosx
The amplitude grows with x: driving an undamped system at its natural frequency makes the response grow without limit. This is resonance.
Application: the series RLC step response
Connect a 10V step to a resistor R, an inductor L=0.1H and a capacitor C=100μF in series, with the capacitor uncharged. Kirchhoff's voltage law for the charge q is
Lq′′+Rq′+Cq=10
This is exactly our equation with a=L, b=R, c=1/C. Dividing by L, the characteristic roots are m=−α±α2−ω02, with
α=2LR,ω0=LC1=0.1×100×10−61≈316.2rad/s
The three cases are the three kinds of circuit behavior. The boundary, α=ω0, is at R=2L/C≈63.25Ω.
The same circuit at three resistances
R
Roots (1/s)
Behavior
20 Ω
−100±300i
underdamped: rings, then settles
63.25 Ω
−316.2 (repeated)
critically damped: fastest with no overshoot
200 Ω
−51.3 and −1948.7
overdamped: slow, no overshoot
For R=20Ω, α=100 and the ringing frequency is ωd=316.22−1002=300rad/s. The particular solution is the final charge qp=10C, and fitting q(0)=0 and q′(0)=0 gives the capacitor voltage
vC(t)=10[1−e−100t(cos300t+31sin300t)]V
It first peaks at t=π/300≈10.47ms, at 10(1+e−π/3)≈13.51V: a 35% overshoot above the 10 V supply.
Capacitor voltage after a 10 V step for L = 0.1 H and C = 100 µF. At 20 Ω the voltage overshoots to 13.51 V at 10.47 ms and rings; at 63.25 Ω it rises as fast as it can without overshoot; at 200 Ω it creeps up slowly.
Common mistakes
Applying initial conditions to yh alone. Fit C1 and C2 to the full yh+yp; the particular solution changes y(0) and y′(0) too.
Guessing only a cosine for a cosine input. Unless there is no y′ term, you need Acos+Bsin.
Missing the resonance case. If the guess appears in yh, multiply it by x.
Writing C1emx+C2emx for a repeated root. That is one constant in disguise; the second solution is xemx.
Sign slips in the complex case. The real part of the roots sets the decay eαx; for a stable circuit α is negative.