Skip to content
Tutorials Center
My learning

Topics

Lesson 11 of 39 ยท Second-order Linear ODEs

Complex and Repeated Roots

Finish the constant-coefficient second-order ODE: oscillating solutions from complex roots via Euler's formula, and the (C1 + C2 t) form for repeated roots, verified in Python.

The previous lesson handled distinct real roots of a*r**2 + b*r + c = 0. Two cases remain: a negative discriminant, which gives complex roots and oscillating solutions, and a zero discriminant, which gives a repeated root and a solution with an extra factor of t. Together with the first case they classify every constant-coefficient second-order equation, and the physics of damped springs maps onto them exactly.

Complex roots: oscillation

If b**2 - 4*a*c < 0 the roots are a complex-conjugate pair r = alpha ยฑ i*beta, where alpha = -b/(2*a) and beta = sqrt(4*a*c - b**2)/(2*a). The formal solutions e**((alpha + i*beta)*t) are complex, but Euler's formula e**(i*theta) = cos(theta) + i*sin(theta) lets us extract two real solutions:

e**(alpha*t)*cos(beta*t) and e**(alpha*t)*sin(beta*t).

(Because the equation is linear with real coefficients, the real and imaginary parts of a complex solution are separately solutions.) The general real solution is

y = e**(alpha*t)*(C1*cos(beta*t) + C2*sin(beta*t)).

Interpretation: beta is the angular frequency of oscillation, and alpha governs the envelope. If alpha < 0 the oscillation decays, if alpha = 0 it is a pure sinusoid, if alpha > 0 it grows.

Worked example

y'' + 2*y' + 5*y = 0: r = -1 ยฑ 2*i, so y = e**(-t)*(C1*cos(2*t) + C2*sin(2*t)). With y(0) = 1, y'(0) = 0: C1 = 1; y' = e**(-t)*(-C1*cos 2t - C2*sin 2t - 2*C1*sin 2t + 2*C2*cos 2t), so y'(0) = -C1 + 2*C2 = 0 gives C2 = 1/2.

Python Decaying oscillation: formula versus numerical solution

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Amplitude-phase form

C1*cos(beta*t) + C2*sin(beta*t) equals A*cos(beta*t - phi) with A = sqrt(C1**2 + C2**2) and tan(phi) = C2/C1. This form shows amplitude and phase directly. For the example, A = sqrt(1.25) โ‰ˆ 1.118. The period is 2*pi/beta.

Python Amplitude, phase and envelope

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Repeated roots

If b**2 = 4*a*c, there is a single root r = -b/(2*a) and e**(r*t) is only one solution. We need a second independent one. It is t*e**(r*t): substituting y = t*e**(r*t) gives y' = (1 + r*t)*e**(r*t) and y'' = (2*r + r**2*t)*e**(r*t), so

a*y'' + b*y' + c*y = e**(r*t)*[ t*(a*r**2 + b*r + c) + (2*a*r + b) ] = 0,

since the first bracket is the characteristic polynomial (zero) and 2*a*r + b = 0 for a double root. The general solution is

y = (C1 + C2*t)*e**(r*t).

Worked example

y'' + 6*y' + 9*y = 0: (r + 3)**2 = 0, r = -3, so y = (C1 + C2*t)*e**(-3*t). With y(0) = 2, y'(0) = -1: C1 = 2; y' = (C2 - 3*C1 - 3*C2*t)*e**(-3*t), so y'(0) = C2 - 6 = -1 gives C2 = 5.

Python Critical damping: repeated root

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The three cases in physics: damping

For a mass-spring-damper m*y'' + c*y' + k*y = 0 the discriminant c**2 - 4*m*k decides everything.

Case Name Behavior
c**2 > 4*m*k over-damped slow return, no oscillation
c**2 = 4*m*k critically damped fastest return without overshoot
c**2 < 4*m*k under-damped oscillates with decaying amplitude

Critical damping is the design target for door closers and car shock absorbers.

Python Compare over, critical and under damping

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The under-damped column changes sign (it overshoots), while the other two stay positive.

Quick reference

Three cases, three forms

Two real roots C1 e^(r1 t) + C2 e^(r2 t)
Double root (C1 + C2 t) e^(r t)
Complex roots e^(a t)(C1 cos bt + C2 sin bt)

Discriminant decides

1 / 2

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. The roots of r**2 + 4r + 13 = 0 are

    r = (-4 ยฑ sqrt(16 - 52))/2 = -2 ยฑ 3i.
  2. 2. So the solution of y'' + 4y' + 13y = 0 behaves like

    y = e**(-2t)(C1 cos 3t + C2 sin 3t): the real part -2 gives decay and the imaginary part 3 the frequency.
  3. 3. For the double root r = 2, the general solution is

    The two copies of e**(2t) would be dependent, so t*e**(2t) supplies the second solution.
  4. 4. A suspension with c**2 = 4mk is

    Zero discriminant means a repeated root, which is the critically damped case.

Summary

  • Complex roots alpha ยฑ i*beta give e**(alpha*t)*(C1 cos(beta t) + C2 sin(beta t)): decaying, steady or growing oscillation.
  • A repeated root r gives (C1 + C2 t) e**(r t).
  • Amplitude-phase form A*cos(beta t - phi) shows size and timing of oscillations.
  • For damped springs the discriminant separates over-, critically and under-damped motion.
  • Always verify by substituting back or comparing with solve_ivp.

Next: Undetermined Coefficients