Mathematics.

linear odes

Variation of Parameters

Differential Equations35 minDifficulty7 out of 10

You should know: second order differential equation

Overview

Variation of parameters is a general method for finding a particular solution yₚ of a non-homogeneous linear ODE ay″+by′+cy = g(x), once the homogeneous solutions y₁, y₂ are known. Unlike the method of undetermined coefficients, it works for any forcing function g(x) — not just polynomials, exponentials, sines, and cosines — because it does not guess a form but instead solves directly for coefficient functions u₁(x), u₂(x) that replace the constants C₁, C₂ in the homogeneous solution. The price is that it requires computing the Wronskian and two integrals, which can be messy but always exist in principle. It is the ODE analogue of the variation-of-constants technique used for first-order linear equations.

Intuition

Start from the homogeneous solution C₁y₁+C₂y₂, which solves ay″+by′+cy=0. To handle a nonzero forcing term, let the 'constants' become functions of x, u₁(x) and u₂(x), and ask what those functions must do to make u₁y₁+u₂y₂ satisfy the full equation. Imposing one convenient constraint (u₁′y₁+u₂′y₂=0) to keep the algebra linear turns the problem into a simple 2×2 linear system for u₁′ and u₂′, which integrates to give the particular solution — like adjusting the 'mixing weights' of two fixed ingredient functions as you move along x to match whatever forcing is applied.

Formal Definition

Definition

For ay″+by′+cy=g(x) with homogeneous solutions y₁, y₂ and Wronskian W = y₁y₂′ − y₂y₁′, the particular solution is:

yp=y1y2g(x)/aWdx+y2y1g(x)/aWdxy_p = -y_1\int \frac{y_2\, g(x)/a}{W}\,dx + y_2\int \frac{y_1\,g(x)/a}{W}\,dx
Variation of parameters formula
W(y1,y2)=y1y2y2y1W(y_1,y_2) = y_1y_2' - y_2y_1'
Wronskian of the homogeneous solutions
y=yh+yp=C1y1+C2y2+ypy = y_h + y_p = C_1y_1 + C_2y_2 + y_p
General solution

Worked Examples

  1. Homogeneous solutions and their Wronskian.

    y1=cosx, y2=sinx,W=cosxcosxsinx(sinx)=1y_1=\cos x,\ y_2=\sin x,\quad W = \cos x\cos x - \sin x(-\sin x) = 1
  2. Compute u₁′ and u₂′ from the standard formulas (a=1, g=tan x).

    u1=y2gW=sinxtanx,u2=y1gW=cosxtanx=sinxu_1' = -\frac{y_2 g}{W} = -\sin x\tan x, \qquad u_2' = \frac{y_1 g}{W} = \cos x\tan x = \sin x
  3. Integrate u₂′ directly.

    u2=sinxdx=cosxu_2 = \int \sin x\,dx = -\cos x
  4. Integrate u₁′ = -sin x tan x = -(sin²x)/cos x = cos x - sec x.

    u1=(cosxsecx)dx=sinxlnsecx+tanxu_1 = \int(\cos x - \sec x)\,dx = \sin x - \ln|\sec x + \tan x|
  5. Assemble yₚ = u₁y₁ + u₂y₂.

    yp=(sinxlnsecx+tanx)cosx+(cosx)sinx=cosxlnsecx+tanxy_p = (\sin x - \ln|\sec x+\tan x|)\cos x + (-\cos x)\sin x = -\cos x\,\ln|\sec x + \tan x|

Answer: y = C₁cos x + C₂sin x − cos x·ln|sec x + tan x| (this is the standard textbook result; verify by substitution: yₚ″+yₚ reduces to tan x after differentiating twice and using the identity d/dx[ln|sec x+tan x|] = sec x).

Practice Problems

Difficulty 7/10

Solve y″ + y = sec x (0<x<π/2) using variation of parameters.

Difficulty 6/10

Solve y″ − 4y = e^{2x} using variation of parameters.

Difficulty 8/10

A forced oscillator obeys x″ + x = f(t) where f is an arbitrary continuous forcing function measured from a sensor (not a simple polynomial/exponential/sinusoid). Explain why variation of parameters, rather than undetermined coefficients, is the appropriate solution method.

Quiz

Variation of parameters is preferred over undetermined coefficients when:
The Wronskian W(y₁,y₂) appearing in the variation-of-parameters formula is:
In variation of parameters, the constraint u₁′y₁ + u₂′y₂ = 0 is imposed in order to:

Summary

  • Variation of parameters finds a particular solution yₚ = u₁y₁+u₂y₂ for ay″+by′+cy=g(x), letting the 'constants' become functions of x.
  • It requires the homogeneous solutions y₁, y₂ and their Wronskian, and works for any continuous forcing g(x), unlike undetermined coefficients.
  • The formula involves two integrals of g(x) weighted by the homogeneous solutions and divided by the Wronskian.

References