MTH 340 · Ordinary Differential Equation
Our notes
2 min readThe 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 n | Aₙxⁿ + ... + A₀ |
| ke^(ax) | Ae^(ax) |
| k cos βx or k sin βx | A cos βx + B sin βx |
| e^(ax) × polynomial | e^(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
-
Best pick Calculus Volume 3, 7.2 Nonhomogeneous Linear Equations
(opens openstax.org in a new tab)
OpenStax, Calculus Volume 3, 7.2 Nonhomogeneous Linear Equations, CC BY-NC-SA 4.0 · licence
-
NOUN MTH 421: Ordinary Differential Equations (course guide and units)
NOUN course book (PDF, about 1.2 MB). Nigerian course book: first-order methods, second-order linear equations, variation of parameters and higher order.
(opens nou.edu.ng in a new tab)
-
Differential Equations - Undetermined Coefficients
Paul's Online Notes: worked examples step by step. About 0.5 MB a page.
(opens tutorial.math.lamar.edu in a new tab)
-
Differential Equations - Variation of Parameters
Paul's Online Notes: worked examples step by step. About 0.5 MB a page.
(opens tutorial.math.lamar.edu in a new tab)
-
Lebl, Notes on Diffy Qs: Differential Equations for Engineers
A whole free textbook: read online or download the PDF (about 4 MB). Every MTH 340 topic, with exercises and answers.
(opens jirka.org in a new tab)
Jiří Lebl, Notes on Diffy Qs, CC BY-NC-SA 4.0 · licence
Watch
-
Linear Second-Order Differential Equations Part 2: Non-Homogeneous Differential Equations
10 min · ≈ 45 MB · about ₦25
(opens youtube.com in a new tab)
-
Undetermined Coefficients: Solving non-homogeneous ODEs
13 min · ≈ 59 MB · about ₦33
(opens youtube.com in a new tab)
-
Variation of Parameters || How to solve non-homogeneous ODEs
11 min · ≈ 50 MB · about ₦28
(opens youtube.com in a new tab)
-
Undetermined coefficients 1 | Second order differential equations | Khan Academy
10 min · ≈ 45 MB · about ₦25
(opens youtube.com in a new tab)
-
Lec 13 | MIT 18.03 Differential Equations, Spring 2006
48 min · ≈ 216 MB · about ₦121
(opens youtube.com in a new tab)
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.