Differential Equations • Second-Order Linear ODEs

Superposition & Particular Solutions — Superposition and Particular Solutions

Learn how to build the complete solution to a second-order ODE by combining complementary and particular parts.

A changing curve with sigma and variable symbols for differential equations
Inside this lesson 10 sections 5 questions 9 figures

SECTION 1

Historical Context & Motivation

For centuries, scientists and mathematicians faced the same puzzle: how do you predict the motion of a vibrating string, the swing of a pendulum, or the current in an electrical circuit? These physical systems all produce behavior governed by second-order linear ordinary differential equations (ODEs). Early pioneers realized that understanding these equations was the key to unlocking how the physical world works. The mathematical tools they developed—superposition and particular solutions—remain central to engineering, physics, and applied math today.

1700s • Euler & the Foundations

Leonhard Euler developed systematic methods for solving linear ODEs, establishing the idea that solutions to homogeneous equations could be added together—laying the groundwork for superposition.

1750 • D'Alembert's Wave Equation

Jean le Rond d'Alembert used superposition to solve the wave equation, showing that complex vibrations are sums of simpler ones.

1822 • Fourier's Heat Equation

Joseph Fourier decomposed heat flow into sums of sine and cosine functions, dramatically extending the superposition principle to infinite series.

1800s • Method of Undetermined Coefficients

Mathematicians formalized techniques for finding particular solutions to non-homogeneous equations—equations with a forcing function on the right-hand side.

The central question these pioneers addressed is one you will answer in this lesson: when a differential equation has a nonzero right-hand side (a non-homogeneous equation), how do you combine the natural behavior of the system with the response to an external force to find the general solution?

SECTION 2

Core Principles & Definitions

Before diving into techniques, you need to understand the key ideas that make superposition work. A linear ODE is one in which the unknown function y and its derivatives appear only to the first power and are not multiplied together. This linearity property is what makes the superposition principle possible. When the equation equals zero on the right side, we call it homogeneous; when it equals some function g(x), it is non-homogeneous.

1

Superposition Principle

If y₁ and y₂ are solutions to a linear homogeneous ODE, then any linear combination c₁y₁ + c₂y₂ is also a solution. You can add solutions together and scale them freely.
2

Complementary Solution (yc)

The general solution to the associated homogeneous equation. It captures the system's natural behavior—think of it as what happens when no outside force acts.
3

Particular Solution (yp)

Any single specific solution to the full non-homogeneous equation. It represents the system's steady-state response to the external force or input g(x).
4

General Solution Structure

The general solution to a non-homogeneous linear ODE is y = yc + yp. You build the complete answer by adding the complementary and particular solutions.
✦

KEY TAKEAWAY

Think of it like music. The complementary solution is the instrument's natural resonance when you tap it and let it ring. The particular solution is the sound produced when you play a specific note on it. The total sound you hear—the general solution—is both of those combined. Superposition simply says you can layer these two effects on top of each other.

SECTION 3

Visual Explanation

How Solutions Combine: A Visual Overview

General Solution = Complementary + ParticularComplementary ycy″ + ay′ + by = 0Natural behavioryc = c₁y₁ + c₂y₂2 free constantsParticular ypy″ + ay′ + by = g(x)Forced responseOne specific ypNo free constants+General Solution yy = yc + ypy = c₁y₁ + c₂y₂ + ypComplete family of solutionsThe superposition principle guarantees this addition worksbecause the equation is LINEAR.
The diagram shows how the complementary solution yc (the natural behavior from solving the homogeneous equation) combines with the particular solution yp (the forced response) to form the general solution y = yc + yp.

Notice in the diagram that the complementary solution contains two arbitrary constants (c₁ and c₂), giving you a whole family of curves. The particular solution, by contrast, is just one specific function with no free constants. When you add them, the result is the general solution, which still has two constants. Those constants are later determined by initial conditions—values of y and y′ at a specific point.

SECTION 4

Mathematical Framework

Let's formalize the ideas with equations. A general second-order linear ODE with constant coefficients looks like the equation below. The left side is a linear operator acting on y, and the right side g(x) is the forcing function (also called the non-homogeneous term).

NON-HOMOGENEOUS ODE

y″+a⋅y′+b⋅y=g(x)y″ + a·y′ + b·y = g(x)

y″ = second derivative of y with respect to x; a and b are real constants; g(x) is a given function of x.

Step one is always to solve the associated homogeneous equation (set g(x) = 0). The result is the complementary solution.

HOMOGENEOUS EQUATION

y″+a⋅y′+b⋅y=0y″ + a·y′ + b·y = 0

Solve using the characteristic equation r² + a·r + b = 0. The roots r₁ and r₂ determine the form of yc.

COMPLEMENTARY SOLUTION

yc=c1⋅e(r1⋅x)+c2⋅e(r2⋅x)yc = c₁·e^(r₁·x) + c₂·e^(r₂·x)

This form applies when the characteristic roots r₁ and r₂ are real and distinct. Other root types (repeated, complex) give different but analogous forms.

Step two is to find any one particular solution yp to the full non-homogeneous equation. Two common methods are the method of undetermined coefficients (good when g(x) is a polynomial, exponential, sine, or cosine) and variation of parameters (works for any g(x)). In this lesson, we focus on undetermined coefficients because it is the most accessible starting point.

GENERAL SOLUTION

y=yc+yp=c1⋅y1+c2⋅y2+ypy = yc + yp = c₁·y₁ + c₂·y₂ + yp

This is guaranteed by the superposition principle. c₁ and c₂ are arbitrary constants determined by initial conditions.

SECTION 5

Finding the Particular Solution — Undetermined Coefficients

The method of undetermined coefficients works by guessing the form of yp based on the type of function g(x). You then substitute that guess into the ODE, match coefficients on both sides, and solve for the unknowns. The table below shows the standard guesses.

Form of g(x)Guess for ypExample
Polynomial: aₙxⁿ + … + a₀Aₙxⁿ + Aₙ₋₁xⁿ⁻¹ + … + A₀g = 3x² → yp = Ax² + Bx + C
Exponential: keαxke^{αx}AeαxAe^{αx}g = 5e2x5e^{2x} → yp = Ae2xAe^{2x}
Sine / Cosine: k sin(βx) or k cos(βx)A cos(βx) + B sin(βx)g = 4 sin(3x) → yp = A cos(3x) + B sin(3x)
Product / SumProduct / Sum of individual guessesg = xexxe^{x} → yp = (Ax + B)exe^{x}

Standard guess forms for the method of undetermined coefficients

⚠

Watch Out: The Modification Rule

If your initial guess for yp happens to be a solution of the homogeneous equation (i.e., it already appears in yc), you must multiply your guess by x. If the modified guess is still in yc, multiply by x again. This prevents the particular solution from being absorbed into the complementary solution.
Decision Flowchart: Choosing the Right Guess for ypIdentify g(x)What type of function is g(x)?PolynomialGuess: Aₙxⁿ+…+A₀ExponentialGuess: Ae^(αx)Sine / CosineA cos + B sinDoes your guess duplicate a yc term?(Check if guess solves homogeneous eqn)No duplicateUse guess as-isDuplicate found!Multiply guess by xYESYESNO
This flowchart guides you through selecting the correct form for your particular solution guess. Start at the top by identifying g(x), choose the matching type, then check for duplication with yc. If there's a conflict, multiply your guess by x.

SECTION 6

Worked Example

Let's solve the equation y″ − 3y′ − 4y = 3e²ˣ completely, using the superposition principle to assemble the general solution.

Solve y″ − 3y′ − 4y = 3e2x3e^{2x}

  1. 1

    Step 1 — Write the characteristic equation

    Set g(x) = 0 to get the homogeneous equation y″ − 3y′ − 4y = 0. Replace y with erxe^{rx} and divide through to get the characteristic equation: r² − 3r − 4 = 0.
    r² − 3r − 4 = 0
  2. 2

    Step 2 — Solve for r

    Factor the characteristic equation: (r − 4)(r + 1) = 0. So r₁ = 4 and r₂ = −1. These are real and distinct roots.
    r₁ = 4, r₂ = −1
  3. 3

    Step 3 — Write the complementary solution yc

    Using the standard form for distinct real roots: yc = c₁e4xe^{4x} + c₂e−xe^{−x}. This captures every solution to the homogeneous equation.
    yc = c₁e4xe^{4x} + c₂e−xe^{−x}
  4. 4

    Step 4 — Guess the particular solution yp

    Since g(x) = 3e2x3e^{2x} is an exponential, we guess yp = Ae2xAe^{2x}. We check: does e2xe^{2x} appear in yc? The terms in yc use e4xe^{4x} and e−xe^{−x}, so there is no duplication. Our guess is fine as-is.
    Guess: yp = Ae2xAe^{2x}
  5. 5

    Step 5 — Compute derivatives and substitute

    Compute yp′ = 2Ae2x2Ae^{2x} and yp″ = 4Ae2x4Ae^{2x}. Substitute into the ODE: 4Ae2x4Ae^{2x} − 3(2Ae2x2Ae^{2x}) − 4(Ae2xAe^{2x}) = 3e2x3e^{2x}. Simplify the left side: (4A − 6A − 4A)e2xe^{2x} = −6Ae2x6Ae^{2x}. Set this equal to 3e2x3e^{2x}.
    −6Ae2x6Ae^{2x} = 3e2x3e^{2x}
  6. 6

    Step 6 — Solve for A

    Divide both sides by e2xe^{2x} (never zero): −6A = 3, so A = −1/2.
    A = −1/2, so yp = −(1/2)e2xe^{2x}
  7. 7

    Step 7 — Write the general solution

    By the superposition principle, the general solution is y = yc + yp.
    y = c₁e4xe^{4x} + c₂e−xe^{−x} − (1/2)e2xe^{2x}
💡

Verification Tip

You can always verify your particular solution by substituting yp back into the original ODE. If both sides match, you've done it correctly. This is one of the great things about differential equations—you can check your own work!

SECTION 7

Comparing Methods for Finding yp

There are two main methods for finding a particular solution. Each has strengths and limitations, so knowing both helps you pick the right tool for the job.

FeatureUndetermined CoefficientsVariation of Parameters
Applicable g(x) typesPolynomials, exponentials, sines, cosines, and their products/sums onlyAny continuous function g(x)
Ease of useStraightforward—guess and solve for coefficientsRequires solving integrals, which can be difficult
Coefficient typeRequires constant coefficients a and bWorks even for variable coefficients
Best forTypical textbook and engineering problemsUnusual forcing functions like ln(x) or tan(x)

Comparison of two methods for finding particular solutions

✦

KEY TAKEAWAY

Think of undetermined coefficients as a power drill—fast and efficient for standard jobs. Variation of parameters is like a hand saw—it handles any shape, but requires more effort. Master the power drill first, and keep the hand saw ready for special cases.

SECTION 8

Connection to Advanced Theory

The superposition principle you've learned here is actually a special case of a much broader idea in linear algebra and advanced mathematics. Every linear equation—whether it's a simple algebraic equation, a second-order ODE, or a partial differential equation governing heat or sound—obeys superposition. The table below shows how the ideas in this lesson connect to what you'll encounter later.

This LessonAdvanced Extension
y = yc + yp for 2nd-order ODEGeneralizes to nth-order linear ODEs with n constants in yc
Superposition of two solutionsFourier analysis: superposition of infinitely many sine/cosine solutions
Method of undetermined coefficientsOperator methods (D-operator) and Laplace transforms for efficiency
Constant-coefficient linear ODEVariable-coefficient equations (Cauchy-Euler, Bessel) using series solutions

How today's concepts connect to more advanced topics

If you continue studying differential equations, you'll see that the structure y = yc + yp appears everywhere. In electrical engineering, yc represents transient circuit behavior that fades over time, while yp represents the steady-state response to an AC voltage. In mechanical engineering, yc describes free oscillations of a spring, and yp describes forced oscillations caused by an external vibration. The mathematics stays the same; only the physical interpretation changes.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

Explain in your own words why the superposition principle works only for linear differential equations and not for nonlinear ones. What property of linearity makes it possible to add solutions together?
Show answer
The superposition principle relies on the fact that in a linear equation, the operation L acting on a sum equals the sum of the operations: L(y₁ + y₂) = L(y₁) + L(y₂), and L(c·y) = c·L(y). In a nonlinear equation, terms like y² or y·y′ break this property. For example, if L(y) = y², then L(y₁ + y₂) = (y₁ + y₂)² = y₁² + 2y₁y₂ + y₂², which is not equal to y₁² + y₂² = L(y₁) + L(y₂). The cross term 2y₁y₂ prevents solutions from adding cleanly.

Question 2: BASIC CALCULATION

Given the equation y″ + 5y′ + 6y = 0, find the complementary solution yc. (Hint: factor the characteristic equation.)
Show answer
The characteristic equation is r² + 5r + 6 = 0. Factoring gives (r + 2)(r + 3) = 0, so r₁ = −2 and r₂ = −3. Since the roots are real and distinct, the complementary solution is yc = c₁e−2xe^{−2x} + c₂e−3xe^{−3x}. These two exponential functions form a fundamental set of solutions for the homogeneous equation.

Question 3: INTERMEDIATE

Find the general solution to y″ + 5y′ + 6y = 2e−x2e^{−x}. Use undetermined coefficients for the particular solution.
Show answer
From Problem 2, yc = c₁e−2xe^{−2x} + c₂e−3xe^{−3x}. Since g(x) = 2e−x2e^{−x} and e−xe^{−x} does not appear in yc (the exponents are −2 and −3, not −1), we guess yp = Ae−xAe^{−x}. Then yp′ = −Ae−xAe^{−x} and yp″ = Ae−xAe^{−x}. Substituting: Ae−xAe^{−x} + 5(−Ae−xAe^{−x}) + 6(Ae−xAe^{−x}) = 2e−x2e^{−x}, which gives (A − 5A + 6A)e−xe^{−x} = 2Ae−x2Ae^{−x} = 2e−x2e^{−x}. So A = 1 and yp = e−xe^{−x}. The general solution is y = c₁e−2xe^{−2x} + c₂e−3xe^{−3x} + e−xe^{−x}.

Question 4: APPLIED

A spring-mass system satisfies y″ + 4y = 10 cos(3t), where y(t) is displacement in meters. Find the general solution describing the motion of the mass. What part represents free oscillation and what part represents forced oscillation?
Show answer
The characteristic equation r² + 4 = 0 gives r = ±2i, so yc = c₁ cos(2t) + c₂ sin(2t). This is the free oscillation at the natural frequency ω₀ = 2 rad/s. For yp, since g(t) = 10 cos(3t) and cos(3t) is not in yc (frequency 3 ≠ 2), guess yp = A cos(3t) + B sin(3t). Substituting: −9A cos(3t) − 9B sin(3t) + 4A cos(3t) + 4B sin(3t) = 10 cos(3t). This gives −5A = 10 and −5B = 0, so A = −2 and B = 0. Thus yp = −2 cos(3t) is the forced oscillation. The general solution is y = c₁ cos(2t) + c₂ sin(2t) − 2 cos(3t).

Question 5: CRITICAL THINKING

Consider y″ − 4y′ + 4y = e2xe^{2x}. The characteristic equation has a repeated root. Explain why the standard guess yp = Ae2xAe^{2x} fails, find the correct guess, and solve for yp.
Show answer
The characteristic equation r² − 4r + 4 = (r − 2)² = 0 gives the repeated root r = 2. So yc = c₁e2xe^{2x} + c₂xe2xxe^{2x}. The standard guess Ae2xAe^{2x} fails because it already appears in yc—substituting it into the homogeneous equation gives zero, not e2xe^{2x}. Multiplying by x once gives Axe2xAxe^{2x}, which also appears in yc. Multiplying by x again gives the guess yp = Ax²e2xe^{2x}. Computing: yp′ = A(2x + 2x²)e2xe^{2x}, yp″ = A(2 + 8x + 4x²)e2xe^{2x}. Substituting into y″ − 4y′ + 4y and simplifying, the x² and x terms cancel, leaving 2Ae2x2Ae^{2x} = e2xe^{2x}, so A = 1/2 and yp = (1/2)x²e2xe^{2x}.

SUMMARY

Lesson Summary

Summary

The superposition principle is the foundation for solving second-order linear ODEs. It states that the general solution to a non-homogeneous equation is y = yc + yp, where yc (the complementary solution) solves the homogeneous equation and contains two arbitrary constants, and yp (the particular solution) is any single solution to the full non-homogeneous equation.

To find yp, the method of undetermined coefficients provides a systematic approach: guess a form for yp based on g(x), substitute into the ODE, and solve for the unknown coefficients. If your guess duplicates a term in yc, apply the modification rule by multiplying by x. The complementary solution represents the system's natural behavior, while the particular solution captures its forced response. Together, they give you the complete picture.

Varsity Tutors • Differential Equations • Superposition & Particular Solutions