MGU Mathematics Series — Differential Equations
Part III: Second-Order Linear Differential Equations
Complementary · Particular · Undetermined Coefficients · Resonance
Chapter 8 of 14
MGU Mathematics Series  ·  Differential Equations  ·  Library Textbook Edition

Chapter 8:
Nonhomogeneous
Second-Order Equations

Forcing functions, complementary and particular solutions, undetermined coefficients, resonance, variation of parameters, and the mathematics of driven systems

■ Math Level: Differential Equations ■

■ 14 Sections  •  Part III of 5 ■

Follows Chapter 7: Mechanical Vibrations and Oscillations  ·  Prepares students for Chapter 9: Systems of Differential Equations

Purpose and Overview

Every system in the real world receives input. A spring is pushed. A circuit is connected to a power source. A population faces seasonal forcing. A mechanical structure vibrates under an external load. The differential equations that describe these systems are not homogeneous. They are nonhomogeneous equations, equations where the right side is not zero but a function that drives or forces the system.

Chapter 8 builds directly on the work of Chapters 6 and 7. Those chapters established the theory and behavior of homogeneous second-order equations, equations of the form $ay'' + by' + cy = 0$, where the system evolves entirely on its own. This chapter introduces what happens when a forcing function $g(x)$ appears on the right side: $ay'' + by' + cy = g(x)$.

The central insight of this chapter is structural. The complete response of a nonhomogeneous system is always the sum of two parts: the natural behavior of the system without forcing, called the complementary solution, and a particular response to the specific forcing function, called the particular solution. Understanding this structure is as important as knowing how to compute it.

The main solution strategy introduced in this chapter is the method of undetermined coefficients, a powerful and systematic method for finding particular solutions when the forcing function belongs to a recognizable family of functions such as polynomials, exponentials, sines and cosines, and their combinations. A second strategy, variation of parameters, is introduced at the end of the chapter as a more general method that applies to forcing functions not handled by undetermined coefficients.

This chapter also introduces the resonance phenomenon, a situation where the forcing function matches the natural behavior of the system and the particular solution must be modified. Resonance is one of the most important ideas in applied differential equations, with consequences for mechanical design, electrical engineering, and structural safety.

Opening Question

A mass on a spring is pulled slightly and released. Without any external influence, it oscillates with gradually decreasing amplitude because of friction in the system. Now, suppose someone begins pushing the spring periodically with a force that varies as a cosine function of time. What happens to the motion? Does the same oscillation continue, or does the driving force change the behavior? If the driving frequency matches the natural frequency of the spring, something remarkable happens. This chapter explains the mathematics behind that phenomenon and provides the tools to analyze it precisely.

14Sections
10Objectives
17Key Terms
12+Worked Examples

Learning Objectives

  1. 1Explain the difference between homogeneous and nonhomogeneous second-order equations.
  2. 2Identify the complementary solution and its role in the general solution.
  3. 3Explain what a particular solution is and why it is needed.
  4. 4State the general solution structure: $y = y_c + y_p$.
  5. 5Apply the method of undetermined coefficients to polynomial, exponential, trigonometric, and mixed forcing functions.
  6. 6Recognize when a trial form must be modified due to resonance.
  7. 7Apply the resonance correction by multiplying the trial form by $x$.
  8. 8Use variation of parameters to find particular solutions when undetermined coefficients does not apply.
  9. 9Interpret solutions physically in terms of natural response and forced response.
  10. 10Identify common errors in the method of undetermined coefficients and avoid them.

Sections at a Glance

Sections 8.1 – 8.4
The Structure of Nonhomogeneous Solutions
Homogeneous vs. Nonhomogeneous · Complementary Solution · Particular Solution · General Solution Structure

Homogeneous Versus Nonhomogeneous Equations

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

$$ay'' + by' + cy = g(x)$$

where $a$, $b$, and $c$ are constants with $a \neq 0$, and $g(x)$ is a function of the independent variable $x$.

When $g(x) = 0$, the equation is called homogeneous. This is the equation studied throughout Chapters 6 and 7. Its solutions describe how a system evolves from given initial conditions with no external driving force. The solutions are built entirely from the characteristic roots $r_1$ and $r_2$ of the characteristic equation $ar^2 + br + c = 0$.

When $g(x) \neq 0$, the equation is called nonhomogeneous. The function $g(x)$ is called the forcing function or the input. It represents something outside the system that is being applied to it, an external force, a voltage source, a periodic push, a constant load, or any function that drives the system's behavior.

The key difference between homogeneous and nonhomogeneous equations is not just computational. It is conceptual. A homogeneous equation describes a system that is free, evolving on its own from initial conditions. A nonhomogeneous equation describes a system that is driven, responding to both its own natural tendency and to an imposed input.

Examples of Nonhomogeneous Equations

EquationForcing Function $g(x)$Type of Forcing
$y'' + 4y' + 4y = e^{2x}$$e^{2x}$Exponential
$y'' - y = 3x^2 + 1$$3x^2 + 1$Polynomial
$y'' + 9y = \cos(2x)$$\cos(2x)$Trigonometric
$2y'' + 3y' - y = xe^x - 5$$xe^x - 5$Mixed
What is Not Nonhomogeneous in This Sense

A nonlinear equation such as $y'' + y^2 = \sin(x)$ is not covered by the linear theory of this chapter. The methods here apply specifically to linear equations, where the left side is linear in $y$, $y'$, and $y''$.

Student Note

Students sometimes confuse the term "nonhomogeneous" with "complicated." Many nonhomogeneous equations are actually not difficult once you know the method. The right side $g(x)$ gives you information. It tells you what kind of particular solution to expect. Recognizing the type of forcing function is one of the most important skills in this chapter.

Complementary Solutions

Before solving a nonhomogeneous equation, it is necessary to solve the associated homogeneous equation, obtained by replacing the right side with zero. The general solution of this homogeneous equation is called the complementary solution and is written $y_c$.

The complementary solution is determined by the characteristic equation $ar^2 + br + c = 0$. The form of $y_c$ depends on the nature of the roots.

Three Cases for $y_c$

Case 1: Two real distinct roots $r_1 \neq r_2$.

$$y_c = C_1 e^{r_1 x} + C_2 e^{r_2 x}$$

Case 2: One repeated real root $r_1 = r_2 = r$.

$$y_c = C_1 e^{rx} + C_2 x e^{rx}$$

Case 3: Complex conjugate roots $r = \alpha \pm \beta i$.

$$y_c = e^{\alpha x}(C_1 \cos(\beta x) + C_2 \sin(\beta x))$$

The complementary solution captures the natural behavior of the system, the way it would respond if left entirely on its own without any external forcing. In a damped mechanical system, this is the decaying oscillation. In an undamped spring, this is the steady oscillation. You cannot find the complete solution to a nonhomogeneous equation without first understanding the complementary solution.

Example 8.2.1
Finding the complementary solution
  • ProblemFind $y_c$ for $y'' + 5y' + 6y = e^{2x}$.
  • ThinkSet the right side equal to zero. The forcing function plays no role here. Only the left side matters for $y_c$.
  • SolveCharacteristic equation: $r^2 + 5r + 6 = 0$. Factor: $(r + 2)(r + 3) = 0$, giving $r_1 = -2$ and $r_2 = -3$. Real distinct roots, so: y_c = C₁e^{−2x} + C₂e^{−3x}
  • NoteThe forcing function $e^{2x}$ on the right side plays no role in finding $y_c$. The complementary solution depends only on the left side of the equation.
$y_c = C_1 e^{-2x} + C_2 e^{-3x}$

Particular Solutions

A particular solution, written $y_p$, is any single function that satisfies the nonhomogeneous equation $ay'' + by' + cy = g(x)$. The word "particular" means that $y_p$ is not a family of solutions. It is one specific solution, typically with no arbitrary constants. Its entire job is to balance the equation by accounting for the forcing function $g(x)$.

Unlike the complementary solution, $y_p$ does not satisfy the homogeneous equation. If you substitute $y_p$ into $ay'' + by' + cy$, you do not get zero. You get $g(x)$.

In a physical system, the particular solution represents the forced response, the way the system behaves because of the external input. If you apply a sinusoidal voltage to a circuit, the particular solution describes the steady oscillation driven by that voltage. The particular solution depends entirely on $g(x)$. Different forcing functions produce different particular solutions.

Two Methods for Finding $y_p$

Method of undetermined coefficients: Works when $g(x)$ is a polynomial, an exponential, a sine or cosine, or a combination. This is the primary method of this chapter.

Variation of parameters: A more general method that works for any continuous $g(x)$. Introduced in Section 8.11.

General Solution Structure

Theorem — General Solution of a Nonhomogeneous Equation

Let $y_c$ be the general solution of $ay'' + by' + cy = 0$, and let $y_p$ be any particular solution of $ay'' + by' + cy = g(x)$. Then the general solution of the nonhomogeneous equation is:

$$y = y_c + y_p$$

This is the most important equation in Chapter 8.

Why this works. Suppose $y = y_c + y_p$. Substitute into the nonhomogeneous equation. By linearity: $(ay_c'' + by_c' + cy_c) + (ay_p'' + by_p' + cy_p) = g(x)$. The first group equals zero because $y_c$ satisfies the homogeneous equation. The second group equals $g(x)$ because $y_p$ satisfies the nonhomogeneous equation. The sum is $0 + g(x) = g(x)$. The equation is satisfied.

The general solution $y = y_c + y_p$ contains exactly two arbitrary constants, both from $y_c$. The particular solution $y_p$ contributes no new constants. When initial conditions are given, substitute them into the complete expression $y_c + y_p$ and solve for $C_1$ and $C_2$.

Critical Warning — Initial Conditions

Students sometimes apply initial conditions to $y_c$ alone, before $y_p$ has been found, and then add $y_p$ afterward. This is incorrect. Initial conditions must be applied to the complete expression $y = y_c + y_p$. The constants $C_1$ and $C_2$ depend on both $y_c$ and $y_p$ together.

Example 8.4.1
Applying initial conditions to the full general solution
  • SetupSuppose $y_c = C_1 e^{-2x} + C_2 e^{-3x}$ and $y_p = \tfrac{1}{12}e^{2x}$. Initial conditions: $y(0) = 1$, $y'(0) = 0$.
  • CombineGeneral solution: $y = C_1 e^{-2x} + C_2 e^{-3x} + \tfrac{1}{12}e^{2x}$. Differentiate: $y' = -2C_1 e^{-2x} - 3C_2 e^{-3x} + \tfrac{1}{6}e^{2x}$.
  • Apply IC y(0) = 1: C₁ + C₂ + 1/12 = 1 → C₁ + C₂ = 11/12 y′(0) = 0: −2C₁ − 3C₂ + 1/6 = 0 → −2C₁ − 3C₂ = −1/6
  • SolveFrom the system: $C_2 = -5/3$, $C_1 = 31/12$.
$y = \dfrac{31}{12}e^{-2x} - \dfrac{5}{3}e^{-3x} + \dfrac{1}{12}e^{2x}$
Sections 8.5 – 8.9
The Method of Undetermined Coefficients
The Family Table · Polynomial Forcing · Exponential Forcing · Trigonometric Forcing · Mixed Forcing

Method of Undetermined Coefficients

The method of undetermined coefficients is a strategy for finding a particular solution $y_p$ when the forcing function $g(x)$ belongs to a recognizable family. The core idea is to guess a trial solution of the same general form as $g(x)$, with unknown coefficients, and then determine those coefficients by substituting the trial solution into the differential equation.

The method works because differentiation keeps certain families of functions within themselves. Differentiating a polynomial yields a polynomial. Differentiating $e^{kx}$ yields another exponential of the same type. Differentiating $\sin(\beta x)$ or $\cos(\beta x)$ yields functions in the same trigonometric family. This predictability is what makes the guess work.

The Family Table

Forcing Function $g(x)$Trial Form for $y_p$
$P_n(x)$ — polynomial of degree $n$$A_n x^n + A_{n-1}x^{n-1} + \cdots + A_1 x + A_0$
$e^{kx}$$Ae^{kx}$
$\sin(\beta x)$ or $\cos(\beta x)$$A\cos(\beta x) + B\sin(\beta x)$
$P_n(x)e^{kx}$$(A_n x^n + \cdots + A_0)e^{kx}$
$e^{kx}\sin(\beta x)$ or $e^{kx}\cos(\beta x)$$e^{kx}(A\cos(\beta x) + B\sin(\beta x))$
Both Sine and Cosine Are Always Required

If $g(x)$ involves $\cos(\beta x)$ alone, the trial form must still include both $\cos(\beta x)$ and $\sin(\beta x)$. Similarly for $\sin(\beta x)$ alone. Differentiation connects them, so both must be present.

The General Procedure

1. Find $y_c$ by solving the associated homogeneous equation.

2. Identify the form of $g(x)$ and write the trial form $y_p$ with undetermined coefficients.

3. Check whether any term in $y_p$ duplicates a term in $y_c$. If so, multiply by $x$ (see Section 8.10).

4. Substitute $y_p$ into $ay'' + by' + cy = g(x)$.

5. Collect terms and match coefficients to determine the unknowns.

6. Write the general solution $y = y_c + y_p$.

7. Apply initial conditions to $y_c + y_p$ to find $C_1$ and $C_2$ if given.

Polynomial Forcing

When $g(x)$ is a polynomial of degree $n$, the trial particular solution is also a polynomial of degree $n$ with undetermined coefficients. Even if some intermediate terms are missing from $g(x)$, the trial form must include all terms from the highest degree down to the constant. For example, if $g(x) = x^2 + 1$, the trial form is $Ax^2 + Bx + C$, not $Ax^2 + C$, because differentiation will generate terms of all intermediate degrees when you substitute.

Example 8.6.1
Polynomial forcing — matching all powers
  • ProblemSolve $y'' + y' - 2y = x^2$.
  • ThinkThe forcing function is degree 2. The trial form is $Ax^2 + Bx + C$. Find $y_c$ first.
  • Find $y_c$Characteristic equation: $r^2 + r - 2 = (r+2)(r-1) = 0$. Roots: $r_1 = -2$, $r_2 = 1$. y_c = C₁e^{−2x} + C₂eˣ
  • Trial$y_p = Ax^2 + Bx + C$. No term in $y_p$ appears in $y_c$. No resonance. Differentiate: $y_p' = 2Ax + B$, $y_p'' = 2A$.
  • Substitute 2A + (2Ax + B) − 2(Ax² + Bx + C) = x² −2Ax² + (2A − 2B)x + (2A + B − 2C) = x² + 0·x + 0
  • Match$x^2$: $-2A = 1 \Rightarrow A = -\tfrac{1}{2}$.   $x$: $2A - 2B = 0 \Rightarrow B = -\tfrac{1}{2}$.   Constant: $2A + B - 2C = 0 \Rightarrow C = -\tfrac{3}{4}$.
  • Check$y_p'' + y_p' - 2y_p = (-1) + (-x - \tfrac{1}{2}) - 2(-\tfrac{1}{2}x^2 - \tfrac{1}{2}x - \tfrac{3}{4}) = x^2$ ✓
  • InterpretThe polynomial forcing produces a polynomial particular solution. The terms in $y_c$ decay as $x \to \infty$, so the long-term behavior is dominated by $y_p$.
$y = C_1 e^{-2x} + C_2 e^x - \dfrac{1}{2}x^2 - \dfrac{1}{2}x - \dfrac{3}{4}$
Special Case — When $c = 0$

If the equation has the form $ay'' + by' = g(x)$, a constant trial $A$ satisfies $a(0) + b(0) + 0 = 0$, not $g(x)$. The degree of the polynomial trial form must be raised by one. If $g(x)$ is degree $n$, use a trial of degree $n+1$. This is a special instance of the resonance correction.

Exponential Forcing

When $g(x) = Pe^{kx}$, the natural trial form for $y_p$ is $Ae^{kx}$. Differentiating an exponential produces another exponential with the same exponent, so substitution works cleanly.

Example 8.7.1
Exponential forcing
  • ProblemSolve $y'' + 5y' + 6y = 4e^{2x}$.
  • Find $y_c$From Example 8.2.1: $y_c = C_1 e^{-2x} + C_2 e^{-3x}$.
  • Trial$y_p = Ae^{2x}$. The exponent $k = 2$ is not a characteristic root. No resonance.
  • Substitute 4Ae²ˣ + 10Ae²ˣ + 6Ae²ˣ = 4e²ˣ 20Ae²ˣ = 4e²ˣ → A = 1/5
  • Check$y_p'' + 5y_p' + 6y_p = \tfrac{4}{5} + \tfrac{10}{5} + \tfrac{6}{5} = \tfrac{20}{5}e^{2x} = 4e^{2x}$ ✓
  • InterpretThe complementary terms $C_1 e^{-2x}$ and $C_2 e^{-3x}$ decay. For large $x$, the growing particular solution $\tfrac{1}{5}e^{2x}$ dominates.
$y = C_1 e^{-2x} + C_2 e^{-3x} + \dfrac{1}{5}e^{2x}$
Shortcut for Pure Exponential Forcing

When $y_p = Ae^{kx}$ and $g(x) = Pe^{kx}$, substitution gives $A(ak^2 + bk + c) = P$, so $A = P / (ak^2 + bk + c)$, provided $ak^2 + bk + c \neq 0$. When this expression equals zero, $k$ is a characteristic root and the resonance correction is needed.

Trigonometric Forcing

When $g(x)$ involves $\sin(\beta x)$, $\cos(\beta x)$, or a combination, the trial form must include both sine and cosine:

$$y_p = A\cos(\beta x) + B\sin(\beta x)$$

The reason both are needed is that differentiation connects them. When you differentiate $\cos(\beta x)$, you get $-\beta\sin(\beta x)$. Substituting into the equation will produce terms involving both functions, and you need coefficients for both to match them.

Example 8.8.1
Trigonometric forcing — non-resonant case
  • ProblemSolve $y'' + 4y = \cos(3x)$.
  • Find $y_c$Characteristic equation: $r^2 + 4 = 0 \Rightarrow r = \pm 2i$. y_c = C₁cos(2x) + C₂sin(2x)
  • TrialNatural frequency is 2; forcing frequency is 3. No resonance. Use $y_p = A\cos(3x) + B\sin(3x)$.
  • Substitute$y_p'' + 4y_p = -9A\cos(3x) - 9B\sin(3x) + 4A\cos(3x) + 4B\sin(3x)$ = −5Acos(3x) − 5Bsin(3x) = cos(3x)
  • Match$\cos(3x)$: $-5A = 1 \Rightarrow A = -\tfrac{1}{5}$.   $\sin(3x)$: $-5B = 0 \Rightarrow B = 0$.
  • InterpretThe system oscillates naturally at frequency 2 (from $y_c$) and is driven at frequency 3 (from $y_p$). The total response is a superposition of two oscillations at different frequencies.
$y = C_1\cos(2x) + C_2\sin(2x) - \dfrac{1}{5}\cos(3x)$

Mixed Forcing Functions

When $g(x)$ is a combination of different types, use the superposition principle: solve for a particular solution for each part of $g(x)$ separately, then add the results.

Example 8.9.1
Mixed forcing — superposition
  • ProblemSolve $y'' - 3y' + 2y = 2e^{3x} + x$.
  • Find $y_c$$r^2 - 3r + 2 = (r-1)(r-2) = 0$. Roots: $r_1 = 1$, $r_2 = 2$. y_c = C₁eˣ + C₂e²ˣ
  • Part 1: $2e^{3x}$Trial: $y_{p1} = Ae^{3x}$. Substitute: $9A - 9A + 2A = 2 \Rightarrow 2A = 2 \Rightarrow A = 1$. y_{p1} = e^{3x}
  • Part 2: $x$Trial: $y_{p2} = Bx + D$. Substitute: $0 - 3B + 2Bx + 2D = x$. Matching: $2B = 1 \Rightarrow B = \tfrac{1}{2}$; $-3B + 2D = 0 \Rightarrow D = \tfrac{3}{4}$. y_{p2} = (1/2)x + 3/4
  • CheckSubstitute $y_p = e^{3x} + \tfrac{1}{2}x + \tfrac{3}{4}$ into the equation: $9e^{3x} - 9e^{3x} - \tfrac{3}{2} + 2e^{3x} + x + \tfrac{3}{2} = 2e^{3x} + x$ ✓
  • InterpretThe forced response includes a growing exponential from $2e^{3x}$ and a linear term from polynomial forcing. Both contribute permanently to the total behavior.
$y = C_1 e^x + C_2 e^{2x} + e^{3x} + \dfrac{1}{2}x + \dfrac{3}{4}$
Sections 8.10 – 8.11
Resonance and Variation of Parameters
Repeated Trial Forms · Pure Resonance · Variation of Parameters · The Wronskian · When to Use Each Method

Resonance and Repeated Trial Forms

The method of undetermined coefficients encounters a critical problem when the trial form $y_p$ happens to be a solution of the homogeneous equation. When this happens, substituting $y_p$ into $ay'' + by' + cy$ produces zero, not $g(x)$. The trial fails completely.

This situation is called resonance, and it occurs when a term in $g(x)$ matches a term in $y_c$. The correction is to multiply the offending trial form by $x$. If the problem persists (as in the case of a repeated root), multiply by $x^2$.

The Resonance Rule

Before writing a trial form, compare it to $y_c$. If any term of the trial matches any term of $y_c$, multiply the entire trial form by $x$. Repeat if necessary until no term of the trial matches $y_c$.

Example 8.10.1
Resonance — repeated characteristic root
  • ProblemSolve $y'' - 4y' + 4y = e^{2x}$.
  • Find $y_c$$r^2 - 4r + 4 = (r-2)^2 = 0$. Repeated root $r = 2$. y_c = C₁e²ˣ + C₂xe²ˣ
  • ResonanceStandard trial $Ae^{2x}$ is in $y_c$. Multiply by $x$: try $Axe^{2x}$. But $xe^{2x}$ is also in $y_c$. Multiply again. Use: y_p = Ax²e²ˣ
  • Differentiate y_p′ = e²ˣ(2Ax + 2Ax²) y_p″ = e²ˣ(2A + 8Ax + 4Ax²)
  • Substitute$y_p'' - 4y_p' + 4y_p = e^{2x}[2A + 8Ax + 4Ax^2 - 8Ax - 8Ax^2 + 4Ax^2] = 2Ae^{2x}$. Set equal to $e^{2x}$: $A = \tfrac{1}{2}$.
  • InterpretThe particular solution grows as $x^2 e^{2x}$, much faster than the forcing function $e^{2x}$. Double resonance amplifies the response significantly.
$y = C_1 e^{2x} + C_2 x e^{2x} + \dfrac{1}{2}x^2 e^{2x}$
Example 8.10.2
Pure trigonometric resonance
  • ProblemSolve $y'' + 9y = \cos(3x)$. The system's natural frequency and forcing frequency are both 3.
  • Find $y_c$$r^2 + 9 = 0 \Rightarrow r = \pm 3i$. y_c = C₁cos(3x) + C₂sin(3x)
  • ResonanceStandard trial $A\cos(3x) + B\sin(3x)$ duplicates all terms of $y_c$. Multiply by $x$: y_p = Ax·cos(3x) + Bx·sin(3x)
  • Differentiate y_p″ = −6Asin(3x) − 9Axcos(3x) + 6Bcos(3x) − 9Bxsin(3x)
  • Substitute$y_p'' + 9y_p = 6B\cos(3x) - 6A\sin(3x)$. Set equal to $\cos(3x)$: $6B = 1 \Rightarrow B = \tfrac{1}{6}$; $-6A = 0 \Rightarrow A = 0$.
  • InterpretThe particular solution $\tfrac{1}{6}x\sin(3x)$ oscillates with growing amplitude. The factor of $x$ causes the response to grow without bound. In physical systems, this is a dangerous phenomenon. Real structures are designed to avoid it.
$y = C_1\cos(3x) + C_2\sin(3x) + \dfrac{1}{6}x\sin(3x)$

Variation of Parameters as an Introduction

The method of undetermined coefficients is powerful but limited. It works only when $g(x)$ belongs to the recognizable families listed in Section 8.5. If $g(x) = \sec(x)$, $\ln(x)$, or $\tfrac{1}{x}$, undetermined coefficients fails.

Variation of parameters is a more general method that produces a particular solution for any continuous forcing function $g(x)$. It starts from the complementary solution $y_c = C_1 y_1(x) + C_2 y_2(x)$ and replaces the constants $C_1$ and $C_2$ with unknown functions $u_1(x)$ and $u_2(x)$, then determines those functions by requiring $y_p = u_1 y_1 + u_2 y_2$ to satisfy the nonhomogeneous equation.

Variation of Parameters Formulas

For $y'' + p(x)y' + q(x)y = g(x)$ (divide by leading coefficient first), with Wronskian $W = y_1 y_2' - y_2 y_1'$:

$$u_1' = \frac{-y_2\,g(x)}{W}, \qquad u_2' = \frac{y_1\,g(x)}{W}$$

Then integrate: $u_1 = \int u_1'\,dx$, $u_2 = \int u_2'\,dx$, and $y_p = u_1 y_1 + u_2 y_2$.

Example 8.11.1
Variation of parameters — non-standard forcing function
  • ProblemFind a particular solution for $y'' + y = \sec(x)$. Undetermined coefficients does not apply.
  • Find $y_c$$r^2 + 1 = 0 \Rightarrow r = \pm i$. So $y_1 = \cos(x)$, $y_2 = \sin(x)$.
  • Wronskian$W = \cos(x)\cos(x) - \sin(x)(-\sin(x)) = \cos^2(x) + \sin^2(x) = 1$.
  • Compute u₁′ = −sin(x)·sec(x) = −tan(x) → u₁ = ln|cos(x)| u₂′ = cos(x)·sec(x) = 1 → u₂ = x
  • Solve$y_p = \ln|\cos(x)|\cdot\cos(x) + x\sin(x)$.
  • InterpretThe forcing function $\sec(x)$ is not in the standard families, but variation of parameters still produces a valid particular solution, defined wherever $\cos(x) \neq 0$.
$y = C_1\cos(x) + C_2\sin(x) + \cos(x)\ln|\cos(x)| + x\sin(x)$

When to Use Each Method

SituationMethod
$g(x)$ is a polynomial, exponential, $\sin$, $\cos$, or product of theseUndetermined coefficients
$g(x)$ is $\sec(x)$, $\tan(x)$, $\ln(x)$, $\tfrac{1}{x}$, or any non-standard functionVariation of parameters
Resonance occursUndetermined coefficients with $x$-correction
Non-constant coefficients (e.g., $xy'' + \ldots$)Variation of parameters
Sections 8.12 – 8.14
Applications, Errors, and the Road Ahead
Engineering Models · Common Mistakes · Preparing for Laplace Transforms

Nonhomogeneous Equations in Engineering Models

The methods of this chapter apply directly to engineering, physics, circuits, and control systems. In any system where an external input drives the behavior, the governing equation is nonhomogeneous.

Forced Mass-Spring-Damper System

The equation of motion for a mass $m$ on a spring with spring constant $k$, damping coefficient $b$, and external force $F(t)$ is

$$mx'' + bx' + kx = F(t)$$

In Chapter 7, the case $F(t) = 0$ was studied. When $F(t) \neq 0$, the complementary solution $x_c$ is the transient response, and the particular solution $x_p$ is the steady-state response. If damping is present, $x_c$ decays, and after a long time only $x_p$ remains. Without damping and with forcing frequency equal to the natural frequency $\omega_0 = \sqrt{k/m}$, pure resonance occurs and amplitude grows without bound.

Series RLC Circuit

For a series RLC circuit with resistance $R$, inductance $L$, capacitance $C$, and applied EMF $E(t)$, the charge $q(t)$ satisfies

$$Lq'' + Rq' + \frac{1}{C}q = E(t)$$

This has exactly the same mathematical form as the spring-mass equation. The particular solution represents the steady-state current response to the applied EMF. The complementary solution represents the transient behavior as the circuit reaches steady state.

Example 8.12.1
Driven RLC circuit — transient and steady state
  • Problem$L = 1$ H, $R = 2$ Ω, $C = \tfrac{1}{5}$ F, $E(t) = 10\sin(2t)$ V. Solve with $q(0) = 0$, $q'(0) = 0$.
  • Equation$q'' + 2q' + 5q = 10\sin(2t)$.
  • Find $q_c$$r^2 + 2r + 5 = 0 \Rightarrow r = -1 \pm 2i$. q_c = e^{−t}(C₁cos(2t) + C₂sin(2t))
  • Trial$q_p = A\cos(2t) + B\sin(2t)$. The trial does not duplicate $q_c$ (the trial lacks the $e^{-t}$ factor). No resonance.
  • Substitute$q_p'' + 2q_p' + 5q_p = (A + 4B)\cos(2t) + (B - 4A)\sin(2t) = 10\sin(2t)$. A + 4B = 0 → A = −4B B − 4A = 10 → 17B = 10 → B = 10/17, A = −40/17
  • Apply ICWith $q(0) = 0$: $C_1 - \tfrac{40}{17} = 0 \Rightarrow C_1 = \tfrac{40}{17}$. With $q'(0) = 0$: $C_2 = \tfrac{10}{17}$.
  • InterpretThe term $e^{-t}(\cdots)$ is the transient response, decaying to zero. The term $-\tfrac{40}{17}\cos(2t) + \tfrac{10}{17}\sin(2t)$ is the steady-state response, persisting indefinitely driven by the EMF.
$q(t) = e^{-t}\!\left(\dfrac{40}{17}\cos(2t) + \dfrac{10}{17}\sin(2t)\right) - \dfrac{40}{17}\cos(2t) + \dfrac{10}{17}\sin(2t)$

Common Nonhomogeneous Equation Mistakes

Mistake 1 — Applying Initial Conditions Too Early
Apply initial conditions to $y_c$ alone, then add $y_p$ afterward.

The general solution is $y = y_c + y_p$. Initial conditions must be applied to the complete expression $y_c + y_p$. Applying them to $y_c$ alone produces wrong values of $C_1$ and $C_2$.

Mistake 2 — Forgetting Both Sine and Cosine in the Trial Form
For $g(x) = 5\sin(3x)$, write $y_p = B\sin(3x)$ only.

The trial form must include both: $y_p = A\cos(3x) + B\sin(3x)$. Differentiation produces both functions. With only one, substitution will generate an unmatched cosine term.

Mistake 3 — Not Checking for Resonance
Write the standard trial form without checking whether it duplicates a term in $y_c$.

If any term of $y_p$ appears in $y_c$, substitution gives $A \cdot 0 = g(x)$, which has no solution. Always compare the proposed trial to $y_c$ before substituting. Apply the $x$-multiplication when overlap is found.

Mistake 4 — Incomplete Polynomial Trial Form
For $g(x) = x^2 + 1$, write $y_p = Ax^2 + C$, skipping the $Bx$ term.

For a polynomial of degree $n$, always include all terms from degree $n$ down to degree 0. Missing intermediate terms leaves the system of equations under-determined, producing a contradiction.

Mistake 5 — Stopping at the Particular Solution
Find $y_p$ and report it as the general solution.

The general solution is always $y = y_c + y_p$. The particular solution alone has no arbitrary constants and cannot satisfy arbitrary initial conditions. Always include $y_c$.

Mistake 6 — Forgetting to Divide by $a$ Before Variation of Parameters
Apply variation of parameters formulas to $2y'' + \cdots = g(x)$ without dividing by 2 first.

The variation of parameters formulas are derived for the standard form $y'' + py' + qy = g(x)$ with leading coefficient 1. Divide by the leading coefficient before applying the formulas.

Mistake 7 — Absorbing $y_p$ Constants into $C_1$ and $C_2$
Treat the constants in $y_p$ as if they were the same as $C_1$ and $C_2$ in $y_c$.

$y_p$ is a fixed function with determined coefficients. The constants $C_1$ and $C_2$ in $y_c$ remain free and are determined only by initial conditions. $y_p$ does not absorb into them.

Preparing for Laplace Transforms

Chapter 10 will introduce a third approach to nonhomogeneous equations: Laplace transforms. The Laplace transform method converts the differential equation into an algebraic equation in a new variable $s$, solves algebraically, and then converts the algebraic solution back to a function of $t$. This approach has several advantages over the methods of this chapter.

First, initial conditions are incorporated directly into the algebraic equation, so there is no need to find the general solution and then apply conditions afterward. Second, the same method handles polynomial, exponential, and trigonometric forcing in a uniform way. Third, Laplace transforms extend naturally to forcing functions that are discontinuous, such as step functions and impulse functions, which the methods of this chapter cannot handle easily.

The connection between this chapter and Chapter 10 is deep. The complementary solution corresponds to the homogeneous part of the Laplace-transformed equation, and the particular solution corresponds to the forcing part. The structure $y = y_c + y_p$ is preserved in the transform framework, but the computation is reorganized in a way that is often more systematic.

Students entering Chapter 10 should be comfortable with the characteristic equation, the forms of complementary solutions, the idea of forcing functions, and the general solution structure $y = y_c + y_p$. All of this will reappear in the transform language.

Chapter Summary

Key Terms Review

nonhomogeneous equation
A linear ODE where the right side is a nonzero function $g(x)$, representing an external input or forcing.
forcing function
The function $g(x)$ on the right side of a nonhomogeneous equation. It represents an external input driving the system.
complementary solution
The general solution $y_c$ of the associated homogeneous equation $ay'' + by' + cy = 0$. Contains two arbitrary constants.
particular solution
Any single specific solution $y_p$ of the nonhomogeneous equation. Contains no arbitrary constants.
general solution structure
The theorem that the complete general solution of a nonhomogeneous equation is $y = y_c + y_p$.
undetermined coefficients
A method for finding $y_p$ by guessing a trial solution of the same family as $g(x)$ and solving for the coefficients.
trial solution
The guessed form for $y_p$ in the method of undetermined coefficients, based on the structure of $g(x)$.
resonance
The situation where the forcing frequency matches the natural frequency, causing the trial form to overlap with $y_c$ and producing unbounded growth.
repeated trial form
The corrected trial solution when resonance occurs, obtained by multiplying the standard trial by $x$ (or $x^2$ for a double root).
Wronskian
The determinant $W = y_1 y_2' - y_2 y_1'$, used in variation of parameters to construct the particular solution.
variation of parameters
A general method for finding $y_p$ for any continuous $g(x)$, using the Wronskian and integration.
transient response
The part of the solution corresponding to $y_c$. In a damped system, this decays to zero over time.
steady-state response
The part of the solution corresponding to $y_p$. This persists indefinitely as the long-term behavior of a driven system.
superposition principle
If $y_{p1}$ solves $ay'' + by' + cy = g_1$ and $y_{p2}$ solves the same equation with $g_2$, then $y_{p1} + y_{p2}$ solves it with $g_1 + g_2$.
natural response
The behavior of the system governed by $y_c$: how the system would evolve with no external input, determined by initial conditions.
forced response
The behavior governed by $y_p$: how the system responds specifically to the external input $g(x)$.
characteristic equation
The algebraic equation $ar^2 + br + c = 0$ derived from the homogeneous part of the ODE. Its roots determine the form of $y_c$.

Complementary Solution Practice

For each equation, find $y_c$ only. Do not solve for $y_p$ yet.

  1. $y'' - 5y' + 6y = e^x$
  2. $y'' + 6y' + 9y = \cos(x)$
  3. $y'' + 4y = 3x^2$
  4. $2y'' - y' - y = e^{2x} + 1$
  5. $y'' + 2y' + 5y = \sin(t)$
  6. $y'' - 4y = xe^x$
  7. $y'' + y' = x^2 - x$
  8. $4y'' - 4y' + y = e^{x/2}$
Skill PracticeUndetermined Coefficients

Find only $y_p$ for each equation. Do not include $y_c$.

  1. $y'' + y' - 2y = 6$
  2. $y'' - 3y' + 2y = 4e^{3x}$
  3. $y'' + 4y = \sin(x)$
  4. $y'' + 2y' + y = e^{-x}$
  5. $y'' + 3y' + 2y = 3x^2$
  6. $y'' - y = \cos(2x)$
  7. $y'' + 9y = \cos(3x)$
  8. $y'' - 4y' + 4y = e^{2x}$
  9. $y'' + y' - 6y = 2e^{2x}\sin(x)$
  10. $y'' - 2y' + y = xe^x$
Skill PracticeComplete General Solutions

Find the general solution $y = y_c + y_p$ for each.

  1. $y'' + y' - 6y = 4e^{2x}$
  2. $y'' + 4y' + 4y = 3xe^{-2x}$
  3. $y'' - 4y = 2\cos(x) - 3e^{2x}$
  4. $y'' + y = \sec(x)$
  5. $y'' - y' = x^3 + 2x$
  6. $y'' + 2y' + 10y = 5e^{-x}\cos(3x)$

Initial Value Problems

Find the solution satisfying the given initial conditions. Remember to apply conditions to the full solution $y_c + y_p$.

  1. $y'' + 4y = 8x$; $y(0) = 0$, $y'(0) = 1$
  2. $y'' - y = e^x$; $y(0) = 1$, $y'(0) = 0$
  3. $y'' + 2y' + y = \sin(x)$; $y(0) = 0$, $y'(0) = 0$
  4. $y'' + 9y = 2\cos(3t)$; $y(0) = 0$, $y'(0) = 1$
  5. $y'' - 4y' + 4y = e^{2t}$; $y(0) = 1$, $y'(0) = 0$
  6. $y'' + y = 2\sin(t)$; $y(0) = 1$, $y'(0) = -1$

Forced System Applications

  1. Spring with external force. A mass $m = 1$ kg on a spring with constant $k = 9$ N/m is subject to an external force $F(t) = 4\cos(2t)$ N. There is no damping. Set up and solve the equation of motion $x'' + 9x = 4\cos(2t)$. Describe the long-term behavior.
  2. Damped spring with forcing. A mass-spring system has $m = 1$, $b = 2$, $k = 5$, and external force $F(t) = 3\sin(t)$. Find the general solution. Identify the transient and steady-state parts.
  3. Resonance in a spring. A mass $m = 1$ on a spring with $k = 4$ has no damping. Apply $F(t) = 6\cos(2t)$. Solve $x'' + 4x = 6\cos(2t)$, $x(0) = 0$, $x'(0) = 0$. Describe what happens to amplitude over time.
  4. RLC circuit. An RLC circuit has $L = 1$ H, $R = 4$ Ω, $C = \tfrac{1}{5}$ F, and $E(t) = 50\cos(2t)$ V. Find $q(t)$ with $q(0) = 0$, $q'(0) = 0$. Identify transient and steady-state components.
  5. Constant forcing. A spring-mass system with $m = 2$, $b = 3$, $k = 1$ is subject to constant force $F = 4$. Find the particular solution and explain what it represents as an equilibrium displacement.
  6. Drug dosing model. A simplified pharmacokinetic model has concentration $c(t)$ satisfying $c'' + 3c' + 2c = 10$, representing constant infusion. Find the steady-state concentration (particular solution). Why does the complementary solution decaying to zero mean the steady state is reached?

Error Analysis

Each problem shows student work containing errors. Identify all errors and write the correct solution.

Problem 1

Solve $y'' + 4y' + 3y = 2e^x$, $y(0) = 0$, $y'(0) = 1$.

Student applies IC to $y_c$ alone → $C_1 = 1/4$, $C_2 = -1/4$, then adds $y_p = e^x/4$ at the end.

Identify the error. What are the correct values of $C_1$ and $C_2$?

Problem 2

Solve $y'' + y = \cos(x)$.

Trial: $y_p = A\cos(x)$ only. After substituting: $-A\cos(x) + A\cos(x) = 0 \neq \cos(x)$. Concludes: no solution.

Two errors are present. Identify both and write the correct solution.

Problem 3

Solve $y'' - 2y' + y = x$.

Trial: $y_p = Ax$. After substituting: $0 - 2A + Ax = x$. Student matches $A = 1$ from $x$-term, then concludes $-2A = 0$ forces $A = 0$. Reports contradiction.

What went wrong with the trial form? What is the correct approach?

Problem 4

Solve $y'' + 4y = 8\sin(2x)$.

Trial: $y_p = A\sin(2x)$. After substituting: $-4A\sin(2x) + 4A\sin(2x) = 0 = 8\sin(2x)$. Concludes: no solution.

What resonance step was skipped? Write the correct solution.

Chapter 8 Checkpoint

Chapter 8 Checkpoint
Complete without assistance — assesses all key skills and concepts from Chapter 8
Part A — Concepts
  1. State the general solution structure for a nonhomogeneous second-order linear equation.
  2. What is the complementary solution, and which equation does it satisfy?
  3. What is the particular solution, and which equation does it satisfy?
  4. When does resonance occur in the method of undetermined coefficients?
  5. State the resonance correction procedure.
  6. What is the Wronskian $W(y_1, y_2)$, and where is it used?
  7. Why must initial conditions be applied to the full general solution rather than to $y_c$ alone?
  8. Describe the difference between the transient response and the steady-state response of a driven system.
Part B — Skill Practice
  1. Find the general solution: $y'' - y' - 2y = 4x$
  2. Find the general solution: $y'' + 2y' + y = 3e^{-x}$
  3. Find the general solution: $y'' + 16y = 2\cos(4t)$
  4. Find the general solution: $y'' - 4y' + 4y = 6e^{2x}$
Part C — Applied Problem
  1. A mass $m = 1$ on a spring with $k = 25$ has no damping and is driven by $F(t) = 10\cos(5t)$.
    (a) Write the differential equation.
    (b) Determine whether resonance occurs. Explain why.
    (c) Find the particular solution $x_p(t)$.
    (d) Write the general solution.
    (e) Describe the long-term behavior of the position.
Part D — Error Identification
  1. A student simplifies $5(2x - 3)$ and gets $10x - 3$. What is the error? What is the correct answer?
  2. A student solves $y'' + 4y' + 4y = e^{-2x}$ and writes the trial form $y_p = Ae^{-2x}$. Then they proceed without modification. Identify the error. What trial form is correct?
Looking Ahead — Part IV
Chapter 9: Systems of Differential Equations  ·  Chapter 10: Laplace Transforms  ·  Chapter 11: Numerical Methods

Chapter 8 completes Part III. You have now studied the full range of second-order linear equations: homogeneous in Chapter 6, mechanical oscillations in Chapter 7, and nonhomogeneous equations here. Part IV expands this theory in three directions.

Chapter 9 introduces systems of differential equations, where several unknown functions change simultaneously in response to each other. The matrix framework $\mathbf{x}' = A\mathbf{x}$ and eigenvalue-eigenvector analysis extend the characteristic equation ideas you developed in Chapters 6 through 8.

Chapter 10 introduces Laplace transforms, which convert differential equations into algebraic equations in a complex frequency variable. This method handles initial conditions directly and extends naturally to discontinuous and impulsive forcing. The complementary-plus-particular structure of this chapter reappears in the transform language.

Chapter 11 introduces numerical methods for when no closed-form solution is available. Euler's method, improved Euler, and Runge-Kutta give you tools for computation when analytic methods are unavailable or impractical.

MGU Library Connection
  • MGU Physics: Forced Oscillations, Resonance, and Structural Dynamics
  • MGU Electrical Engineering: AC Circuits, Impedance, and Frequency Response
  • MGU Control Systems: Transfer Functions and Steady-State Gain
  • Chapter 10 of this textbook: Laplace Transforms (reframes $y_c + y_p$ in the frequency domain)
  • Chapter 7 of this textbook: Mechanical Vibrations and Oscillations (undamped and damped free systems)
  • Appendix I: Second-Order Characteristic Equation Reference
  • Appendix K: Undetermined Coefficients Reference
  • MGU Numerical Methods: Numerical Integration of Forced ODEs