Guides / Differential equations

Second-order linear differential equations: the characteristic roots decide the form, and the constants come last

An equation ay″ + by′ + cy = f(t) with constant a, b and c describes anything with inertia and a restoring force: a mass on a spring, an electrical circuit, a swinging pendulum. Trying y = ert turns the differential equation into a quadratic for r, and the kind of roots it has decides what the solution looks like. A forcing term f(t) adds one particular solution on top. The mistakes come from a repeated root given two copies of the same exponential, a guess for the particular solution that already solves the homogeneous equation, and initial conditions applied before the particular solution is in.

Short answer

Solve the characteristic equation ar2 + br + c = 0. Two real roots: y = c1er₁t + c2er₂t. A repeated root r: y = (c1 + c2t)ert. Complex roots α ± βi: y = eαt(c1 cos βt + c2 sin βt). For a forcing term, add a particular solution guessed in the shape of f(t), multiplied by t if the guess already solves the homogeneous equation. Apply the two initial conditions last, to the full solution yh + yp.

Why it works

Every derivative of ert is a multiple of itself: (ert)′ = rert and (ert)″ = r2ert. Put into ay″ + by′ + cy = 0, the left side becomes (ar2 + br + c)ert, and since ert is never 0, it vanishes exactly when r is a root. The equation is linear, so any combination of solutions is a solution, and a second-order equation needs two independent ones to meet two initial conditions. A repeated root supplies only one exponential, and tert turns out to be the second. Complex roots give e(α ± βi)t = eαt(cos βt ± i sin βt), and combining the two leaves the real solutions with cosine and sine.

For a forcing term, if yp is any one solution, every other solution differs from it by a solution of the homogeneous equation. So y = yh + yp is the general solution, and its two constants are still free until the initial conditions fix them.

Example 1: two distinct real roots

Solve y″ − 5y′ + 6y = 0 with y(0) = 2 and y′(0) = 5.

  1. r2 − 5r + 6 = (r − 2)(r − 3) = 0The roots are 2 and 3.
  2. y = c1e2t + c2e3tOne exponential for each root.
  3. c1 + c2 = 2, 2c1 + 3c2 = 5y(0) and y′(0), with y′ = 2c1e2t + 3c2e3t.
  4. y = e2t + e3tSubtracting twice the first equation from the second gives c2 = 1, so c1 = 1.

Example 2: a repeated root

Solve y″ − 4y′ + 4y = 0 with y(0) = 1 and y′(0) = 4.

  1. r2 − 4r + 4 = (r − 2)2One root, r = 2, twice. The discriminant b² − 4ac is 16 − 16 = 0.
  2. y = (c1 + c2t)e2tThe second solution is te2t.
  3. y′ = (2c1 + c2 + 2c2t)e2tProduct rule on c2te2t.
  4. c1 = 1, 2 + c2 = 4 ⇒ y = (1 + 2t)e2ty(0) = c1 and y′(0) = 2c1 + c2.

Example 3: complex roots

Solve y″ + 4y′ + 13y = 0 with y(0) = 2 and y′(0) = 0.

  1. r = (−4 ± √(16 − 52))/2 = −2 ± 3iThe discriminant is −36, so the roots are complex: α = −2 and β = 3.
  2. y = e−2t(c1 cos 3t + c2 sin 3t)An oscillation with angular frequency 3, inside an envelope that decays like e−2t.
  3. y(0) = c1 = 2, y′(0) = −2c1 + 3c2 = 0At t = 0 the derivative of e−2t contributes −2c1 and the derivative of sin 3t contributes 3c2.
  4. y = e−2t(2 cos 3t + 43 sin 3t)c2 = 4/3. A positive coefficient on y′ means α < 0: damping makes it die out.

Example 4: a forcing term, with the constants found last

Solve y″ + 4y′ + 3y = 9t with y(0) = 0 and y′(0) = 0.

  1. r2 + 4r + 3 = (r + 1)(r + 3) ⇒ yh = c1e−t + c2e−3tThe homogeneous solution, with its constants left free.
  2. yp = At + B: 4A + 3(At + B) = 9tThe input is a degree-1 polynomial, so guess one. yp″ = 0 and yp′ = A.
  3. 3A = 9, 4A + 3B = 0 ⇒ yp = 3t − 4Match the t terms, then the constants.
  4. c1 + c2 − 4 = 0, −c1 − 3c2 + 3 = 0Now apply y(0) = 0 and y′(0) = 0 to yh + yp, the whole solution.
  5. y = 92e−t − 12e−3t + 3t − 4Adding the equations gives −2c2 − 1 = 0, so c2 = −½ and c1 = 9/2. Check: y(0) = 9/2 − 1/2 − 4 = 0.

Common mistakes, and the exact line they happen on

1. Two copies of one exponential for a repeated root

The equation from Example 2.

  1. (r − 2)2 = 0, r = 2 twiceRight so far.
  2. y = c1e2t + c2e2tThis is the mistake. This is (c1 + c2)e2t, one constant times one function. y(0) = 1 makes it e2t, whose y′(0) is 2, and no choice of constants reaches the required 4. The second solution is te2t.

2. A guess that already solves the homogeneous equation

Find a particular solution of y″ − 3y′ + 2y = e2t.

  1. r2 − 3r + 2 = (r − 1)(r − 2)Right so far: the roots are 1 and 2.
  2. yp = Ae2t: A(4 − 6 + 2)e2t = e2t, so 0 = 1This is the mistake. e2t is part of yh, so it makes the left side 0 whatever A is. The equation has a particular solution; the guess was in the wrong family. Multiply by t: yp = Ate2t gives A = 1, so yp = te2t.

3. Initial conditions applied to yh alone

The equation from Example 4.

  1. yh = c1e−t + c2e−3t, yp = 3t − 4Right so far.
  2. c1 + c2 = 0, −c1 − 3c2 = 0 ⇒ y = 3t − 4This is the mistake. The initial conditions belong to y, not to yh. This answer solves the differential equation, but y(0) = −4 and y′(0) = 3, not 0 and 0. Add yp first, then solve for the constants: c1 = 9/2 and c2 = −½.

Practice

  1. Solve y″ − y = 0 with y(0) = 3 and y′(0) = 1.

    Show answer

    r = ±1, so y = c1et + c2e−t with c1 + c2 = 3 and c1 − c2 = 1: y = 2et + e−t.

  2. Solve y″ + 2y′ + y = 0 with y(0) = 0 and y′(0) = 3.

    Show answer

    r = −1 twice, so y = (c1 + c2t)e−t. c1 = 0 and c2 = 3: y = 3te−t.

  3. Solve y″ + 9y = 0 with y(0) = 1 and y′(0) = 6. What are the amplitude and period?

    Show answer

    r = ±3i, so y = cos 3t + 2 sin 3t. The amplitude is √(12 + 22) = √5 and the period is 2π/3.

  4. Find a particular solution of y″ + y = 3 cos 2t.

    Show answer

    Try A cos 2t + B sin 2t: −4A + A = 3 and −4B + B = 0, so yp = −cos 2t. The guess is safe because 2i is not a root of r² + 1.

  5. Find a particular solution of y″ + 2y′ − 3y = 8et.

    Show answer

    The roots are 1 and −3, so et solves the homogeneous equation and the guess is Atet. Substituting gives 4Aet = 8et, so yp = 2tet.