When first-order equations aren't enough to describe a system, we
need higher-order differential equations. Spring oscillations, bridge
swaying, circuit resonance — all these phenomena require second-order or
higher ODEs for modeling. This chapter systematically covers the theory
and solution methods for higher-order linear ODEs.
Starting
with Physical Intuition: Spring-Mass Systems
The Simplest Oscillation
Model
Imagine an object of mass hanging from a spring. According to
Hooke's Law, the restoring force is proportional to displacement:whereis the spring constant, and the negative
sign indicates the force opposes displacement.
According to Newton's second law:Rearranging:whereis the natural angular
frequency.
This is a second-order homogeneous linear ODE with constant
coefficients!
Intuitive Understanding
Question: What's the solution to this equation?
Guess: What function's second derivative equals
itself multiplied by a negative number?
Answer: Sine and cosine functions!
General solution:Or equivalently:whereis the
amplitude andis the initial
phase.
defsimple_harmonic(): omega0 = 2 * np.pi # Frequency 1Hz t = np.linspace(0, 3, 500) fig, axes = plt.subplots(2, 2, figsize=(14, 10)) # Different initial conditions A, phi = 1.0, 0 x = A * np.cos(omega0 * t + phi) v = -A * omega0 * np.sin(omega0 * t + phi) # Displacement-time graph axes[0, 0].plot(t, x, 'b-', linewidth=2.5) axes[0, 0].set_xlabel('Time (s)', fontsize=12) axes[0, 0].set_ylabel('Displacement x (m)', fontsize=12) axes[0, 0].set_title('Simple Harmonic Motion', fontsize=14, fontweight='bold') axes[0, 0].grid(True, alpha=0.3) axes[0, 0].axhline(y=0, color='k', linewidth=0.5) # Velocity-time graph axes[0, 1].plot(t, v, 'r-', linewidth=2.5) axes[0, 1].set_xlabel('Time (s)', fontsize=12) axes[0, 1].set_ylabel('Velocity v (m/s)', fontsize=12) axes[0, 1].set_title('Velocity vs Time', fontsize=14, fontweight='bold') axes[0, 1].grid(True, alpha=0.3) axes[0, 1].axhline(y=0, color='k', linewidth=0.5) # Phase space trajectory axes[1, 0].plot(x, v, 'g-', linewidth=2.5) axes[1, 0].plot(x[0], v[0], 'ro', markersize=10, label='Start') axes[1, 0].set_xlabel('Displacement x (m)', fontsize=12) axes[1, 0].set_ylabel('Velocity v (m/s)', fontsize=12) axes[1, 0].set_title('Phase Portrait (Ellipse)', fontsize=14, fontweight='bold') axes[1, 0].grid(True, alpha=0.3) axes[1, 0].set_aspect('equal') axes[1, 0].legend() # Energy conservation KE = 0.5 * 1.0 * v**2# Kinetic energy, assuming m=1 PE = 0.5 * (omega0**2) * x**2# Potential energy TE = KE + PE axes[1, 1].plot(t, KE, 'r-', linewidth=2, label='Kinetic Energy') axes[1, 1].plot(t, PE, 'b-', linewidth=2, label='Potential Energy') axes[1, 1].plot(t, TE, 'k--', linewidth=2, label='Total Energy') axes[1, 1].set_xlabel('Time (s)', fontsize=12) axes[1, 1].set_ylabel('Energy (J)', fontsize=12) axes[1, 1].set_title('Energy Conservation', fontsize=14, fontweight='bold') axes[1, 1].grid(True, alpha=0.3) axes[1, 1].legend() plt.tight_layout() plt.savefig('fig1_shm.png', dpi=150, bbox_inches='tight') plt.close()
simple_harmonic()
General Theory of
Higher-Order Linear ODEs
Definition and Standard Form
th-order linear
ODE:
Standard form (leading coefficient equals 1):
Homogeneous equation:Non-homogeneous
equation:
Structure of Solutions
Theorem 1 (Superposition Principle): Ifandare solutions to the homogeneous
equation, thenis
also a solution.
Theorem 2 (General Solution Structure): The general
solution of anth-order homogeneous
linear ODE consists oflinearly
independent particular solutions:
Theorem 3 (Non-homogeneous Equation): General
solution of non-homogeneous = General solution of homogeneous + One
particular solution
Linear Independence and
the Wronskian
Definition: Functionsare linearly
independent on intervalifimplies.
Wronskian determinant:
Theorem: Ifat some point, thenare linearly independent.
Example: Verify thatandare linearly independentSo they are linearly
independent.
Constant-Coefficient
Homogeneous Equations: The Characteristic Equation Method
Core Idea
Consider anth-order homogeneous
linear ODE with constant coefficients:
Key insight: Try solutions of the formSubstituting into the
equation:Since, we get the characteristic equation:
Three Cases
Case 1:Distinct Real Roots
If the characteristic equation hasdistinct real roots:
Example 1: SolveCharacteristic equation:,
givingGeneral
solution:
Case 2: Repeated Roots
Ifis a root of
multiplicity, the corresponding
solutions are:
Example 2: SolveCharacteristic equation:,is a double root
General solution:
Case 3: Complex Roots
If there are complex roots(appearing in pairs), the corresponding real-valued
solutions are:
Example 3: SolveCharacteristic equation:General solution:
Goal: Design a suspension system that allows the car
to smoothly and quickly recover after hitting a bump.
Optimal choice: Slightly underdamped ()
Too small: Too much
oscillation, uncomfortable ride -: Theoretically fastest, but sensitive to parameter
variations
Too large: Recovery too
slow
Non-homogeneous
Equations: Method of Undetermined Coefficients
Method Overview
For the non-homogeneous equation:
Steps: 1. Solve the homogeneous equation to
get$y_hy_pf(x)y
= y_h + y_p$
Guessing Rules
Form of
Guessed
or
(polynomial)
Important correction: If a term in the guessedis already a solution of, multiply by(or, etc.) to correct.
Detailed Example
Example 4: SolveStep 1: Solve homogeneous equationCharacteristic equation:Step 2: Guess particular solution, by the rule we guessButis already part ofWe need to correct toSubstituting into original
equation:Substituting:SoStep 3:
General solution
Resonance Phenomenon
Example 5: SolveHomogeneous
solution:(because)
Note:is
already part ofGuessAfter
calculation (details omitted):
Key observation: The particular solution contains a
factor of, meaning the amplitude
grows linearly with time!
This is the resonance phenomenon — when the driving
frequency equals the natural frequency, amplitude increases without
bound (in the undamped case).
Variation of Parameters
Why Do We Need It?
The method of undetermined coefficients only works for specific forms
of(exponential, trigonometric,
polynomial). For more general cases, we need variation of
parameters.
Formula for Second-Order
Equations
ForIf we know homogeneous solutions, the particular solution
is:whereis the Wronskian.
Example
Example 6: SolveHomogeneous
solutions:
RLC
Circuits: A Classic Application of Higher-Order ODEs
Circuit Equations
Consider a series RLC circuit connected to a voltage source.
Kirchhoff's voltage law:Differentiating with respect
to time (assumingis
differentiable):This is a
second-order ODE for currentOr
using capacitor voltage:
Characteristic Equation
Analysis
Characteristic equation for the homogeneous equation:Define: -: resonant frequency -: damping
coefficient -: quality factor