Home / Articles / Differential Equations
Differential Equations · 3 min read

Second-Order Linear Differential Equations with Constant Coefficients

Solve second-order linear ODEs with constant coefficients using the characteristic equation, covering real, repeated and complex roots with worked examples.

Second-order linear equations with constant coefficients describe vibrating springs, swinging pendulums and electrical circuits, so they appear in every engineering and physics course. The good news is that the homogeneous versions are solved by turning calculus into algebra: you solve a quadratic, read off its roots and write down the answer. This guide covers all three root cases with complete worked examples.

The Equation and the Key Idea

We study the homogeneous equation

$$ ay'' + by' + cy = 0, $$

where \( a \), \( b \), \( c \) are constants and \( a \neq 0 \).

Exponential functions are special because their derivatives are multiples of themselves. So we try \( y = e^{rx} \). Then \( y' = re^{rx} \) and \( y'' = r^2e^{rx} \). Substituting gives

$$ e^{rx}\left(ar^2 + br + c\right) = 0. $$

Since \( e^{rx} \) is never zero, we need

$$ ar^2 + br + c = 0. $$

This is the characteristic equation (also called the auxiliary equation). Its roots decide the form of the solution.

The Three Cases

Let the discriminant be \( D = b^2 - 4ac \).

  1. Distinct real roots \( (D > 0) \), roots \( r_1 \neq r_2 \):

$$ y = c_1e^{r_1x} + c_2e^{r_2x}. $$

  1. Repeated real root \( (D = 0) \), root \( r \):

$$ y = (c_1 + c_2x)e^{rx}. $$

The extra factor \( x \) is needed because \( e^{rx} \) alone gives only one independent solution.

  1. Complex roots \( (D < 0) \), roots \( r = \alpha \pm \beta i \):

$$ y = e^{\alpha x}\left(c_1\cos\beta x + c_2\sin\beta x\right). $$

This comes from Euler's formula, \( e^{i\theta} = \cos\theta + i\sin\theta \).

Every second-order equation needs two constants, so an initial value problem gives two conditions, usually \( y(0) \) and \( y'(0) \).

Worked Example 1: Distinct Real Roots

Solve \( y'' - 5y' + 6y = 0 \) with \( y(0) = 2 \) and \( y'(0) = 5 \).

Step 1: Characteristic equation.

$$ r^2 - 5r + 6 = 0 \quad\Longrightarrow\quad (r - 2)(r - 3) = 0 \quad\Longrightarrow\quad r = 2, \ 3. $$

Step 2: General solution.

$$ y = c_1e^{2x} + c_2e^{3x}, \qquad y' = 2c_1e^{2x} + 3c_2e^{3x}. $$

Step 3: Apply the conditions.

$$ y(0) = c_1 + c_2 = 2, $$

$$ y'(0) = 2c_1 + 3c_2 = 5. $$

Multiply the first equation by 2 and subtract: \( c_2 = 1 \), so \( c_1 = 1 \).

Answer: \( y = e^{2x} + e^{3x} \).

Worked Example 2: A Repeated Root

Solve \( y'' + 4y' + 4y = 0 \) with \( y(0) = 1 \) and \( y'(0) = 1 \).

Step 1: Characteristic equation.

$$ r^2 + 4r + 4 = (r + 2)^2 = 0 \quad\Longrightarrow\quad r = -2 \ \text{(repeated)}. $$

Step 2: General solution.

$$ y = (c_1 + c_2x)e^{-2x}. $$

Step 3: Differentiate using the product rule:

$$ y' = c_2e^{-2x} - 2(c_1 + c_2x)e^{-2x}. $$

Step 4: Apply the conditions.

$$ y(0) = c_1 = 1, $$

$$ y'(0) = c_2 - 2c_1 = 1 \quad\Longrightarrow\quad c_2 = 3. $$

Answer: \( y = (1 + 3x)e^{-2x} \).

In a spring system, this is called critical damping: the mass returns to rest as quickly as possible without oscillating.

Worked Example 3: Complex Roots

Solve \( y'' + 2y' + 5y = 0 \) with \( y(0) = 1 \) and \( y'(0) = 1 \).

Step 1: Characteristic equation.

$$ r^2 + 2r + 5 = 0 \quad\Longrightarrow\quad r = \frac{-2 \pm \sqrt{4 - 20}}{2} = \frac{-2 \pm 4i}{2} = -1 \pm 2i. $$

So \( \alpha = -1 \) and \( \beta = 2 \).

Step 2: General solution.

$$ y = e^{-x}\left(c_1\cos 2x + c_2\sin 2x\right). $$

Step 3: Differentiate.

$$ y' = -e^{-x}\left(c_1\cos 2x + c_2\sin 2x\right) + e^{-x}\left(-2c_1\sin 2x + 2c_2\cos 2x\right). $$

Step 4: Apply the conditions.

$$ y(0) = c_1 = 1, $$

$$ y'(0) = -c_1 + 2c_2 = 1 \quad\Longrightarrow\quad c_2 = 1. $$

Answer: \( y = e^{-x}\left(\cos 2x + \sin 2x\right) \).

This is underdamped motion: the solution oscillates while its amplitude shrinks because of the factor \( e^{-x} \).

A Note on Non-Homogeneous Equations

When the right side is not zero, as in \( ay'' + by' + cy = g(x) \), the general solution is

$$ y = y_c + y_p, $$

where \( y_c \) is the homogeneous (complementary) solution found above and \( y_p \) is any particular solution, found by undetermined coefficients or variation of parameters. For example, for \( y'' - 5y' + 6y = 12 \), trying \( y_p = A \) gives \( 6A = 12 \), so \( y = c_1e^{2x} + c_2e^{3x} + 2 \). Apply initial conditions only to this full solution.

Common Mistakes

  • Forgetting the \( x \) in the repeated-root case. \( c_1e^{rx} + c_2e^{rx} \) is really just one constant times \( e^{rx} \).
  • Using \( \pm\beta \) in the sine and cosine. Use \( \beta \) only; the \( \pm \) is already absorbed into the constants.
  • Errors in differentiating the product forms before applying \( y'(0) \).
  • Applying conditions to \( y_c \) alone in a non-homogeneous problem. Use \( y_c + y_p \).

Key Takeaways

  • Substitute \( y = e^{rx} \) to get the characteristic equation \( ar^2 + br + c = 0 \).
  • Distinct real roots give \( c_1e^{r_1x} + c_2e^{r_2x} \).
  • A repeated root gives \( (c_1 + c_2x)e^{rx} \).
  • Complex roots \( \alpha \pm \beta i \) give \( e^{\alpha x}(c_1\cos\beta x + c_2\sin\beta x) \).
  • Two initial conditions fix the two constants.

For step-by-step solutions to your ODE problems or complete assignment help, contact Amathify's subject experts and PhD scholars on WhatsApp or through the "Ask a Question" form.

Stuck on a problem or assignment?

Our experts and PhD scholars solve maths, physics and chemistry — step by step.

WhatsApp usAsk a question

Related articles