Mathwords logoMathwords

Variation of Parameters — Definition, Formula & Examples

Variation of parameters is a method for finding a particular solution to a nonhomogeneous linear differential equation by replacing the constants in the homogeneous solution with unknown functions and solving for them.

Given a second-order linear ODE y+p(t)y+q(t)y=g(t)y'' + p(t)y' + q(t)y = g(t) with known homogeneous solutions y1y_1 and y2y_2, variation of parameters constructs a particular solution yp=u1y1+u2y2y_p = u_1 y_1 + u_2 y_2, where u1u_1' and u2u_2' are determined by simultaneously solving u1y1+u2y2=0u_1' y_1 + u_2' y_2 = 0 and u1y1+u2y2=g(t)u_1' y_1' + u_2' y_2' = g(t).

Key Formula

yp=y1y2g(t)Wdt+y2y1g(t)Wdty_p = -y_1 \int \frac{y_2\, g(t)}{W}\,dt + y_2 \int \frac{y_1\, g(t)}{W}\,dt
Where:
  • ypy_p = Particular solution to the nonhomogeneous equation
  • y1,y2y_1, y_2 = Linearly independent solutions of the homogeneous equation
  • g(t)g(t) = Nonhomogeneous (forcing) term
  • WW = Wronskian, equal to y₁y₂' − y₂y₁'

How It Works

First, solve the corresponding homogeneous equation to find two linearly independent solutions y1y_1 and y2y_2. Next, compute the Wronskian W=y1y2y2y1W = y_1 y_2' - y_2 y_1'. Then use the formulas u1=y2g(t)/Wu_1' = -y_2 g(t)/W and u2=y1g(t)/Wu_2' = y_1 g(t)/W, and integrate each to find u1u_1 and u2u_2. The particular solution is yp=u1y1+u2y2y_p = u_1 y_1 + u_2 y_2. The general solution is y=c1y1+c2y2+ypy = c_1 y_1 + c_2 y_2 + y_p.

Worked Example

Problem: Find a particular solution to y'' + y = sec(t).
Step 1: The homogeneous equation y'' + y = 0 has solutions y₁ = cos(t) and y₂ = sin(t).
y1=cost,y2=sinty_1 = \cos t, \quad y_2 = \sin t
Step 2: Compute the Wronskian.
W=costcostsint(sint)=cos2t+sin2t=1W = \cos t \cdot \cos t - \sin t \cdot (-\sin t) = \cos^2 t + \sin^2 t = 1
Step 3: Find u₁' and u₂', then integrate. Here g(t) = sec(t).
u1=sintsect=tant    u1=lncostu_1' = -\sin t \cdot \sec t = -\tan t \implies u_1 = \ln|\cos t|
Step 4: Similarly for u₂.
u2=costsect=1    u2=tu_2' = \cos t \cdot \sec t = 1 \implies u_2 = t
Step 5: Assemble the particular solution.
yp=costlncost+tsinty_p = \cos t \cdot \ln|\cos t| + t\sin t
Answer: yp=costlncost+tsinty_p = \cos t \ln|\cos t| + t\sin t

Why It Matters

Unlike undetermined coefficients, variation of parameters works for any continuous forcing function g(t), including sec(t), tan(t), and other terms that do not have a finite family of derivatives. It is essential in engineering and physics courses whenever forcing terms fall outside the standard exponential-polynomial-sinusoidal forms.

Common Mistakes

Mistake: Forgetting to write the ODE in standard form (leading coefficient 1) before applying the formulas.
Correction: Always divide the entire equation by the leading coefficient so that the equation reads y'' + p(t)y' + q(t)y = g(t). The g(t) used in the formulas must come from this standard form.