Constant Coefficients: Real Roots
When the coefficients are constants,
solutions can be found by pure algebra. The guess turns the differential equation into a quadratic equation for .
The characteristic equation
Substitute : and , so
Since , is a solution exactly when solves the characteristic equation
Three cases follow from the discriminant :
| Discriminant | Roots | General solution |
|---|---|---|
| real | ||
| one real (double) | ||
| complex |
This lesson handles distinct real roots; the other two cases are in Complex and Repeated Roots.
Example
Solve , , .
The characteristic equation has roots and , so . The conditions give and , so , .
import numpy as np
import sympy as sp
print("roots:", np.roots([1, 1, -6]))
x = sp.symbols("x")
y = sp.Function("y")
sol = sp.dsolve(y(x).diff(x, 2) + y(x).diff(x) - 6 * y(x), ics={y(0): 1, y(x).diff(x).subs(x, 0): 8})
print(sol)roots: [-3. 2.]
Eq(y(x), 11*exp(2*x)/5 - 6*exp(-3*x)/5)
Reading behaviour from the roots
Each term grows if and decays if . So:
- both roots negative: every solution decays to 0 (an overdamped spring, see Mechanical Vibrations);
- one positive root: almost every solution grows; only initial values that exactly cancel the growing term decay;
- the larger root dominates for large .
import numpy as np
x = np.array([0.0, 1.0, 2.0, 4.0])
y_general = 2.2 * np.exp(2 * x) - 1.2 * np.exp(-3 * x) # from the example
y_special = np.exp(-3 * x) # y(0) = 1, y'(0) = -3: only the decaying mode
for xv, a, b in zip(x, y_general, y_special):
print(f"x = {xv:.0f}: generic {a:12.4f} special {b:.6f}")x = 0: generic 1.0000 special 1.000000
x = 1: generic 16.1962 special 0.049787
x = 2: generic 120.1130 special 0.002479
x = 4: generic 6558.1076 special 0.000006
Why exponentials?
is the function whose derivative is a multiple of itself, so applying the operator (where ) just multiplies it by the polynomial . Factoring the polynomial factors the operator: . This operator view extends to any order (Higher-Order Linear ODEs) and to systems, where becomes with an eigenvector (The Eigenvalue Method).
In software
- Infinite impulse response (IIR) filters in audio and the "spring" smoothing used for UI animation (for example the damping and stiffness settings of spring animations in iOS and web animation libraries) are discrete versions of ; the roots decide whether the motion overshoots.
- Characteristic roots are the "poles" of control engineering; Transfer Functions and Stability connects them to the Laplace transform.
Exercises
Exercise 1: General solution
Solve .
Answer
.
Solution
.
Exercise 2: Initial value problem
Solve , , . Write the answer with a hyperbolic function.
Answer
.
Solution
Roots . and give . Since , .
Exercise 3: Build the equation (code)
Find a constant-coefficient equation whose solutions include and , and confirm with SymPy.
Answer
.
Solution
.
import sympy as sp
x = sp.symbols("x"); y = sp.Function("y")
print(sp.dsolve(y(x).diff(x, 2) + 6 * y(x).diff(x) + 5 * y(x)))Eq(y(x), (C1 + C2*exp(-4*x))*exp(-x))
Test yourself
The characteristic equation of is…
If the characteristic roots are and , solutions…
- grow
- decay to 0
- oscillate forever
- are constant
The roots of give the general solution…