Skip to content

Variation of Parameters

You will learn the method of variation of parameters, which works for a much wider class of nonhomogeneous equations than undetermined coefficients, including cases where the right-hand side is not a simple polynomial, exponential, or trig function.

For the nonhomogeneous equation

y+p(x)y+q(x)y=g(x)y'' + p(x)y' + q(x)y = g(x)

we already know the general solution to the homogeneous equation:

yh=C1y1(x)+C2y2(x)y_h = C_1 y_1(x) + C_2 y_2(x)

The method of variation of parameters assumes a particular solution of the form

yp=u1(x)y1(x)+u2(x)y2(x)y_p = u_1(x) y_1(x) + u_2(x) y_2(x)

where u1(x)u_1(x) and u2(x)u_2(x) are functions we need to find. After some calculus and algebra, we arrive at the system:

u1y1+u2y2=0u_1' y_1 + u_2' y_2 = 0 u1y1+u2y2=g(x)u_1' y_1' + u_2' y_2' = g(x)

Solving this system using determinants (the Wronskian) gives us u1u_1' and u2u_2', which we then integrate.

The visual shows the two homogeneous solutions (blue and green) and the particular solution (orange) constructed by varying their coefficients. The particular solution has a fundamentally different shape than either base solution alone.

Example 1: Basic Variation of Parameters

Solve y+y=tanxy'' + y = \tan x.

Solution: Homogeneous solutions: y1=cosxy_1 = \cos x, y2=sinxy_2 = \sin x

Wronskian: W=cosxcosx(sinx)sinx=1W = \cos x \cdot \cos x - (-\sin x) \cdot \sin x = 1

Then:

u1=sinxtanx=sin2xcosxu_1' = -\sin x \cdot \tan x = -\frac{\sin^2 x}{\cos x} u2=cosxtanx=sinxu_2' = \cos x \cdot \tan x = \sin x

Integrating: u2=cosxu_2 = -\cos x, and u1=sinxlnsecx+tanxu_1 = \sin x - \ln|\sec x + \tan x|

The particular solution follows from yp=u1cosx+u2sinxy_p = u_1 \cos x + u_2 \sin x.

Example 2: With Initial Conditions

Solve yy=e2xy'' - y = e^{2x} with y(0)=0y(0) = 0, y(0)=1y'(0) = 1.

Solution: Homogeneous: y1=exy_1 = e^x, y2=exy_2 = e^{-x}, Wronskian W=2W = -2

u1=exe2x2=ex2,u2=exe2x2=e3x2u_1' = \frac{-e^{-x} \cdot e^{2x}}{-2} = \frac{e^x}{2}, \quad u_2' = \frac{e^x \cdot e^{2x}}{-2} = -\frac{e^{3x}}{2}

Integrating and combining: yp=13e2xy_p = \frac{1}{3}e^{2x}

Full solution: y=C1ex+C2ex+13e2xy = C_1 e^x + C_2 e^{-x} + \frac{1}{3}e^{2x}

Apply ICs: C1=13C_1 = \frac{1}{3}, C2=23C_2 = -\frac{2}{3}

Example 3: More Complex Right-Hand Side

Solve y+4y=sec(2x)y'' + 4y = \sec(2x).

Solution: This is impossible with undetermined coefficients (since sec(2x)\sec(2x) isn’t a polynomial, exponential, or trig function). Variation of parameters handles it cleanly with y1=cos2xy_1 = \cos 2x, y2=sin2xy_2 = \sin 2x, W=2W = 2.

Variation of parameters is the go-to method when the forcing function g(x)g(x) is messy. Examples include irregular external forces on a bridge, non-sinusoidal voltage in an electrical circuit, or complicated input signals in control systems and signal processing. It is also the foundation for more advanced techniques in physics (Green’s functions) and engineering.

Variation of parameters is used when:
The particular solution in variation of parameters has the form:
The Wronskian is used to:
Variation of parameters requires that $y_1$ and $y_2$ are:
Which forcing function requires variation of parameters (not undetermined coefficients)?