Second-order linear differential equations

Solve constant-coefficient equations from the auxiliary equation, add a particular integral and fit initial conditions.

More
Reading settings

Read offline with Premium

Save lessons and figures on this device with Premium.

Connect at least once every 30 days to confirm Premium. Topic checks, coaching and sync need a connection.

On this page

Reading settings

Appearance and reading tools for your lessons.

Live preview

Take a moment to read at your own pace. Choose the font and spacing that feel comfortable for you.

Pause after each idea, then explain it in your own words before moving on.

Narrower lines take effect when the screen has room.

Colour theme
Reading font
Line spacing
Reading width
Section links
Worked examples

Open example banners when a lesson starts. Hints and solutions stay closed until you open them.

Checking Premium access…

Explore Premium
Revision Mode

Hide questions, activities and worked examples to read the notes. Turn off to show the full lesson.

Checking Premium access…

Explore Premium

Enlarged diagram

Second-order linear differential equations model vibrating springs, electrical circuits and swinging pendulums. With constant coefficients they can be solved completely by trying exponential solutions. This lesson derives the auxiliary equation, matches each kind of root (real distinct, repeated, complex) to the form of the complementary function, finds a particular integral for polynomial, exponential and trigonometric forcing, and interprets the solution of a forced oscillation in the long term.

An exponential trial gives the auxiliary equation

This lesson solves equations of the form

d²y/(dx²) + ady/(dx) + by = f(x), a,b∈R.

Start with f(x) = 0, the homogeneous equation. Its left side is linear: if y₁ and y₂ are solutions, so is Ay₁ + By₂ for any constants A and B, because differentiation respects sums and constant multiples.

Try y = e^mx. Then y' = me^mx and y'' = m²e^mx, so

e^mx(m² + am + b) = 0.

Since e^mx is never zero, e^mx is a solution exactly when m² + am + b = 0. This quadratic is the auxiliary equation. A second-order equation needs two independent solutions, giving a general solution with two arbitrary constants.

The roots decide the form of the solution

Roots of m² + am + b = 0General solution of the homogeneous equation
Real, distinct m₁, m₂y = Ae^m₁x + Be^m₂x
Real, repeated my = (A + Bx)e^mx
Complex, p± iq, q ≠ 0y = e^px(A cos qx + B sin qx)

Why the repeated case needs xe^mx. A repeated root gives only one exponential. Substitute y = xe^mx: y' = e^mx(1 + mx) and y'' = e^mx(2m + m²x), so

y'' + ay' + by = e^mx[x(m² + am + b) + (2m + a)].

The first bracket is zero because m is a root, and the second is zero because a repeated root is m = -a/2. So xe^mx is a second, independent solution.

Why the complex case gives sines and cosines. The exponentials e^((p± iq)x) = e^px(cos qx± i sin qx) solve the equation. Their sum and difference, divided by 2 and 2i, are the real solutions e^px cos qx and e^px sin qx.

The solid solution is exp(−0.200x) cos(2x), bounded by the dashed envelopes plus and minus exp(−0.200x). Its cosine factor has period π; the positive envelope at x = 4 is 0.449.

Envelope at x = 4
0.449
Period of the cosine factor
3.14
Coefficient of y: p² + 4
4.04
Predict how changing the real part p affects the envelope, then compare negative, zero and positive p. Here y = e^(px) cos(2x) solves y″ − 2py′ + (p² + 4)y = 0, with y(0) = 1 and y′(0) = p. The imaginary parts ±2 stay fixed; the dashed bounds are ±e^(px).

Check your understanding 1

One equation of each kind

Find the general solution of each equation.

  1. y'' + y'-6y = 0
  2. y'' + 6y' + 9y = 0
  3. y'' + 9y = 0
Show answerHide answer
  1. m² + m-6 = (m + 3)(m-2) = 0, so y = Ae^2x + Be^(-3x).
  2. (m + 3)² = 0, a repeated root, so y = (A + Bx)e^(-3x).
  3. m² = -9, so m = ±3i with p = 0, and y = A cos 3x + B sin 3x.

Each answer has two arbitrary constants. Writing Ae^(-3x) + Be^(-3x) in the second case is really one constant, (A + B)e^(-3x), so it cannot be the general solution.

Worked example 1

Two conditions fix two constants

Solve y''-2y' + 5y = 0 given that y = 1 and dy/(dx) = 5 when x = 0.

Show full solutionHide solution
  1. Solve the auxiliary equation

    Method

    m²-2m + 5 = 0 has discriminant 4-20 = -16.

    Reason

    Complex roots p± iq give e^px(A cos qx + B sin qx).

    Working

    Answer

    m = 2±4i/2 = 1±2i, so y = e^x(A cos 2x + B sin 2x).

  2. Use both initial conditions

    Method

    Substitute x = 0 into y and into y'.

    Reason

    The value fixes A; the gradient then fixes B.

    Working

    Answer

    y(0) = A = 1. Differentiating with the product rule,

    y' = e^x(A cos 2x + B sin 2x) + e^x(-2A sin 2x + 2B cos 2x),

    so y'(0) = A + 2B = 5 and B = 2. Hence y = e^x(cos 2x + 2 sin 2x).

General solution equals complementary function plus particular integral

For y'' + ay' + by = f(x) with f ≠ 0, suppose yₚ is any one solution, called a particular integral. If y is another solution, subtracting the two equations shows that y-yₚ solves the homogeneous equation. So every solution is

y = yc + yₚ,

where yc, the complementary function, is the general solution of the homogeneous equation. The two arbitrary constants are in yc; the particular integral has none.

Find yₚ with a trial function shaped like f(x):

f(x)First trial
Polynomial of degree nPolynomial of degree n
pe^kxCe^kx
p cos kx + q sin kxC cos kx + D sin kx

If the first trial is already part of the complementary function, it gives zero on the left, so multiply the trial by x; multiply by x² if e^kx comes from a repeated root. If b = 0, a polynomial trial needs one degree more, because y itself never appears.

Worked example 2

A polynomial forcing term

Find the general solution of y''-3y' + 2y = 4x.

Show full solutionHide solution
  1. Complementary function

    Reason

    The homogeneous part supplies both arbitrary constants.

    Working

    Answer

    m²-3m + 2 = (m-1)(m-2) = 0, so yc = Ae^x + Be^2x.

  2. Try a linear polynomial

    Method

    Try y = cx + d, so y' = c and y'' = 0.

    Reason

    A degree-one right-hand side needs a degree-one trial, including its constant term.

    Working

    Answer

    0-3c + 2(cx + d) = 4x Longrightarrow 2c = 4, -3c + 2d = 0.

    So c = 2, d = 3 and yₚ = 2x + 3. The general solution is y = Ae^x + Be^2x + 2x + 3.

Spot the mistake 1

When the trial gives zero

About 6 min

A student solving y''-3y' + 2y = e^2x tries y = Ce^2x, gets 0 = e^2x and concludes that the equation has no solution. Explain the error and find a particular integral.

Write your answer, then compare it with the solution

Show full solutionHide solution
  1. See why the trial fails

    Method

    e^2x is already in yc = Ae^x + Be^2x.

    Reason

    Anything in the complementary function makes the left side zero, so it can never produce e^2x.

    Working

    Answer

    The failed trial shows that this trial is unsuitable, not that no solution exists.

  2. Try x times the exponential

    Method

    Try y = Cxe^2x.

    Reason

    2 is a single root of the auxiliary equation, so one factor of x is enough.

    Working

    Answer

    y' = Ce^2x(1 + 2x) and y'' = Ce^2x(4 + 4x), so

    y''-3y' + 2y = Ce^2x[(4 + 4x)-3(1 + 2x) + 2x] = Ce^2x.

    So C = 1, yₚ = xe^2x and y = Ae^x + Be^2x + xe^2x.

Check your understanding 2

Choose the trial first

For each equation, write the complementary function and the form of trial you would use for the particular integral. Do not find the constants.

  1. y'' + 6y' + 9y = 5e^(-3x)
  2. y'' + 4y = 8x²
  3. y''-y' = 3
Show answerHide answer
  1. yc = (A + Bx)e^(-3x). Both e^(-3x) and xe^(-3x) are in yc, so try Cx²e^(-3x).
  2. yc = A cos 2x + B sin 2x. No polynomial is in yc, so try cx² + dx + e. (It gives yₚ = 2x²-1.)
  3. m²-m = 0 gives yc = A + Be^x. A constant is in yc (and b = 0), so try cx. (It gives yₚ = -3x.)

A forced oscillation settles to its particular integral

Common mistakes

  • Writing Ae^mx + Be^mx for a repeated root instead of (A + Bx)e^mx.
  • Choosing a particular integral that duplicates part of the complementary function, so that it gives 0 = f(x).
  • Using only p cos kx as a trial for cos kx forcing; the trial needs both p cos kx + q sin kx.
  • Fitting the initial conditions to the complementary function before adding the particular integral.
  • Forgetting that a decaying complementary function means the long-term motion is the particular integral.

Before you move on

Try it yourself 1

What remains after a long time

Minimal support

The displacement y of a damped, driven spring at time t satisfies

d²y/(dt²) + 2dy/(dt) + 5y = 10 cos t,

and it starts at rest at y = 0. Find y, and describe its motion for large t, including its amplitude.

Write your answer, then compare it with the solution

Hint 1

The trial needs both cosine and sine

Try C cos t + D sin t. The dy/dt term turns cosines into sines, so a cosine alone cannot match.

Show full solutionHide solution
  1. Complementary function

    Reason

    Its roots tell us whether the free motion dies away.

    Working

    Answer

    m² + 2m + 5 = 0 gives m = -1±2i, so yc = e^(-t)(A cos 2t + B sin 2t).

  2. Particular integral

    Method

    Substitute y = C cos t + D sin t and compare the coefficients of cos t and sin t.

    Reason

    ± i are not roots of the auxiliary equation, so this trial is not in yc.

    Working

    Answer

    The left side becomes (4C + 2D) cos t + (4D-2C) sin t. Matching it with 10 cos t:

    cos t: 4C + 2D = 10,; sin t: 4D-2C = 0.

    So C = 2D, 10D = 10, D = 1 and C = 2: yₚ = 2 cos t + sin t.

  3. Fit the start at rest

    Method

    Use y(0) = 0 and y'(0) = 0 on the whole solution.

    Reason

    The initial conditions apply to yc + yₚ, not to yc alone.

    Working

    Answer

    y(0) = A + 2 = 0, so A = -2. Also y'(0) = -A + 2B + 1 = 0, so B = -3/2. Hence

    y = e^(-t)(-2 cos 2t-3/2 sin 2t); + 2 cos t + sin t.
  4. Long-term motion

    Method

    e^(-t) → 0, so the complementary part dies away.

    Reason

    What remains is the particular integral, which has the driving frequency.

    Working

    Answer

    For large t, y ≈ 2 cos t + sin t = square root of 5 cos(t-α) with tan α = 1/2. The spring oscillates with period 2π and amplitude square root of 5, whatever its starting state.

First-order linear equations, given substitutions, phase lines and growth models are taught in First-order equations and growth models.

Questions

Open the discussion

Syllabus and review details

Last reviewed:

Back to top