mindstair

Home / Courses / Differential Equations / Unit 5

Differential Equations Unit 5: Nonhomogeneous equations

For nonhomogeneous equations, the general solution is the homogeneous solution plus one particular solution.

Covers: Undetermined coefficients, variation of parameters

Study guide

A nonhomogeneous equation ay″ + by′ + cy = g(x) has a forcing term g(x). Its general solution is y = y_h + y_p: the general solution of the homogeneous equation (from the characteristic equation) plus any one particular solution that produces g(x).

The method of undetermined coefficients guesses y_p in the same form as g(x), with unknown coefficients. For a polynomial of degree n, guess a full polynomial of degree n; for ceᵃˣ, guess Aeᵃˣ; for sin bx or cos bx, guess A cos bx + B sin bx (both terms, even if g has only one); for products, multiply the guesses. Substitute the guess into the equation and match coefficients to solve for A, B and so on. If g is a sum, find a particular solution for each piece and add them.

The modification rule: if any term of your guess already solves the homogeneous equation, multiply the guess by x (or x² if needed) until no term duplicates a homogeneous solution.

Variation of parameters works for any g(x), including tan x, sec x or 1/x, where guessing fails. Using homogeneous solutions y₁ and y₂ and their Wronskian W, the particular solution is y_p = −y₁∫(y₂g/W) dx + y₂∫(y₁g/W) dx, with the equation in standard form (leading coefficient 1). It always works but can lead to hard integrals.

Finally, apply initial conditions to the complete solution y_h + y_p, not to y_h alone.

For p(D)y = e^(at), where p is the characteristic polynomial, a particular solution is y_p = e^(at)/p(a), provided p(a) ≠ 0. If a is a simple root of p, use y_p = te^(at)/p′(a) instead. This is the resonant case of the modification rule. To handle forcing F₀cos ωt, solve the same equation with F₀e^(iωt) on the right, using the exponential response formula with a = iω. The real part of that complex solution solves the cosine problem, and the imaginary part solves the sine problem.

For constant-coefficient equations, if input g(t) produces the particular solution y(t), then input g(t − a) produces y(t − a), and input c·g(t) produces c·y(t). A phase-shifted sinusoid is just a time-shifted one, so its response is shifted by the same time.

Key ideas

Formulas and rules

y = y_h + y_p
Variation of parameters: y_p = −y₁∫(y₂g/W)dx + y₂∫(y₁g/W)dx

Common mistakes

Words to know

Structure of the general solution
y = y_h + y_p
Guess for exponential forcing
For g(x) = ceᵃˣ, try y_p = Aeᵃˣ.
Guess for trig forcing
For sin bx or cos bx, try y_p = A cos bx + B sin bx.
Modification rule (undetermined coefficients)
If a guess solves the homogeneous equation, multiply it by x (or x²).
Variation of parameters
For forcing terms like tan x that undetermined coefficients can't handle.
Nonhomogeneous equation
ay″ + by′ + cy = g(x) with g ≠ 0.
General solution (nonhomogeneous)
y = y_h + y_p
Particular solution (y_p)
Any one solution that produces g(x).
Method of undetermined coefficients
Guess y_p in the form of g with unknown coefficients.
Guess for polynomial forcing
A full polynomial of the same degree.
Variation of parameters formula
y_p = −y₁∫(y₂g/W)dx + y₂∫(y₁g/W)dx

Sample practice questions

15 more questions like these, from level 1 to 5, are in the practice set.

Question 1 (level 1)

Form of y_p for y″ + y = 3x.

  1. A sin x
  2. Aeˣ
  3. Ax + B
  4. Ax
Show the answer and steps

Answer: C) Ax + B

  1. The right side 3x is a degree-1 polynomial.
  2. Guess y_p = Ax + B.
Question 2 (level 2)

Form of y_p for y″ − y = e^(2x).

  1. A cos 2x
  2. Aeˣ
  3. Axe^(2x)
  4. Ae^(2x)
Show the answer and steps

Answer: D) Ae^(2x)

  1. e^(2x) is not a solution of y″ − y = 0 (roots ±1).
  2. Guess y_p = Ae^(2x).
Question 3 (level 3)

Form of y_p for y″ − y = eˣ.

  1. Ax²eˣ
  2. Axeˣ
  3. Aeˣ
  4. Ae^(−x)
Show the answer and steps

Answer: B) Axeˣ

  1. eˣ already solves y″ − y = 0.
  2. Multiply the guess by x: y_p = Axeˣ.