Second-Order Linear Differential Equations

The equation and why it matters

A second-order linear differential equation with constant coefficients has the form

a y′′+b y′+c y=f(x)a\,y'' + b\,y' + c\,y = f(x)

where aa, bb and cc 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)=0f(x) = 0 the equation is homogeneous (the system is left alone); otherwise f(x)f(x) is a forcing input.

The full solution is always two parts added together:

y=yh+ypy = y_h + y_p

yhy_h (the homogeneous or complementary solution) solves the equation with f=0f = 0 and carries the two arbitrary constants. ypy_p (a particular solution) is any one function that produces f(x)f(x). The constants are fixed last, from the initial conditions.

The homogeneous solution: three cases

Try y=emxy = e^{mx}. Each derivative brings down a factor of mm, so the equation becomes emx(am2+bm+c)=0e^{mx}(am^2 + bm + c) = 0. Since emxe^{mx} is never zero, mm must solve the characteristic equation

am2+bm+c=0a m^2 + b m + c = 0

The discriminant b2−4acb^2 - 4ac decides the form of the answer:

Homogeneous solutions by root type
RootsConditiony_h
Real, distinct: m1≠m2m_1 \neq m_2b2−4ac>0b^2 - 4ac > 0C1em1x+C2em2xC_1 e^{m_1 x} + C_2 e^{m_2 x}
Real, repeated: mmb2−4ac=0b^2 - 4ac = 0(C1+C2x) emx(C_1 + C_2 x)\,e^{m x}
Complex: α±iβ\alpha \pm i\betab2−4ac<0b^2 - 4ac < 0eαx(C1cos⁡βx+C2sin⁡βx)e^{\alpha x}(C_1 \cos\beta x + C_2 \sin\beta x)

The repeated case needs the extra factor xx because emxe^{mx} 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=0y'' - 5y' + 6y = 0 with y(0)=1y(0) = 1, y′(0)=0y'(0) = 0. The characteristic equation m2−5m+6=0m^2 - 5m + 6 = 0 factors as (m−2)(m−3)=0(m - 2)(m - 3) = 0, so y=C1e2x+C2e3xy = C_1 e^{2x} + C_2 e^{3x}. The conditions give C1+C2=1C_1 + C_2 = 1 and 2C1+3C2=02C_1 + 3C_2 = 0, so C1=3C_1 = 3 and C2=−2C_2 = -2:

y=3e2x−2e3xy = 3e^{2x} - 2e^{3x}

Repeated root. Solve y′′+4y′+4y=0y'' + 4y' + 4y = 0 with y(0)=1y(0) = 1, y′(0)=1y'(0) = 1. Here m2+4m+4=(m+2)2m^2 + 4m + 4 = (m + 2)^2, so y=(C1+C2x)e−2xy = (C_1 + C_2 x)e^{-2x}. Then y(0)=C1=1y(0) = C_1 = 1 and y′(0)=C2−2C1=1y'(0) = C_2 - 2C_1 = 1, so C2=3C_2 = 3 and y=(1+3x)e−2xy = (1 + 3x)e^{-2x}.

Complex roots. Solve y′′+2y′+5y=0y'' + 2y' + 5y = 0 with y(0)=0y(0) = 0, y′(0)=2y'(0) = 2. The roots of m2+2m+5=0m^2 + 2m + 5 = 0 are −1±2i-1 \pm 2i, so y=e−x(C1cos⁡2x+C2sin⁡2x)y = e^{-x}(C_1\cos 2x + C_2 \sin 2x). Then C1=0C_1 = 0 and y′(0)=2C2=2y'(0) = 2C_2 = 2, so y=e−xsin⁡2xy = e^{-x}\sin 2x: 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=1x = 1.

The particular solution: undetermined coefficients

When f(x)f(x) is an exponential, a sine or cosine, a polynomial, or a product of these, guess a ypy_p of the same shape with unknown coefficients, substitute, and match terms.

Standard guesses for y_p
f(x)Try y_p
kerxk e^{rx}AerxA e^{rx}
kcos⁡ωxk\cos\omega x or ksin⁡ωxk\sin\omega xAcos⁡ωx+Bsin⁡ωxA\cos\omega x + B\sin\omega x
polynomial of degree nngeneral polynomial of degree nn
erxcos⁡ωxe^{rx}\cos\omega xerx(Acos⁡ωx+Bsin⁡ωx)e^{rx}(A\cos\omega x + B\sin\omega x)

Exponential input. For y′′+3y′+2y=4exy'' + 3y' + 2y = 4e^{x}, try yp=Aexy_p = Ae^{x}: then A+3A+2A=6A=4A + 3A + 2A = 6A = 4, so yp=23exy_p = \tfrac{2}{3}e^{x}.

Sinusoidal input. For y′′+3y′+2y=10cos⁡xy'' + 3y' + 2y = 10\cos x, try yp=Acos⁡x+Bsin⁡xy_p = A\cos x + B\sin x. Substituting and collecting terms:

cos⁡x: A+3B=10,sin⁡x: B−3A=0\cos x:\ A + 3B = 10, \qquad \sin x:\ B - 3A = 0

So B=3AB = 3A, then 10A=1010A = 10, giving A=1A = 1, B=3B = 3 and yp=cos⁡x+3sin⁡xy_p = \cos x + 3\sin x. You need both the cosine and the sine in the guess even though ff has only a cosine, because the y′y' term turns one into the other.

The resonance case. If your guess already solves the homogeneous equation, substituting it gives 00, never ff. Multiply the guess by xx (by x2x^2 if that still fails). For y′′+y=sin⁡xy'' + y = \sin x, the roots are ±i\pm i, so sin⁡x\sin x and cos⁡x\cos x are already in yhy_h. Trying yp=x(Acos⁡x+Bsin⁡x)y_p = x(A\cos x + B\sin x) gives A=−12A = -\tfrac{1}{2}, B=0B = 0:

yp=−x2cos⁡xy_p = -\tfrac{x}{2}\cos x

The amplitude grows with xx: 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 10 V10\ \text{V} step to a resistor RR, an inductor L=0.1 HL = 0.1\ \text{H} and a capacitor C=100 μFC = 100\ \mu\text{F} in series, with the capacitor uncharged. Kirchhoff's voltage law for the charge qq is

L q′′+R q′+qC=10L\,q'' + R\,q' + \frac{q}{C} = 10

This is exactly our equation with a=La = L, b=Rb = R, c=1/Cc = 1/C. Dividing by LL, the characteristic roots are m=−α±α2−ω02m = -\alpha \pm \sqrt{\alpha^2 - \omega_0^2}, with

α=R2L,ω0=1LC=10.1×100×10−6≈316.2 rad/s\alpha = \frac{R}{2L}, \qquad \omega_0 = \frac{1}{\sqrt{LC}} = \frac{1}{\sqrt{0.1 \times 100\times10^{-6}}} \approx 316.2\ \text{rad/s}

The three cases are the three kinds of circuit behavior. The boundary, α=ω0\alpha = \omega_0, is at R=2L/C≈63.25 ΩR = 2\sqrt{L/C} \approx 63.25\ \Omega.

The same circuit at three resistances
RRoots (1/s)Behavior
20 Ω−100±300i-100 \pm 300iunderdamped: rings, then settles
63.25 Ω−316.2-316.2 (repeated)critically damped: fastest with no overshoot
200 Ω−51.3-51.3 and −1948.7-1948.7overdamped: slow, no overshoot

For R=20 ΩR = 20\ \Omega, α=100\alpha = 100 and the ringing frequency is ωd=316.22−1002=300 rad/s\omega_d = \sqrt{316.2^2 - 100^2} = 300\ \text{rad/s}. The particular solution is the final charge qp=10Cq_p = 10C, and fitting q(0)=0q(0) = 0 and q′(0)=0q'(0) = 0 gives the capacitor voltage

vC(t)=10[1−e−100t(cos⁡300t+13sin⁡300t)] Vv_C(t) = 10\left[1 - e^{-100t}\left(\cos 300t + \tfrac{1}{3}\sin 300t\right)\right]\ \text{V}

It first peaks at t=π/300≈10.47 mst = \pi/300 \approx 10.47\ \text{ms}, at 10(1+e−π/3)≈13.51 V10(1 + e^{-\pi/3}) \approx 13.51\ \text{V}: a 35% overshoot above the 10 V supply.

RLC capacitor voltage after a 10 V step: 13.51 V overshoot at 20 ohms, none at 63.25 or 200
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 yhy_h alone. Fit C1C_1 and C2C_2 to the full yh+ypy_h + y_p; the particular solution changes y(0)y(0) and y′(0)y'(0) too.
  • Guessing only a cosine for a cosine input. Unless there is no y′y' term, you need Acos⁡+Bsin⁡A\cos + B\sin.
  • Missing the resonance case. If the guess appears in yhy_h, multiply it by xx.
  • Writing C1emx+C2emxC_1 e^{mx} + C_2 e^{mx} for a repeated root. That is one constant in disguise; the second solution is xemxx e^{mx}.
  • Sign slips in the complex case. The real part of the roots sets the decay eαxe^{\alpha x}; for a stable circuit α\alpha is negative.

Sources

Continue learning

First-order equations come before this page, and Laplace transforms solve the same equations another way.