ConceptComplete

Variation of Parameters

Variation of parameters is a general method for finding particular solutions to nonhomogeneous linear differential equations. Unlike undetermined coefficients, it works for any continuous forcing function.

DefinitionVariation of Parameters Method

Given the nonhomogeneous equation:

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

with homogeneous solutions y1y_1 and y2y_2, the method seeks 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 u1u_1 and u2u_2 are functions to be determined (the "parameters" that "vary").

Derivation of the Method

The idea is to replace the constants in yh=c1y1+c2y2y_h = c_1y_1 + c_2y_2 with functions u1(x)u_1(x) and u2(x)u_2(x).

Imposing the constraint:

u1y1+u2y2=0u_1'y_1 + u_2'y_2 = 0

and requiring ypy_p to satisfy the differential equation yields:

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

These two equations can be solved for u1u_1' and u2u_2' using Cramer's rule.

Formula for Particular Solution

For the standard form y+p(x)y+q(x)y=f(x)y'' + p(x)y' + q(x)y = f(x):

u1=y2fW,u2=y1fWu_1' = -\frac{y_2f}{W}, \quad u_2' = \frac{y_1f}{W}

where W=W(y1,y2)=y1y2y1y2W = W(y_1, y_2) = y_1y_2' - y_1'y_2 is the Wronskian.

Integrating:

yp=y1y2fWdx+y2y1fWdxy_p = -y_1\int\frac{y_2f}{W}dx + y_2\int\frac{y_1f}{W}dx

ExampleUsing Variation of Parameters

Solve y+y=secxy'' + y = \sec x.

Homogeneous solution: r2+1=0r^2 + 1 = 0 gives y1=cosxy_1 = \cos x, y2=sinxy_2 = \sin x.

Wronskian:

W=cosxcosx(sinx)sinx=cos2x+sin2x=1W = \cos x \cdot \cos x - (-\sin x) \cdot \sin x = \cos^2 x + \sin^2 x = 1

Using the formulas with f(x)=secxf(x) = \sec x:

u1=sinxsecx1=tanxu_1' = -\frac{\sin x \cdot \sec x}{1} = -\tan x

u2=cosxsecx1=1u_2' = \frac{\cos x \cdot \sec x}{1} = 1

Integrating:

u1=lncosx,u2=xu_1 = \ln|\cos x|, \quad u_2 = x

Therefore:

yp=cosxlncosx+xsinxy_p = \cos x \ln|\cos x| + x\sin x

General solution: y=c1cosx+c2sinx+cosxlncosx+xsinxy = c_1\cos x + c_2\sin x + \cos x \ln|\cos x| + x\sin x

Remark

The variation of parameters method always works for any continuous f(x)f(x), but the required integrals may not have closed forms. In contrast, undetermined coefficients is limited to special forms of f(x)f(x) but is often computationally simpler.

ExampleComparison with Undetermined Coefficients

Consider y3y+2y=exy'' - 3y' + 2y = e^x.

Method 1 - Variation of Parameters:

Homogeneous solutions: y1=exy_1 = e^x, y2=e2xy_2 = e^{2x}

Wronskian: W=ex2e2xexe2x=e3xW = e^x \cdot 2e^{2x} - e^x \cdot e^{2x} = e^{3x}

u1=e2xexe3x=1,u2=exexe3x=exu_1' = -\frac{e^{2x} \cdot e^x}{e^{3x}} = -1, \quad u_2' = \frac{e^x \cdot e^x}{e^{3x}} = e^{-x}

u1=x,u2=exu_1 = -x, \quad u_2 = -e^{-x}

yp=xexe2xex=xexex=(x+1)exy_p = -xe^x - e^{2x} \cdot e^{-x} = -xe^x - e^x = -(x+1)e^x

Method 2 - Undetermined Coefficients (with resonance):

Since exe^x is in yhy_h, try yp=Axexy_p = Axe^x.

Substituting gives A=1A = 1, so yp=xexy_p = xe^x.

(Note: We can drop the ex-e^x term as it's part of yhy_h.)

Both methods work, but undetermined coefficients is simpler here.

Remark

The Wronskian W(y1,y2)W(y_1, y_2) is never zero when y1y_1 and y2y_2 are linearly independent solutions. This guarantees that the formulas for u1u_1' and u2u_2' are well-defined.

Variation of parameters is the most general method for solving nonhomogeneous linear ODEs and provides theoretical insight into the structure of solutions.