Linear ODEs: Higher-Order & Systems

variation of parameters

Undetermined coefficients fails the moment the forcing is something like tan x or sec x, where no tidy family of guesses closes up. Variation of parameters is the universal alternative: it produces a particular solution for any continuous forcing, paying for that generality with integrals you must then actually compute.

The idea, due to Lagrange, is to take the homogeneous solution c_1 y_1 + c_2 y_2 and let the constants become functions: y_p = u_1(x) y_1 + u_2(x) y_2. Imposing the equation plus one convenient constraint gives two algebraic equations for u_1' and u_2', whose solution is u_1' = -y_2 g / W and u_2' = y_1 g / W, where W is the Wronskian of y_1, y_2 and g is the forcing (after normalizing the leading coefficient to 1). Integrating recovers u_1 and u_2 and hence y_p. For systems, the same idea gives the elegant formula y_p = (fundamental matrix) times integral of (inverse fundamental matrix) times g.

Its strength is total generality: it needs only a fundamental set of homogeneous solutions and a continuous forcing, never a lucky guess. Its cost is the integration, which may be messy or even non-elementary, but the formula always tells you exactly which integral to do. In transform language the same particular solution emerges as a convolution with the impulse response, which is why variation of parameters, Green's functions, and the convolution theorem are three faces of one idea.

For y'' + y = sec x, the homogeneous basis is cos x, sin x with W = 1. Then u_1' = -sin x sec x = -tan x and u_2' = cos x sec x = 1, giving u_1 = ln|cos x|, u_2 = x, so y_p = cos x ln|cos x| + x sin x.

Variation of parameters handles sec x, which undetermined coefficients cannot touch.

Before applying the formula, divide the equation through so the highest derivative has coefficient 1 — otherwise the leading coefficient must be folded into g, and forgetting this is a frequent slip.

Also called
variation of constantsLagrange's method参数变易法常数变易法