This page solves a y'' + b y' + c y = 0, the constant-coefficient equation that shows up in a first differential equations course and in the search for a characteristic equation solver. The coefficients a, b, and c can be integers, fractions, or decimals. A decimal is kept as a fraction of a power of ten, so 0.5 is 1/2.
The boxes open on y'' + 2y' + 5y = 0 with y(0) = 1 and y'(0) = 0. That problem has complex roots −1 ± 2i, and the particular solution is e^(−x) (cos(2x) + (1/2) sin(2x)). Leave the three condition boxes blank when you only want the general solution.
The method is not separation. A first order equation that factors as a product is on the separable walkthrough. This page starts from the second derivative and constant coefficients. The map around both is differential equations.
How to read the result
The large line is the general solution, or the particular solution if you supplied y(x₀) and y'(x₀). Under it, the steps build the characteristic equation a r² + b r + c = 0, compute the discriminant Δ = b² − 4ac, and take one of the three cases.
A positive discriminant gives two different real roots r₁ and r₂, listed with the larger one first. The solution is C₁ e^(r₁ x) + C₂ e^(r₂ x). A zero discriminant gives a repeated root r, and the solution is (C₁ + C₂ x) e^(r x). The extra factor of x is required. Two copies of the same exponential are not two solutions. A negative discriminant gives complex conjugates α ± β i, with β written positive. The real solution is e^(α x) (C₁ cos(β x) + C₂ sin(β x)).
When initial conditions are present, the page differentiates the general solution, substitutes x₀, and solves the resulting 2 by 2 system. Fractions and square roots stay exact. If the initial time makes an exponential, a sine, or a cosine that is not 0, 1, or −1, the exact expression is kept and a decimal approximation is printed on its own line and labelled as a decimal.
The curve is the particular solution when conditions were entered. The marked point is (x₀, y₀). With no conditions, the curve uses the sample choice C₁ = 1 and C₂ = 1, and the steps say so. It is one member of the family.
What the three cases mean
Think of a mass on a spring: mass times acceleration, plus damping times velocity, plus spring constant times displacement, equals zero. In the letters of this page, that is a positive, b positive, and c positive. The sign of the discriminant then has a physical name.
Overdamped means Δ > 0. There are two different real roots, and both are negative. The mass returns toward equilibrium as a sum of decaying exponentials. It does not oscillate. A heavy shock absorber is the picture: the motion dies, and it does not ring.
Critically damped means Δ = 0. There is one repeated negative root, and one term carries a factor of x. The mass still does not oscillate. This is the boundary between a return that rings and a return that does not. The algebra needs the extra factor of x because a repeated root does not give two independent exponentials.
Underdamped means Δ < 0. The roots are α ± β i with α negative. The mass oscillates. The factor e^(α x) is a shrinking envelope, and β is the frequency of the ring inside that envelope. A door closer that bounces a few times and then stops is the picture.
The names assume the coefficients share a sign, so the real parts are negative. If a root has positive real part, the same three formulas describe growth. A passive spring with positive damping does not do that. If b is zero and a and c have the same sign, there is no damping at all: the solution oscillates at a constant amplitude.
Four presets
Two real roots. y'' − 3y' + 2y = 0 has discriminant 1 and roots 2 and 1. The general solution is C₁ e^(2x) + C₂ e^x. Both roots are positive, so solutions grow. This is not a passive spring.
A repeated root. y'' + 4y' + 4y = 0 has discriminant 0 and root −2. The general solution is (C₁ + C₂ x) e^(−2x). With y(0) = 1 and y'(0) = 0, the constants are C₁ = 1 and C₂ = 2, so y = (1 + 2x) e^(−2x). That is critical damping.
A complex pair. y'' + 2y' + 5y = 0 has discriminant −16, so the roots are −1 ± 2i. With y(0) = 1 and y'(0) = 0, C₁ = 1 and C₂ = 1/2. The particular solution is e^(−x) (cos(2x) + (1/2) sin(2x)). That is underdamped.
A damped spring. Take unit mass, damping constant 3, and spring constant 2, released from rest at displacement 1. The equation is y'' + 3y' + 2y = 0 with y(0) = 1 and y'(0) = 0. The roots are −1 and −2, and the solution is 2 e^(−x) − e^(−2x). The mass returns to 0 and does not cross into oscillation. That is overdamped.
A fully worked example
Both examples below are written on the page, so you can read them with scripts turned off. The form opens on the complex example. The first block is the two-real-root equation with the constants left free.
Distinct real roots. y'' − 3y' + 2y = 0, with no initial conditions.
Equation
y'' − 3y' + 2y = 0
Look for solutions of the form y = e^(rx), where r is constant. Then y' = r e^(rx) and y'' = r² e^(rx). Substitute those into the differential equation. Every term contains e^(rx), and that factor is never zero, so it cancels.
Characteristic equation
r² − 3r + 2 = 0
Discriminant
Δ = b² − 4ac.
b² = (−3)² = 9.
4ac = 4(1)(2) = 8.
Δ = 9 − 8 = 1.
The discriminant is positive, so the characteristic equation has two different real roots.
r = (−b ± √Δ) / (2a).
√Δ = 1.
r₁ = 4 / 2 = 2.
r₂ = 2 / 2 = 1.
The larger root is written first.
General solution
y = C₁ e^(2x) + C₂ e^x.
Each pure exponential uses one root. The two constants are free until an initial condition fixes them.
Check
Each root returns zero in a r² + b r + c. At r₁ = 2 and at r₂ = 1, the characteristic polynomial is 0.
Complex roots, with initial conditions. y'' + 2y' + 5y = 0, y(0) = 1, y'(0) = 0.
Equation
y'' + 2y' + 5y = 0
Characteristic equation
r² + 2r + 5 = 0
Discriminant
Δ = b² − 4ac.
b² = (2)² = 4.
4ac = 4(1)(5) = 20.
Δ = 4 − 20 = −16.
The discriminant is negative, so the roots are complex conjugates.
α = −b / (2a) = −2 / 2 = −1.
β = √(−Δ) / (2|a|) = 4 / 2 = 2.
The roots are −1 ± 2i.
General solution
y = e^(−x) (C₁ cos(2x) + C₂ sin(2x)).
Initial conditions
y(0) = 1.
y'(0) = 0.
At x = 0 the exponential is 1, cos(0) = 1, and sin(0) = 0.
y(0) = C₁, so C₁ = 1.
y'(0) = α C₁ + β C₂ = −1 + 2 C₂.
Set that equal to 0. Then 2 C₂ = 1, so C₂ = 1/2.
Particular solution
y = e^(−x) (cos(2x) + (1/2) sin(2x)).
Check
y(0) = 1 · (1 + 0) = 1.
The derivative at 0 is α C₁ + β C₂ = −1 + 2 · (1/2) = 0.
The characteristic polynomial at −1 + 2i is zero because α = −b / (2a) and β² = −Δ / (4a²).
Related reading
Place the equation on the differential equations map. Separation, which is a different method, is the separable walkthrough. The short definitions are differential equation and initial value problem.
The discriminant step, without a differential equation around it, is the quadratic formula calculator. A characteristic polynomial for a 2 by 2 matrix is a cousin, not the same object: the eigenvalue calculator solves that matrix problem. After you have an explicit y(x), the numerical derivative calculator can audit the slope.