4.6.15 · D3Ordinary Differential Equations

Worked examples — Non-homogeneous — variation of parameters

2,522 words11 min readBack to topic

This page is a shooting range. The parent note built the machine; here we fire it at every kind of target so you never meet a case you haven't already solved.

Before we start, one reminder of the whole recipe, so every example below reads the same way:


The scenario matrix

Think of "what could the problem throw at me?" as a grid. Each row is a case class; the last column names the example that handles it.

# Case class What makes it tricky Handled by
A Distinct real roots, exponential , RHS overlaps a homogeneous solution (resonance) Ex. 1
B Complex roots, RHS undoable by undetermined coeff. () has a genuine singularity; watch the domain Ex. 2
C Repeated root, polynomial-ish , the "" factor changes Ex. 3
D Cauchy–Euler (non-constant coefficients) Must divide by first; is not the raw RHS Ex. 4
E Degenerate: The sanity check — method must return Ex. 5
F Sign / quadrant care: , log appears needs $ x
G Definite-integral form (no elementary antiderivative) Answer stays as an integral — that's allowed Ex. 7
H Real-world word problem (forced spring, no damping, off-resonance) Translate physics → ODE → VoP Ex. 8

We now hit each cell.


Example 1 — Cell A: distinct roots, resonant exponential

Forecast (guess first): the RHS is itself a homogeneous solution. Undetermined coefficients would need an extra . Do you think VoP will conjure that automatically? (Yes — watch.)

  1. Homogeneous solutions. . Why this step? is built only from these two blocks.
  2. Standard form. Coefficient of is already , so . Why? The formula's must be the RHS of the normalized equation.
  3. Wronskian. . Why? sits in every denominator.
  4. The derivatives. Why? Straight from .
  5. Integrate. . (Drop constants.)
  6. Assemble. The is a homogeneous piece (absorb into ). So VoP produced the resonance factor by itself.

General solution: .

Recall Verify

Plug : , . . ✓ RHS matches.


Example 2 — Cell B: complex roots,

Forecast: blows up at — so the solution is only valid between those walls. Guess: the answer will contain a (the standard ).

  1. Homogeneous. . Why? Complex roots give ; here .
  2. Standard form. Already normalized, .
  3. Wronskian. .
  4. Derivatives.
  5. Integrate. (easy). For , rewrite . So Why the rewrite? isn't a standard integral; splitting it turns it into (known) minus (trivial).
  6. Assemble. The terms cancel.

General: .

Recall Verify

Let with , . . . . ✓


Example 3 — Cell C: repeated root

Forecast: repeated root , so . The is impossible for undetermined coefficients — VoP is the only tool. Guess: a and an survive.

  1. Homogeneous. , double root . Second solution via Reduction of Order: .
  2. Standard form. Normalized already, .
  3. Wronskian. , .
  4. Derivatives.
  5. Integrate (integration by parts):
  6. Assemble. Collect: terms ; non-log terms . The term is not homogeneous ( isn't in the span), so keep it.

General: .

Recall Verify

Numerically check at : at , , so . The VERIFY block confirms the residual symbolically.


Example 4 — Cell D: Cauchy–Euler, standard form trap

Forecast: the #1 error is using raw. After dividing by the real is . Guess: an shows up.

  1. Homogeneous given: , .
  2. Standard form — do NOT skip. Divide by : Why? The formula needs leading coefficient ; the RHS divided by gives .
  3. Wronskian. .
  4. Derivatives.
  5. Integrate. , .
  6. Assemble.

General: .

Recall Verify

Plug : . . ✓


Example 5 — Cell E: the degenerate check,

Forecast: with nothing forcing the system, there is nothing to absorb. Guess: .

  1. Homogeneous. , .
  2. Standard form. .
  3. Derivatives. , .
  4. Integrate. const, const — which we drop.
  5. Assemble. . Why this matters: it proves VoP is consistent — it never invents a spurious particular solution when there's no forcing. This is the "sanity anchor" every method must pass.
Recall Verify

trivially satisfies . ✓ (checked below)


Example 6 — Cell F: sign care, and the absolute value

Forecast: the antiderivative of is — the absolute value matters, and it's the reason the solution splits by sign of . Also is a non-elementary integral (the exponential integral), so the honest answer keeps an integral sign.

  1. Homogeneous. , so .
  2. Standard form. .
  3. Wronskian. .
  4. Derivatives.
  5. Integrate — cannot be done in elementary form. Keep as integrals: Why leave it? has no elementary antiderivative (it's ). A correct answer stops here — see Cell G for the clean definite-integral packaging.
  6. Sign of . The integrals are defined only where is continuous: separately on and . There is no solution crossing because has an infinite discontinuity there. This is exactly why the interval must be stated.

General (on either side): .


Example 7 — Cell G: definite-integral (Green's-function) packaging

Forecast: instead of two separate indefinite integrals, we can fuse them into one integral of times a kernel. Guess: the kernel is .

  1. Ingredients. , .
  2. VoP as definite integrals. Why definite? Using as the lower limit fixes the constants so that — a clean, unambiguous particular solution.
  3. Assemble & fuse. By the sine-subtraction identity : The kernel is the Green's function for this operator.

Why this is powerful: one formula solves the equation for every at once — you just drop your into the integrand. This is Cell A–F all packaged.

Recall Verify

Take , : . Differentiating twice (Leibniz rule) gives ; and it reproduces Ex. from the parent up to homogeneous pieces. The numeric spot-check at is in VERIFY.


Example 8 — Cell H: real-world forced oscillator

Forecast: since drive frequency () natural frequency (), no resonance — the response should be a bounded combination of and . Guess amplitude of the part .

  1. Homogeneous. , so .
  2. Standard form. .
  3. Wronskian. .
  4. Derivatives.
  5. Integrate using product-to-sum (, ):
  6. Assemble. Group with sum identities: ; . Total .
  7. Apply initial conditions. General . . ; .

Units sanity: each term is dimensionless in the pattern but represents metres; both cosines are bounded by , so m — bounded, as forecast for off-resonance. The figure shows the beat-like superposition.

Figure — Non-homogeneous — variation of parameters
Recall Verify

: . . ✓ And , . ✓


The matrix, revisited

Recall Which example filled which cell?

A resonant-exponential ::: Ex. 1 B complex roots + ::: Ex. 2 C repeated root + ::: Ex. 3 D Cauchy–Euler standard-form trap ::: Ex. 4 E degenerate ::: Ex. 5 F sign/quadrant and ::: Ex. 6 G definite-integral / Green's kernel ::: Ex. 7 H real-world forced spring with initial conditions ::: Ex. 8


Connections

  • Wronskian — the in every denominator; non-zero guarantees the linear system is solvable via Cramer's Rule.
  • Cramer's Rule — how were extracted from the system.
  • Method of Undetermined Coefficients — the shortcut that fails on Ex. 2, 3, 6, 7.
  • Second-order linear homogeneous ODE — source of .
  • Reduction of Order — how the repeated-root in Ex. 3 is found.
  • Green's function — the fused kernel of Ex. 7.