Second-order linear ODEs, explained
A second-order linear ODE with constant coefficients, y″ + py′ + qy = 0, describes anything that bounces, sways or settles: a mass on a spring, an RLC circuit, a car’s suspension. One guess solves all of them, and the roots of a quadratic decide what the solution looks like.
The characteristic equation
Try y = e^(rt). Each derivative multiplies it by r, so the equation becomes (r² + pr + q)·e^(rt) = 0. Since the exponential is never zero, r must solve r² + pr + q = 0. That quadratic is the characteristic equation.
Three cases
Two different real roots give two decaying or growing exponentials: the system creeps back without oscillating. A repeated root needs a second solution, t·e^(rt), and is the boundary between the other two cases. Complex roots α ± iβ give a sine and cosine inside an exponential envelope: the system oscillates at β and decays or grows at the rate α.
Written as y″ + 2ζω·y′ + ω²·y = 0, the three cases are a damping ratio ζ above 1, equal to 1, or below 1. That is the same equation as a damped mass on a spring.
Fitting the initial conditions
The general solution has two constants, and the two initial conditions y(0) and y′(0) fix them. Put t = 0 into the solution and into its derivative, and solve the two linear equations.
With a forcing term on the right-hand side, the answer is the general solution above plus one particular solution of the forced equation. Fit the initial conditions only after adding the two.
Worked example
Solve y″ + 2y′ + 5y = 0 with y(0) = 1 and y′(0) = −1. The characteristic equation r² + 2r + 5 = 0 has roots r = −1 ± 2i, so y = e^(−t)(C₁ cos 2t + C₂ sin 2t).
y(0) = C₁ = 1. Differentiating, y′(0) = −C₁ + 2C₂ = −1, so C₂ = 0. The solution is y = e^(−t) cos 2t: an oscillation at 2 rad/s inside a decaying envelope. These are the calculator’s default inputs.
Second-order ODE solver
y'' + p·y' + q·y = 0, y(0) = y0, y'(0) = v0
Common mistakes
- Dropping the t in the repeated-root case. C₁e^(rt) + C₂e^(rt) is really one solution, not two.
- Reading β as the decay rate. In α ± iβ, the real part α decays or grows and the imaginary part β oscillates.
- Fitting the initial conditions to the homogeneous part before adding the particular solution.