Worked examples — Non-homogeneous — variation of parameters
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.)
- Homogeneous solutions. . Why this step? is built only from these two blocks.
- Standard form. Coefficient of is already , so . Why? The formula's must be the RHS of the normalized equation.
- Wronskian. . Why? sits in every denominator.
- The derivatives. Why? Straight from .
- Integrate. . (Drop constants.)
- 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 ).
- Homogeneous. . Why? Complex roots give ; here .
- Standard form. Already normalized, .
- Wronskian. .
- Derivatives.
- Integrate. (easy). For , rewrite . So Why the rewrite? isn't a standard integral; splitting it turns it into (known) minus (trivial).
- 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.
- Homogeneous. , double root . Second solution via Reduction of Order: .
- Standard form. Normalized already, .
- Wronskian. , .
- Derivatives.
- Integrate (integration by parts):
- 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.
- Homogeneous given: , .
- Standard form — do NOT skip. Divide by : Why? The formula needs leading coefficient ; the RHS divided by gives .
- Wronskian. .
- Derivatives.
- Integrate. , .
- Assemble.
General: .
Recall Verify
Plug : . . ✓
Example 5 — Cell E: the degenerate check,
Forecast: with nothing forcing the system, there is nothing to absorb. Guess: .
- Homogeneous. , .
- Standard form. .
- Derivatives. , .
- Integrate. const, const — which we drop.
- 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.
- Homogeneous. , so .
- Standard form. .
- Wronskian. .
- Derivatives.
- 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.
- 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 .
- Ingredients. , .
- VoP as definite integrals. Why definite? Using as the lower limit fixes the constants so that — a clean, unambiguous particular solution.
- 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 .
- Homogeneous. , so .
- Standard form. .
- Wronskian. .
- Derivatives.
- Integrate using product-to-sum (, ):
- Assemble. Group with sum identities: ; . Total .
- 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.

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.