Skip to content
Tutorials Center
My learning

Topics

Lesson 10 of 39 ยท Second-order Linear ODEs

Homogeneous Second-order Equations with Constant Coefficients

Solve a*y'' + b*y' + c*y = 0 with the characteristic equation. Learn superposition, the Wronskian, and the distinct-real-roots case, verified with SymPy and NumPy.

Second-order linear equations are where differential equations meet physics: springs, pendulums at small angles, circuits with an inductor, vibrating beams. The simplest and most important case has constant coefficients and no forcing:

a*y'' + b*y' + c*y = 0, with a != 0.

Unlike many first-order problems there is a complete, mechanical solution procedure. It rests on a single guess, that solutions look like exponentials, and on the structure of linear equations.

The superposition principle

If y1 and y2 both solve the equation, then so does every combination C1*y1 + C2*y2. (Plug it in: each derivative splits, and each part gives zero.) So the solutions form a vector space. For a second-order equation that space is two-dimensional: you need two independent solutions, and then

y = C1*y1 + C2*y2

is the general solution. Two initial conditions, y(t0) and y'(t0), determine C1 and C2.

Independence is tested with the Wronskian W(y1, y2) = y1*y2' - y2*y1'. If W != 0 somewhere (for solutions of this equation, then everywhere), the pair is independent and forms a fundamental set.

The characteristic equation

Try y = e**(r*t). Then y' = r*e**(r*t) and y'' = r**2*e**(r*t), so

(a*r**2 + b*r + c)*e**(r*t) = 0.

Since e**(r*t) is never zero, r must satisfy the characteristic equation a*r**2 + b*r + c = 0. The roots are r = (-b ยฑ sqrt(b**2 - 4*a*c))/(2*a). The sign of the discriminant b**2 - 4*a*c gives three cases:

Discriminant Roots General solution
> 0 two distinct real r1, r2 C1*e**(r1*t) + C2*e**(r2*t)
= 0 one repeated real r (C1 + C2*t)*e**(r*t)
< 0 complex pair alpha ยฑ i*beta e**(alpha*t)*(C1*cos(beta*t) + C2*sin(beta*t))

This lesson treats the first case. The other two are in complex and repeated roots.

Worked example

Solve y'' - 3*y' + 2*y = 0, y(0) = 1, y'(0) = 0. The characteristic equation r**2 - 3*r + 2 = 0 factors as (r - 1)*(r - 2), so r = 1, 2 and y = C1*e**t + C2*e**(2*t). Conditions: C1 + C2 = 1 and C1 + 2*C2 = 0. So C2 = -1, C1 = 2, and y = 2*e**t - e**(2*t).

Python Characteristic roots and the initial conditions

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.

Wronskian check

For y1 = e**(r1*t) and y2 = e**(r2*t): W = e**((r1 + r2)*t)*(r2 - r1), non-zero when r1 != r2. That is why distinct roots always give independent solutions, and why the repeated root needs a new idea.

Python Wronskian of two exponentials

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.

Behavior from the roots

The signs of the real roots tell you what solutions do as t grows.

  • Both roots negative: both terms decay; the solution tends to 0 (stable, an over-damped spring).
  • At least one positive root: some solutions blow up exponentially (unstable).
  • One positive and one negative: a saddle; most solutions eventually follow the positive exponent.

In mechanical terms, a*y'' + b*y' + c*y = 0 with a, b, c > 0 is a mass-spring-damper; positive b is friction, and distinct real negative roots mean friction so strong that the mass creeps back without oscillating. We return to that in oscillators and resonance.

Boundary value problems

Sometimes the two conditions are given at different times, y(0) = 0, y(1) = 1. These boundary value problems can have one solution, none or infinitely many, a sharp contrast with initial value problems. With distinct real roots and y(0) = 0, y(1) = 1: C1 + C2 = 0 and C1*e**(r1) + C2*e**(r2) = 1, solvable since e**r1 != e**r2. We meet cases with non-uniqueness in the PDE chapter, where eigenvalue boundary problems produce Fourier series.

Python Solve a boundary value problem

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.

Reduction to a first-order system

Every second-order equation y'' = F(t, y, y') is equivalent to the first-order system u1 = y, u2 = y': u1' = u2, u2' = F(t, u1, u2). This is how numerical software solves it, and it is the gateway to systems.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. The characteristic equation of y'' - 5y' + 6y = 0 is

    Replace y'' by r**2, y' by r and y by 1.
  2. 2. The general solution of y'' - 5y' + 6y = 0 is

    The roots are r = 2 and r = 3.
  3. 3. If y1 and y2 solve a linear homogeneous equation, then 4y1 - 7y2

    That is superposition: linear combinations of solutions of a linear homogeneous equation are again solutions.
  4. 4. A non-zero Wronskian of two solutions means they are

    W != 0 is exactly the condition that y1 and y2 form a fundamental set.

Summary

  • Solutions of a linear homogeneous equation form a vector space; second order means dimension two.
  • Guess y = e**(r*t) to get the characteristic equation a r**2 + b r + c = 0.
  • Distinct real roots give y = C1 e**(r1 t) + C2 e**(r2 t).
  • The Wronskian detects independence; two initial conditions fix C1 and C2.
  • Signs of the real roots show stability: both negative means decay.

Next: Complex and Repeated Roots