Second-order linear ODEs with constant coefficients

Every second-order linear ODE with constant coefficients — the equation behind damped springs, RLC circuits and countless engineering models — reduces to a single algebraic step. Guess a solution of the form y=emxy = e^{mx}, substitute, and the differential equation collapses into a quadratic in mm: the auxiliary equation. Whatever the physical system, once you know the roots of that quadratic you can write down the full family of solutions by pattern-matching to one of three cases. This article builds that pattern-matching machine from scratch. We derive why y=emxy=e^{mx} is the right guess, work through the three root cases (real distinct, real repeated, complex conjugate), and show why a repeated root needs an extra factor of xx — a subtlety that trips up most students. A fully worked initial value problem ties the algebra to a concrete numerical answer, and a set of traps and quiz questions checks that the pattern has actually stuck.

The core insight

Substituting y=emxy = e^{mx} into ay′′+by′+cy=0ay'' + by' + cy = 0 turns the ODE into the algebraic auxiliary equation am2+bm+c=0am^2 + bm + c = 0, and the nature of its two roots — real distinct, real repeated, or complex conjugate — fixes the exact form of the general solution.

The core idea

A second-order linear homogeneous ODE with constant coefficients has the form

ay′′+by′+cy=0,a y'' + b y' + c y = 0,

where: a,b,ca, b, c are fixed real constants (a≠0a \neq 0) and y=y(x)y = y(x) is the unknown function. "Homogeneous" just means the right-hand side is zero; "linear" means yy, y′y', y′′y'' appear only to the first power and are not multiplied together. Because the derivative of emxe^{mx} is a constant multiple of itself (ddxemx=memx\frac{d}{dx}e^{mx} = me^{mx}), trying y=emxy = e^{mx} turns every derivative into a power of mm times emxe^{mx}. Substituting and cancelling the common factor emxe^{mx} (which is never zero) leaves the auxiliary equation (also called the characteristic equation):

am2+bm+c=0.am^2 + bm + c = 0.

where: mm is the unknown exponent we are solving for. This is an ordinary quadratic, solvable by factoring or the quadratic formula m=−b±b2−4ac2am = \dfrac{-b \pm \sqrt{b^2-4ac}}{2a}. The discriminant b2−4acb^2 - 4ac sorts every second-order case into exactly three families:

Case 1 — real, distinct roots (b2−4ac>0b^2-4ac>0): two different exponents m1≠m2m_1 \neq m_2, giving yc=C1em1x+C2em2xy_c = C_1e^{m_1x} + C_2e^{m_2x}.

Case 2 — real, repeated root (b2−4ac=0b^2-4ac=0): one exponent mm used twice, giving yc=(C1+C2x)emxy_c = (C_1+C_2x)e^{mx} — note the extra factor of xx on the second term.

Case 3 — complex conjugate roots (b2−4ac<0b^2-4ac<0): roots m=α±iβm=\alpha\pm i\beta, giving yc=eαx(C1cos⁡βx+C2sin⁡βx)y_c = e^{\alpha x}(C_1\cos\beta x + C_2\sin\beta x), obtained from Euler's formula by combining the two complex exponentials into real sine and cosine terms. In every case ycy_c, the complementary function, is the general solution of the homogeneous equation, carrying exactly two arbitrary constants (C1,C2C_1, C_2) because the ODE is second order. These constants are pinned down by two extra conditions — typically initial values y(0)y(0) and y′(0)y'(0), or boundary values at two points.

Figure
Three panels showing the auxiliary equation roots on the complex plane for real distinct roots, a real repeated root, and complex conjugate roots, each labeled with its complementary function
Root of the auxiliary equation decides the form of y_c m1 m2 Case 1: real distinct y_c = C1 e^(m1 x) + C2 e^(m2 x) m (double) Case 2: real repeated y_c = (C1 + C2 x) e^(m x) alpha+i beta alpha-i beta Case 3: complex pair y_c = e^(alpha x)(C1 cos beta x + C2 sin beta x)

Derivation

Derivation AFrom the auxiliary equation to the general solution for real distinct roots

The goal is to show, starting only from the substitution y=emxy = e^{mx} and ordinary algebra, exactly why a second-order homogeneous linear ODE with constant coefficients and a real-distinct-root auxiliary equation has general solution y=C1em1x+C2em2xy = C_1e^{m_1x} + C_2e^{m_2x}, and to confirm this solution genuinely satisfies the original ODE for any choice of the two constants.

Step 1. Substitute the trial solution. Let y=emxy = e^{mx} in ay′′+by′+cy=0ay'' + by' + cy = 0. Since y′=memxy' = me^{mx} and y′′=m2emxy'' = m^2e^{mx}, the equation becomes am2emx+bmemx+cemx=0am^2e^{mx} + bme^{mx} + ce^{mx} = 0, or emx(am2+bm+c)=0e^{mx}(am^2+bm+c) = 0. Because emxe^{mx} is never zero for any real xx or mm, the bracket must vanish: am2+bm+c=0am^2+bm+c=0, the auxiliary equation.

Step 2. Solve for the two roots. When b2−4ac>0b^2-4ac>0, the quadratic formula gives two distinct real roots m1=−b+b2−4ac2am_1 = \dfrac{-b+\sqrt{b^2-4ac}}{2a} and m2=−b−b2−4ac2am_2 = \dfrac{-b-\sqrt{b^2-4ac}}{2a}. Each root separately makes y=em1xy=e^{m_1x} and y=em2xy=e^{m_2x} individual solutions of the ODE, by Step 1 run in reverse.

Step 3. Combine by linearity. Because the ODE is linear and homogeneous, any linear combination of solutions is also a solution: if y1y_1 and y2y_2 both satisfy the equation, so does y=C1y1+C2y2y = C_1y_1 + C_2y_2 for any constants C1,C2C_1, C_2 — substitute and the equation splits into two copies of Step 1, each individually zero. So y=C1em1x+C2em2xy = C_1e^{m_1x} + C_2e^{m_2x} solves the ODE.

Step 4. Confirm this is the general solution, not just a solution. Two functions em1xe^{m_1x} and em2xe^{m_2x} are linearly independent whenever m1≠m2m_1 \neq m_2 (their Wronskian W=(m2−m1)e(m1+m2)xW = (m_2-m_1)e^{(m_1+m_2)x} is never zero). A second-order linear ODE has exactly a two-dimensional solution space, so two independent solutions span it completely — every solution of the ODE is some combination C1em1x+C2em2xC_1e^{m_1x}+C_2e^{m_2x}, and the two arbitrary constants are exactly what is needed to match two initial or boundary conditions.

Worked example

Solve the initial value problem y′′−5y′+6y=0y'' - 5y' + 6y = 0 with y(0)=1y(0) = 1, y′(0)=0y'(0) = 0.

Step 1. Write the auxiliary equation: m2−5m+6=0m^2 - 5m + 6 = 0.

Step 2. Factor: (m−2)(m−3)=0  ⟹  m=2, 3(m-2)(m-3) = 0 \implies m = 2,\ 3. These are real and distinct, so Case 1 applies and the general solution is y=C1e2x+C2e3xy = C_1e^{2x} + C_2e^{3x}.

Step 3. Apply y(0)=1y(0) = 1: y(0)=C1e0+C2e0=C1+C2=1y(0) = C_1e^0 + C_2e^0 = C_1 + C_2 = 1.

Step 4. Differentiate and apply y′(0)=0y'(0) = 0. Since y′=2C1e2x+3C2e3xy' = 2C_1e^{2x} + 3C_2e^{3x}, we get y′(0)=2C1+3C2=0y'(0) = 2C_1 + 3C_2 = 0.

Step 5. Solve the pair of equations. From Step 3, C1=1−C2C_1 = 1 - C_2. Substituting into Step 4: 2(1−C2)+3C2=0  ⟹  2−2C2+3C2=0  ⟹  C2=−22(1-C_2) + 3C_2 = 0 \implies 2 - 2C_2 + 3C_2 = 0 \implies C_2 = -2, and then C1=1−(−2)=3C_1 = 1 - (-2) = 3.

Step 6. Write the particular solution and check it. y=3e2x−2e3xy = 3e^{2x} - 2e^{3x}. Check: y(0)=3−2=1y(0) = 3 - 2 = 1 ✓; y′=6e2x−6e3xy' = 6e^{2x} - 6e^{3x}, so y′(0)=6−6=0y'(0) = 6 - 6 = 0 ✓. Substituting back into the ODE, y′′−5y′+6y=12e2x−18e3x−5(6e2x−6e3x)+6(3e2x−2e3x)=(12−30+18)e2x+(−18+30−12)e3x=0y'' - 5y' + 6y = 12e^{2x} - 18e^{3x} - 5(6e^{2x}-6e^{3x}) + 6(3e^{2x}-2e^{3x}) = (12-30+18)e^{2x} + (-18+30-12)e^{3x} = 0 ✓.

The particular solution is y=3e2x−2e3xy = 3e^{2x} - 2e^{3x}.

Common traps

  • Forgetting the extra factor of xx for a repeated root — writing yc=C1emx+C2emxy_c = C_1e^{mx}+C_2e^{mx} instead of (C1+C2x)emx(C_1+C_2x)e^{mx} silently collapses two constants into one.
  • Mixing up α\alpha and β\beta from complex roots α±iβ\alpha \pm i\beta: α\alpha multiplies the exponential envelope eαxe^{\alpha x}, β\beta multiplies xx inside cos⁡βx\cos\beta x and sin⁡βx\sin\beta x.
  • Losing a sign under the square root when b2−4ac<0b^2-4ac<0, writing a real-root form for what is actually a complex-root case.
  • Applying initial conditions to ycy_c before differentiating, or dropping the product rule when differentiating eαx(cos⁡βx,sin⁡βx)e^{\alpha x}(\cos\beta x,\sin\beta x) terms.

Ask the tutor: Want to work through a higher-order auxiliary equation with mixed root types, or get your complementary function checked step by step?

Why does the guess y = e^(mx) work for every constant-coefficient linear ODE?

Because differentiating emxe^{mx} just multiplies it by mm each time, so every derivative in the ODE becomes a power of mm times the same emxe^{mx} factor. Substituting turns a differential equation into a plain polynomial equation in mm, since emxe^{mx} cancels out (it is never zero). This trick works for any order and any constant coefficients — the auxiliary equation is always the same polynomial with y(k)y^{(k)} replaced by mkm^k.

Why does a repeated root need an extra factor of x instead of just doubling the constant?

A single root mm used twice, as in y=C1emx+C2emxy = C_1e^{mx} + C_2e^{mx}, is really just (C1+C2)emx(C_1+C_2)e^{mx} — one function, one effective constant, not enough to match the two conditions a second-order ODE requires. Direct substitution shows y=xemxy = xe^{mx} also solves the ODE exactly when mm is a repeated root, and it is linearly independent of emxe^{mx} (their Wronskian is nonzero). So the correct pair is emxe^{mx} and xemxxe^{mx}, giving yc=(C1+C2x)emxy_c = (C_1+C_2x)e^{mx}.

How do I know which of the three root cases applies without fully solving the quadratic?

Compute the discriminant b2−4acb^2-4ac first. If it is positive, expect two real distinct roots (Case 1); if it is exactly zero, expect one repeated real root (Case 2); if it is negative, expect a complex conjugate pair (Case 3). Checking the sign of the discriminant before grinding through the quadratic formula saves time and avoids the "lost sign under the square root" trap that silently turns a complex case into a wrong real-root answer.

Before this

Where this leads