Higher-Order Linear ODEs
Everything from the second-order case carries over to order :
The general solution of the homogeneous equation is a combination of independent solutions, an initial value problem needs conditions , and the Wronskian is now an determinant. Beam deflection (fourth order) and some control systems are the typical applications.
Constant coefficients
With constant coefficients, again reduces the equation to a polynomial, the characteristic polynomial of degree . Each root contributes solutions according to its type and multiplicity:
| Root | Multiplicity | Solutions contributed |
|---|---|---|
| real | ||
| complex pair | , for |
The total count is always .
Example. has characteristic polynomial , so .
Example. : , so .
import numpy as np
import sympy as sp
x = sp.symbols("x")
y = sp.Function("y")
print("roots of r^4 - 1:", np.round(np.roots([1, 0, 0, 0, -1]), 6))
print(sp.dsolve(y(x).diff(x, 4) - y(x)))
print(sp.dsolve(y(x).diff(x, 3) - 3 * y(x).diff(x, 2) + 3 * y(x).diff(x) - y(x)))roots of r^4 - 1: [-1.+0.j 0.+1.j 0.-1.j 1.+0.j]
Eq(y(x), C1*exp(-x) + C2*exp(x) + C3*sin(x) + C4*cos(x))
Eq(y(x), (C1 + x*(C2 + C3*x))*exp(x))
Finding the roots
For degree 3 and more, roots are found numerically (np.roots) or by factoring with SymPy (sp.roots returns roots with multiplicities, which you need for the table above).
import sympy as sp
r = sp.symbols("r")
p = r**5 + 2 * r**3 + r # = r (r^2 + 1)^2
print(sp.factor(p))
print(sp.roots(p, r))r*(r**2 + 1)**2
{-I: 2, I: 2, 0: 1}
So has the solutions .
Initial conditions as a linear system
For basis solutions, matching is an linear system whose matrix is the Wronskian matrix at 0.
import sympy as sp
x = sp.symbols("x")
basis = [sp.exp(x), sp.exp(-x), sp.cos(x), sp.sin(x)] # y'''' = y
targets = [1, 0, 0, 0] # y(0)=1, y'(0)=y''(0)=y'''(0)=0
M = sp.Matrix([[sp.diff(b, x, k).subs(x, 0) for b in basis] for k in range(4)])
c = M.solve(sp.Matrix(targets))
print("c =", list(c))
print("y =", sum(ci * b for ci, b in zip(c, basis)))c = [1/4, 1/4, 1/2, 0]
y = exp(x)/4 + cos(x)/2 + exp(-x)/4
The result is .
Linear independence
Functions are linearly independent if for all forces all . For solutions of the same th-order linear equation, this is equivalent to a nonzero Wronskian .
In software
- Euler-Bernoulli beam theory, , is a fourth-order linear ODE behind structural engineering tools and the bending of tree branches or rods in physics-based animation.
- Numerical solvers handle order by rewriting the equation as a system of first-order equations, the same trick as in Differential Equations with Python.
Exercises
Exercise 1: Read the roots
The characteristic polynomial is . Write the general solution.
Answer
.
Solution
is a double real root (two solutions), a simple complex pair (two solutions): four in all, matching the degree.
Exercise 2: Third order
Solve .
Answer
.
Solution
. The root gives the constant solution .
Exercise 3: Beam (code)
A beam of length 1 with (uniform load, units scaled) is clamped at () and free at (). Find the tip deflection .
Answer
.
Solution
Integrate four times and fit the four conditions:
import sympy as sp
x = sp.symbols("x"); c = sp.symbols("c0:4")
y = x**4 / 24 + c[3] * x**3 + c[2] * x**2 + c[1] * x + c[0]
eqs = [y.subs(x, 0), y.diff(x).subs(x, 0), y.diff(x, 2).subs(x, 1), y.diff(x, 3).subs(x, 1)]
s = sp.solve(eqs, c)
print(sp.expand(y.subs(s)), "| tip:", y.subs(s).subs(x, 1))x**4/24 - x**3/6 + x**2/4 | tip: 1/8
This is the textbook cantilever result with everything scaled to 1.
Test yourself
How many independent solutions does a fifth-order linear homogeneous ODE have?
- 2
- 4
- 5
- infinitely many
A triple root of the characteristic polynomial contributes…
- only
Which equation has and among its solutions?