notesonly.in

One notebook for every subject — open it anywhere.

Log in

Variation of Parameters: Solve Nonhomogeneous ODEs Easily

Variation of parameters finds a particular solution to a linear ODE even when undetermined coefficients cannot help: variable coefficients, or right-hand sides like sec x or ln x. Starting from two homogeneous solutions y1 and y2, it replaces the constants in C1y1 + C2y2 with unknown functions u1(x) and u2(x) and solves for them.

It is the universal method for linear equations: any continuous right-hand side, any known homogeneous solutions. When guess-and-match fails, this always answers, at the cost of two integrals.

Key Concepts

  • Homogeneous solutions. Known independent y1, y2 with Wronskian W = y1y2′ − y2y1′ ≠ 0.
  • Parameter functions. Seek yp = u1y1 + u2y2, with u1′y1 + u2′y2 = 0 imposed.
  • The system. u1′y1 + u2′y2 = 0 and u1′y1′ + u2′y2′ = g(x), the RHS of the standard-form equation.
  • Solution formulas. u1′ = −y2g/W, u2′ = y1g/W; integrate for u1, u2.
  • Standard form. Divide so the y″ coefficient is 1 before reading off g(x).

Formulas

  • Derivatives: u1′ = −y2(x)g(x)/W(x), u2′ = y1(x)g(x)/W(x).
  • Particular solution: yp = y1∫u1′dx + y2∫u2′dx; integration constants can be dropped since they merge into yh.
  • Trig integrals: ∫e^x sin x dx = e^x(sin x − cos x)/2 and ∫e^x cos x dx = e^x(sin x + cos x)/2, used in the worked example.
  • Assumptions and limits: y1, y2 must be independent; g must be continuous on the interval; the final answer may involve non-elementary integrals.

Worked Example

Solve y″ + y = e^x by variation of parameters.

  1. Homogeneous solutions: r² + 1 = 0 gives r = ±i, so y1 = cos x, y2 = sin x.
  2. Wronskian: W = cos x · cos x − sin x · (−sin x) = cos²x + sin²x = 1.
  3. Set yp = u1cos x + u2sin x with g(x) = e^x. Then u1′ = −y2g/W = −e^x sin x and u2′ = y1g/W = e^x cos x.
  4. Integrate: u1 = −∫e^x sin x dx = −e^x(sin x − cos x)/2 = e^x(cos x − sin x)/2, and u2 = ∫e^x cos x dx = e^x(sin x + cos x)/2.
  5. Assemble: yp = u1cos x + u2sin x = (e^x/2)[(cos x − sin x)cos x + (sin x + cos x)sin x].
  6. Simplify the bracket: cos²x − sin x cos x + sin²x + sin x cos x = cos²x + sin²x = 1. So yp = e^x/2.
  7. Verify: yp′ = yp″ = e^x/2, so yp″ + yp = e^x/2 + e^x/2 = e^x. Correct. Full solution: y = C1cos x + C2sin x + e^x/2.

Common Misconceptions

  • Forgetting standard form. For 2y″ + 2y = 2e^x the effective g is e^x after dividing by 2; using 2e^x doubles the answer wrongly.
  • Thinking the method needs constant coefficients. It needs the homogeneous solutions, however obtained; variable-coefficient equations are its natural habitat.
  • Keeping the integration constants in u1, u2. They only reproduce yh terms already present, so they are safely dropped.

Real-World Applications

  • Nonstandard forcing: circuits or structures driven by impulses, secants, or logarithmic loads that undetermined coefficients cannot touch.
  • Variable-coefficient models: Bessel-type equations in heat conduction and waveguides, where series or known special functions supply y1, y2.
  • Green's functions: the same u1′, u2′ formulas are the seed of the Green's function for boundary value problems.

Variation of parameters replaces C1, C2 by functions and integrates u1′ = −y2g/W, u2′ = y1g/W. For y″ + y = e^x it produces the clean particular solution e^x/2, verified by direct substitution — the universal fallback whenever guessing fails.