Understanding science, for all. Home About
Novadette› ∑ Mathematics› Calculus› Differential Equations
∑ Calculus

Second-Order Linear Differential Equations

Solve a·y″ + b·y′ + c·y = g(x) with constant coefficients, step by step: the characteristic equation, the homogeneous solution, a particular solution by undetermined coefficients, and the starting values. The model of every spring, pendulum and circuit that oscillates.

CalculusODECharacteristic equationOscillations
Inputs
Input examples
Enter the three constant coefficients and pick the right-hand side g(x). Leave y(0) or y′(0) empty for the general solution only.
Right-hand side g(x)

Why erx?

The derivative of erx is r·erx: the same function, times a number. Put y = erx into a·y″ + b·y′ + c·y = 0 and every term has the factor erx, which leaves an ordinary quadratic equation, a·r² + b·r + c = 0. Its two roots give two building blocks; every solution is a mix of them.

Complex roots α ± βi mean oscillation: eαx cos βx and eαx sin βx. For a mass on a spring, m·y″ + d·y′ + k·y = 0: little damping gives a dying wobble, a lot of damping a slow creep back, and just enough (critical damping) the fastest return without overshoot.

D > 0two real roots: no wobble
D = 0critical damping
D < 0oscillates
2 constantsneed y(0) and y′(0)

The Solution, Step by Step

roots
Result
Enter the values above

Step-by-Step Solution

    The Three Cases

    Two Real Roots (D > 0)
    Example: 
    One Double Root (D = 0)

    The second building block is x·erx, because erx alone would only give one.

    Complex Roots α ± βi (D < 0)

    A particular solution has the shape of g(x); if that shape already solves the homogeneous equation (resonance), multiply the guess by x.

    Sources & Verification

    References
    1. W. E. Boyce & R. C. DiPrima, Elementary Differential Equations and Boundary Value Problems, 10th ed., Wiley, 2012 — Ch. 3 (Second-Order Linear Equations: 3.1, 3.3, 3.4 and 3.5 undetermined coefficients; 3.7 mechanical vibrations).
    2. E. Kreyszig, Advanced Engineering Mathematics, 10th ed., Wiley, 2011 — Ch. 2 (Second-Order Linear ODEs).

    Frequently Asked Questions

    How do you solve a·y″ + b·y′ + c·y = 0?

    Try y = e^(rx): this gives the characteristic equation a·r² + b·r + c = 0. Its two roots give the solution. For y″ + 3y′ + 2y = 0 the roots are −1 and −2, so y = C₁·e^(−x) + C₂·e^(−2x). With y(0) = 1 and y′(0) = 0 the constants are C₁ = 2 and C₂ = −1.

    What if the characteristic equation has complex roots?

    Roots α ± βi give y = e^(αx)·(C₁·cos βx + C₂·sin βx): an oscillation that dies out (α < 0), keeps going (α = 0) or grows (α > 0). For a damped spring y″ + 0.4y′ + 4y = 0 the roots are −0.2 ± 1.99i: it wobbles with a period of about 3.16 and slowly comes to rest.

    What if the characteristic equation has a double root?

    Then e^(rx) gives only one solution, and the second is x·e^(rx). For y″ − 2y′ + y = 0 the double root is r = 1, so y = (C₁ + C₂·x)·e^x.

    What is the method of undetermined coefficients?

    A way to find one particular solution when the right side g(x) is a polynomial, an exponential or a sine/cosine: guess a function of the same shape with unknown coefficients, put it in the equation and compare. For y″ − y′ − 2y = 4x², guessing Ax² + Bx + C gives A = −2, B = 2, C = −3. The full solution is the homogeneous solution plus this particular one.

    What is resonance in a differential equation?

    When the right side has the same shape as a solution of the homogeneous equation, for example y″ + 4y = sin(2x), where sin(2x) already solves y″ + 4y = 0. The usual guess fails and must be multiplied by x: y_p = −x·cos(2x)/4. Without damping the swing then grows without limit, which is how a singer can break a glass.

    What do underdamped, critically damped and overdamped mean?

    For a mass on a spring with damping, m·y″ + d·y′ + k·y = 0. If d² < 4mk it is underdamped and oscillates while dying out; if d² = 4mk it is critically damped and returns fastest without overshooting; if d² > 4mk it is overdamped and creeps back slowly. Car shock absorbers are designed close to critical damping.