UNIHIVE

Study Hub UNIPORT MTH 340

MTH 340 · Ordinary Differential Equation

Non-homogeneous equations: undetermined coefficients and variation of parameters

Finding a particular solution by guessing its form (with the resonance rule) or by variation of parameters for any right-hand side.

Our notes

2 min read

The plan

Solve ay″ + by′ + cy = g(x) as y = y_c + y_p: y_c from the characteristic equation, y_p by one of two methods.

Method of undetermined coefficients

Works when g is a polynomial, exponential, sine, cosine, or sums and products of these.

g(x)Try y_p
polynomial of degree nAₙxⁿ + ... + A₀
ke^(ax)Ae^(ax)
k cos βx or k sin βxA cos βx + B sin βx
e^(ax) × polynomiale^(ax) × polynomial of the same degree

Resonance (modification) rule: if any term of the guess already appears in y_c, multiply the guess by x (by x² if it matches a double root).

Worked example. y″ − 3y′ + 2y = 4x. y_c = C₁eˣ + C₂e^(2x). Try y_p = Ax + B: 0 − 3A + 2(Ax + B) = 4x, so 2A = 4, A = 2, and −6 + 2B = 0, B = 3.
y = C₁eˣ + C₂e^(2x) + 2x + 3. Check y_p: 0 − 3(2) + 2(2x + 3) = 4x ✓.

Worked example (trigonometric). y″ + y′ = 2 sin x. (Here y_c = C₁ + C₂e^(−x).) Try A cos x + B sin x: y″ + y′ = (−A cos x − B sin x) + (−A sin x + B cos x) = (B − A)cos x + (−A − B) sin x. So B − A = 0 and −A − B = 2: A = B = −1. y_p = −cos x − sin x.

Worked example (resonance). y″ − y = eˣ. y_c = C₁eˣ + C₂e^(−x) already contains eˣ, so try y_p = Axeˣ. y_p′ = A(1 + x)eˣ, y_p″ = A(2 + x)eˣ. y_p″ − y_p = 2Aeˣ = eˣ, A = 1/2, y_p = ½xeˣ.

Variation of parameters

Works for any continuous g (and variable coefficients, once y₁, y₂ are known). For y″ + p y′ + q y = g (leading coefficient 1):
y_p = u₁y₁ + u₂y₂ with u₁′ = −y₂g/W, u₂′ = y₁g/W, W = W(y₁, y₂).
Worked example. y″ + y = sec x. y₁ = cos x, y₂ = sin x, W = 1.
u₁′ = −sin x sec x = −tan x, u₁ = ln|cos x|. u₂′ = cos x sec x = 1, u₂ = x.
y_p = cos x ln|cos x| + x sin x.
Check: y_p′ = −sin x ln|cos x| − sin x + sin x + x cos x = −sin x ln|cos x| + x cos x. y_p″ = −cos x ln|cos x| + sin² x/cos x + cos x − x sin x. Then y_p″ + y_p = sin² x/cos x + cos x = (sin² x + cos² x)/cos x = sec x ✓.
(Undetermined coefficients cannot handle sec x.)

Superposition of right-hand sides

If g = g₁ + g₂, find y_p for each and add.

Exams usually ask: solve non-homogeneous equations with polynomial, exponential and trigonometric right-hand sides; apply the resonance rule; use variation of parameters (often with sec x, tan x, eˣ/x); then fit initial conditions to the full solution.

Common mistake: fitting the initial conditions to y_c alone before adding y_p. The constants are found from y = y_c + y_p.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All MTH 340 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.