Second-Order Linear Differential Equations

Constant-coefficient equations of the form y ″ + p y ′ + q y = 0 , the characteristic polynomial that substituting e r x produces, and the three shapes of general solution its roots determine. Two exponentials, an exponential with an x factor, or a decaying oscillation.

Definition

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

y ″ + p y ′ + q y = 0 ,

with p and q real constants. Homogeneous means the right-hand side is zero; a nonzero right side makes it inhomogeneous and requires a particular solution as well.

The characteristic equation. Substituting the trial solution y = e r x gives y ′ = r e r x and y ″ = r 2 e r x , so the equation becomes

( r 2 + p r + q ) e r x = 0 .

Since e r x is never zero, e r x solves the equation exactly when

r 2 + p r + q = 0 .

The differential equation has been converted into a quadratic, and its roots determine the solution form.

Two constants, and why. A second-order equation requires two integrations, so its general solution carries two arbitrary constants and needs two conditions, typically y ( x 0 ) and y ′ ( x 0 ) . The general solution is a combination A y 1 + B y 2 of two solutions that are linearly independent: neither a constant multiple of the other.

The three cases. With discriminant Δ = p 2 − 4 q :

Δ RootsGeneral solution
> 0 distinct real r 1 , r 2 A e r 1 x + B e r 2 x
= 0 repeated real r ( A + B x ) e r x
< 0 complex α ± β i e α x ( A cos ⁡ β x + B sin ⁡ β x )

Why the repeated case needs the x factor. A repeated root supplies only one exponential, and A e r x + B e r x = ( A + B ) e r x collapses to a single constant, not enough to satisfy two conditions. Multiplying by x produces a second, independent solution.

Why the complex case is written with sine and cosine. The roots α ± β i give complex exponentials, and Euler's identity e i β x = cos ⁡ β x + i sin ⁡ β x converts their real combinations into e α x ( A cos ⁡ β x + B sin ⁡ β x ) . The real part α governs growth or decay and the imaginary part β the oscillation frequency.

Reading the solution. The sign of α , or of the real roots, decides stability: all roots with negative real part means every solution decays to zero. This is why the eigenvalue units' conjugate-pair result matters physically, and why an oscillating solution requires non-real roots.

Assumptions and scope

  • The characteristic equation method applies to constant coefficients. With p or q depending on x , substituting e r x leaves x in the equation and nothing cancels.

  • The two solutions combined must be linearly independent. A second copy of the same exponential adds no freedom and cannot meet two conditions.

  • A second-order equation needs two conditions, usually y ( x 0 ) and y ′ ( x 0 ) . One condition leaves a one-parameter family rather than a unique solution.

  • A repeated root gives ( A + B x ) e r x ; omitting the x factor produces a solution set too small to satisfy general initial conditions.

  • Complex roots come in conjugate pairs because the coefficients are real, which is what makes the real-valued form with sine and cosine available.

  • These methods solve the homogeneous equation. A nonzero right-hand side requires a particular solution added to this general solution, which is the coset structure the linear-transformations unit describes.

Worked material

Example

The other two cases, side by side

The worked example covered distinct real roots. Here are the repeated and complex cases on the same pattern, so the differences stand out.

---

Repeated root. Solve y ″ − 4 y ′ + 4 y = 0 with y ( 0 ) = 1 , y ′ ( 0 ) = 5 .

Characteristic equation r 2 − 4 r + 4 = 0 , discriminant Δ = 16 − 16 = 0 . One root, r = 2 , and r 2 − 4 r + 4 = ( r − 2 ) 2 confirms the doubling. The general solution therefore carries the x factor:

y = ( A + B x ) e 2 x .

Differentiating with the product rule:

y ′ = B e 2 x + 2 ( A + B x ) e 2 x = ( B + 2 A + 2 B x ) e 2 x .

At x = 0 : y ( 0 ) = A = 1 , and y ′ ( 0 ) = B + 2 A = 5 , so B = 5 − 2 = 3 . Hence

y = ( 1 + 3 x ) e 2 x .

Check. y ′ ( 0 ) = 5.000000 , and substituting into y ″ − 4 y ′ + 4 y gives residuals of order 10 − 5 at x = 0 , 0.5 , 1 . The solution grows: y ( 1 ) = 29.556224 .

Note what the x factor supplies. Without it the family is C e 2 x , whose slope at 0 is forced to 2 C = 2 y ( 0 ) , here that would demand y ′ ( 0 ) = 2 , not 5, so the condition could not be met at all.

---

Complex roots. Solve y ″ + 2 y ′ + 5 y = 0 with y ( 0 ) = 3 , y ′ ( 0 ) = − 1 .

Characteristic equation r 2 + 2 r + 5 = 0 , discriminant Δ = 4 − 20 = − 16 . Negative, so the roots are a conjugate pair:

r = − 2 ± − 16 2 = − 2 ± 4 i 2 = − 1 ± 2 i .

So α = − 1 , β = 2 , and the real general solution is

y = e − x ( A cos ⁡ 2 x + B sin ⁡ 2 x ) .

Differentiating, product rule on the envelope and the bracket together:

y ′ = e − x ( − A cos ⁡ 2 x − B sin ⁡ 2 x − 2 A sin ⁡ 2 x + 2 B cos ⁡ 2 x ) .

At x = 0 , where cos ⁡ 0 = 1 and sin ⁡ 0 = 0 : y ( 0 ) = A = 3 , and y ′ ( 0 ) = − A + 2 B = − 1 . With A = 3 that gives 2 B = 2 , so B = 1 . Hence

y = e − x ( 3 cos ⁡ 2 x + sin ⁡ 2 x ) .

Check. y ′ ( 0 ) = − 1.000000 , and − A + 2 B = − 3 + 2 = − 1 . Residuals below 6 × 10 − 6 at x = 0 , 0.5 , 1 .

Behaviour. The solution oscillates and decays: y ( 0 ) = 3 , y ( 1 ) = − 0.124764 , y ( 2 ) = − 0.367805 , y ( 3 ) = 0.129501 , y ( 5 ) = − 0.020626 . The sign keeps changing, that is the cos ⁡ 2 x and sin ⁡ 2 x , while the magnitude shrinks toward zero under the e − x envelope. Note the answer contains no i , although the roots did.

---

What varies across the three cases.

Δ SolutionLong-run
y ″ − 5 y ′ + 6 y 1 > 0 3 e 2 x − 2 e 3 x diverges, largest root wins
y ″ − 4 y ′ + 4 y 0 ( 1 + 3 x ) e 2 x diverges, x factor along for the ride
y ″ + 2 y ′ + 5 y − 16 < 0 e − x ( 3 cos ⁡ 2 x + sin ⁡ 2 x ) decays to zero, oscillating

Only the third decays, and the reason is visible in the roots alone: − 1 ± 2 i has negative real part, while 2 , 3 and the doubled 2 are positive.

Non-example

Expressions that are not solutions

The repeated root used twice. Faced with y ″ − 4 y ′ + 4 y = 0 , whose only root is r = 2 , it is natural to write

y = A e 2 x + B e 2 x (wrong)

on the grounds that a second-order equation needs two terms. Both terms do solve the equation, so nothing looks amiss. The failure is not in the terms but in the count of free constants.

Why it fails. The expression collapses:

A e 2 x + B e 2 x = ( A + B ) e 2 x = C e 2 x ,

a family with one constant wearing two names. Two symbols are on the page; only one degree of freedom exists.

A case it cannot solve. Take y ( 0 ) = 1 , y ′ ( 0 ) = 0 . From y = C e 2 x : y ( 0 ) = C = 1 , and y ′ = 2 C e 2 x , so y ′ ( 0 ) = 2 C = 2 . But the problem demands y ′ ( 0 ) = 0 , and 2 ≠ 0 . There is no choice of A and B that works. The slope at the origin is pinned to twice the value there, for every member of the family. The general solution was too small, and no cleverness in choosing constants can repair it.

The correct form ( A + B x ) e 2 x has genuinely two constants: y ( 0 ) = A = 1 and y ′ ( 0 ) = B + 2 A = 0 give B = − 2 , so y = ( 1 − 2 x ) e 2 x solves it.

The general test. Two solutions are usable as a basis only if neither is a constant multiple of the other. Here the ratio e 2 x / e 2 x = 1 is constant, so they are dependent. In the correct pair the ratio is x e 2 x / e 2 x = x , which is not constant.

---

Other things that are not second-order constant-coefficient solutions.

A single exponential where two are needed. y = e 2 x does solve y ″ − 5 y ′ + 6 y = 0 , but it is a solution, not the general solution. Offering it alone silently discards the e 3 x half of the solution space, and it satisfies y ( 0 ) = 1 , y ′ ( 0 ) = 0 only if 2 = 0 .

A complex answer. Writing the solution of y ″ + 2 y ′ + 5 y = 0 as A e ( − 1 + 2 i ) x + B e ( − 1 − 2 i ) x is not wrong, but leaving it there is incomplete for a real problem: the conjugate pair must be recombined into e − x ( A cos ⁡ 2 x + B sin ⁡ 2 x ) with A , B real. An i surviving into the final line of a real-valued problem signals an unfinished step.

Variable coefficients. For x 2 y ″ + x y ′ − y = 0 there is no characteristic equation at all. Substituting y = e r x gives ( x 2 r 2 + x r − 1 ) e r x = 0 , and the bracket still contains x , so no constant r makes it vanish identically. The method does not apply, and the equation needs a different technique, here y = x and y = 1 / x happen to be solutions, neither of them an exponential.

A nonzero right side. y ″ + y = 3 is not homogeneous, so its solutions are not closed under addition. The sum of two of them satisfies y ″ + y = 6 . The characteristic equation still supplies the homogeneous part, but a particular solution (here y = 3 ) must be added, giving the coset structure the theorem block describes.

Common errors

Common misconception

When the characteristic equation has a repeated root r , the general solution is A e r x + B e r x , using the root twice.

Related units

Requires

Connected

Learn this topic

Used in

Sources

Results update as you type. Use the up and down arrow keys to move between results, Enter to open one, and Escape to close.

Type to search.

Settings

Appearance

Interface density

Your record

Your progress is stored in this browser and nowhere else: an identifier, the answers you have given, the mastery states and review schedule derived from them, and the lesson you last opened. Clearing it makes you a new learner on this device. It cannot be undone, and it will not affect your appearance or density settings.

Focus timer

Focus--minutes remaining

Phase

Kept in this browser only, and used to label the session in your own history.

Today

Nothing recorded yet. Finish a focus session and it will appear here.

Settings

Focus sessions between long breaks.

Sessions you are aiming for in a day.

Notifications

Your history

Sessions are stored in this browser and nowhere else. They are not evidence and never reach your mastery record.