Kreyszig, Chapters 2–4

Second-Order ODEs
& Systems

Vibrating springs, swinging pendulums, coupled circuits. The equations that describe anything that oscillates.

Prerequisites: First-Order ODEs + basic linear algebra.
10
Chapters
6+
Simulations
10
Quizzes

Chapter 0: Why Second-Order?

Hang a weight on a spring and pull it down. Let go. It oscillates up and down. Newton's second law says F = ma, which means the acceleration (second derivative of position) is proportional to the force.

For a spring with stiffness k and mass m, the restoring force is −kx, where x is displacement from equilibrium. Newton's law gives:

m · d2x/dt2 = −kx

This is a second-order ODE because it involves the second derivative. First-order ODEs describe exponential growth/decay. Second-order ODEs describe oscillation. That one extra derivative changes everything.

The core distinction: First-order = exponential behavior (growth, decay, approach to equilibrium). Second-order = oscillatory behavior (vibration, waves, resonance). Engineering lives in the second-order world because most physical systems involve forces and accelerations.

Add friction proportional to velocity, and an external driving force F(t), and you get the full mass-spring-damper system:

m x'' + c x' + k x = F(t)

This single equation models not just mechanical vibration but also RLC circuits (replace m with L, c with R, k with 1/C), acoustic resonators, and even simple models of building sway during earthquakes.

Why does F = ma produce a second-order ODE?

Chapter 1: Homogeneous Equations

Start with the simplest case: no external force. The equation y'' + py' + qy = 0 (with constant coefficients p and q) is homogeneous. We need to find two linearly independent solutions, because the general solution is a linear combination of them.

The key insight: try y = erx. Plug it in: r2erx + p r erx + q erx = 0. Factor out erx (never zero):

r2 + pr + q = 0

This is the characteristic equation. Its roots determine the behavior of the solution entirely. The quadratic formula gives r = (−p ± √(p2 − 4q))/2.

Why try an exponential? Differentiation of erx just produces another erx (times r). So plugging erx into a linear ODE with constant coefficients turns calculus into algebra — the exponentials cancel, leaving a polynomial equation for r.

The superposition principle says that if y1 and y2 are solutions, then c1y1 + c2y2 is also a solution. The two constants c1, c2 are determined by two initial conditions: y(0) and y'(0).

Why do we need two solutions for a second-order ODE?

Chapter 2: The Characteristic Equation

The discriminant Δ = p2 − 4q of the characteristic equation r2 + pr + q = 0 splits the solutions into three cases:

ΔRootsGeneral solutionBehavior
> 0Two distinct real r1, r2c1er1x + c2er2xOverdamped
= 0Repeated real r(c1 + c2x)erxCritically damped
< 0Complex α ± iβeαx(c1cosβx + c2sinβx)Oscillatory

The complex case is the most physically important. When the roots are α ± iβ, the solution oscillates with frequency β and amplitude that grows or decays according to the sign of α.

Three Cases Visualizer

Adjust p and q to move between the three cases. The discriminant Δ = p2 − 4q determines the qualitative behavior.

p1.0
q4.0
Key insight: The three cases are not arbitrary. They reflect whether the system has enough damping to prevent oscillation. Overdamped: too much friction, no oscillation. Critically damped: just enough friction to stop oscillation. Underdamped: not enough friction, oscillation occurs.
For y'' + 2y' + 5y = 0, the characteristic roots are −1 ± 2i. What type of behavior does the solution exhibit?

Chapter 3: Damping

Return to the mass-spring-damper: mx'' + cx' + kx = 0. Divide by m: x'' + (c/m)x' + (k/m)x = 0. Define the natural frequency ω0 = √(k/m) and the damping ratio ζ = c/(2mω0).

x'' + 2ζω0x' + ω02x = 0

The damping ratio ζ completely determines the qualitative behavior:

ζBehaviorPhysical meaning
ζ > 1OverdampedHeavy friction, sluggish return to equilibrium
ζ = 1Critically dampedFastest return without oscillation (car suspension goal)
0 < ζ < 1UnderdampedOscillation with exponentially decaying amplitude
ζ = 0UndampedPure sinusoidal oscillation forever
Mass-Spring-Damper

Adjust the damping ratio ζ. Watch the spring mass oscillate (or not) after being displaced. The teal envelope shows exponential decay e−ζω0t.

ζ (damping)0.20
ω04.0
Engineering significance: Car suspensions are designed to be slightly underdamped (ζ ≈ 0.3–0.5) for comfort. Control systems target critically damped (ζ = 1) for fastest settling. Bridges must avoid undamping (ζ ≈ 0) or resonance can be catastrophic.
What does ζ = 1 (critical damping) mean physically?

Chapter 4: Nonhomogeneous Equations

Now add a driving force: y'' + py' + qy = g(x). The solution has two parts:

y = yh + yp

where yh is the homogeneous solution (what we already know) and yp is a particular solution of the full equation. The homogeneous part contains the two free constants (for initial conditions). The particular solution carries the forcing.

Method of Undetermined Coefficients

When g(x) is a polynomial, exponential, sine, cosine, or a product of these, we guess the form of yp with unknown coefficients, substitute, and solve for them.

g(x)Try yp =
Polynomial degree nAnxn + ... + A1x + A0
eaxAeax
sin(bx) or cos(bx)A cos(bx) + B sin(bx)
eaxsin(bx)eax(A cos(bx) + B sin(bx))
The modification rule: If your guess yp happens to be a solution of the homogeneous equation, multiply by x (or x2 if the root is repeated). This is the most common mistake students make.

Example: y'' + y = cos(x). The homogeneous solution is c1cos(x) + c2sin(x). Trying yp = A cos(x) + B sin(x) fails because these are already homogeneous solutions. Modification: try yp = x(A cos(x) + B sin(x)). Substituting yields yp = (x/2) sin(x).

For y'' + 4y = 3e2x, what form should you try for the particular solution?

Chapter 5: Variation of Parameters

Undetermined coefficients only works for special right-hand sides. Variation of parameters works for any g(x), as long as you know the homogeneous solutions y1, y2.

The idea: we know the homogeneous solution is c1y1 + c2y2. What if we let the "constants" vary? Replace c1, c2 with unknown functions u1(x), u2(x):

yp = u1(x)y1(x) + u2(x)y2(x)

Substituting into the ODE and imposing the constraint u1'y1 + u2'y2 = 0 (to simplify the algebra), we get a system for u1' and u2' that involves the Wronskian:

W = y1y2' − y2y1'
u1' = −y2g / W,    u2' = y1g / W

Integrate u1' and u2' to get u1 and u2. Then yp = u1y1 + u2y2. This always works, though the integrals may be hard.

Key insight: The Wronskian measures how "independent" the two solutions are. If W = 0, they are linearly dependent (proportional) and you cannot form a general solution. If W ≠ 0, the solutions span the space and variation of parameters works.
What does the Wronskian W = y1y2' − y2y1' tell us?

Chapter 6: Systems of ODEs

Most real systems have multiple interacting variables. Two masses connected by springs. Two tanks exchanging fluid. A predator and prey population. These are modeled by systems of first-order ODEs:

x' = ax + by
y' = cx + dy

In matrix form: x' = Ax, where A is a 2×2 matrix. The solution depends entirely on the eigenvalues of A.

If A has eigenvalues λ1, λ2 with eigenvectors v1, v2, the general solution is:

x(t) = c1eλ1tv1 + c2eλ2tv2
Connection to second-order: Any second-order ODE y'' + py' + qy = 0 can be written as a system by setting x1 = y, x2 = y'. Then x1' = x2 and x2' = −qx1 − px2. The eigenvalues of this system are exactly the roots of the characteristic equation r2 + pr + q = 0.
To solve x' = Ax, what property of A determines the solution behavior?

Chapter 7: Phase Portraits

For a 2D system x' = Ax, the phase portrait shows trajectories in the (x1, x2) plane. The eigenvalues of A classify the behavior at the origin (the equilibrium point):

EigenvaluesPhase portraitName
Both real, same sign, negativeTrajectories spiral/flow into originStable node
Both real, same sign, positiveTrajectories flow away from originUnstable node
Real, opposite signsTrajectories approach along one axis, leave along anotherSaddle point
Complex, negative real partSpirals inwardStable spiral
Complex, positive real partSpirals outwardUnstable spiral
Pure imaginaryClosed ellipsesCenter
Phase Portrait Explorer

Adjust the matrix entries a, b, c, d of A = [[a,b],[c,d]]. The eigenvalues and phase portrait type update live. Click to add trajectories.

a-1.0
b2.0
c-2.0
d-1.0
If a 2×2 system has eigenvalues −1 ± 3i, what is the phase portrait?

Chapter 8: Spring Resonance Lab

This is the ultimate second-order ODE demonstration. A mass-spring-damper driven by a sinusoidal force F0cos(ωt). When the driving frequency ω matches the natural frequency ω0 and damping is low, the amplitude explodes. This is resonance.

Driven Mass-Spring-Damper

The orange curve is the displacement x(t). Adjust ω (driving frequency) and ζ (damping). Watch amplitude peak when ω ≈ ω0 and damping is small.

ω (drive freq)4.0
ζ (damping)0.10
ω0 (natural)4.0

Amplitude response curve (amplitude vs driving frequency):

Resonance matters: The Tacoma Narrows Bridge collapsed in 1940 because wind-driven oscillations matched the bridge's natural frequency. Every engineer must understand resonance to prevent catastrophic structural failure.

Chapter 9: Connections

This lessonWhere it leads
Characteristic equationEigenvalues in linear algebra (Ch 4)
Damping ratio ζTransfer functions via Laplace transforms (Ch 3)
Phase portraitsNonlinear dynamics, Lyapunov stability
ResonanceFourier analysis decomposes any forcing into frequencies (Ch 6)
Systems of ODEsState-space representation in control theory
Limitations: We assumed constant coefficients. Variable-coefficient ODEs (Bessel, Legendre, Airy equations) require power series methods, which appear in Kreyszig's later chapters and in PDE solutions.

"The book of nature is written in the language of mathematics." — Galileo Galilei

What transforms the second-order mass-spring-damper ODE into an algebraic problem?