Diff. EquationsSecond-Order Linear Equations

Variation of Parameters

A general method for any forcing term.

Not started Jump to practice

Undetermined coefficients needs forcing terms whose derivatives stay in a small family. For $\sec t$, $\ln t$ or $\frac{1}{t}$ there is no finite guess. Variation of parameters works for any continuous $g$, as long as you know two independent homogeneous solutions.

Key idea

For $y'' + p(t)y' + q(t)y$ $= g(t)$ (standard form) with homogeneous solutions $y_1, y_2$ and Wronskian $W$: $$y_p = u_1y_1 + u_2y_2,$$ $$u_1' = -\frac{y_2\,g}{W},$$ $$u_2' = \frac{y_1\,g}{W}.$$

Why it works

Replace the constants in $c_1y_1 + c_2y_2$ by functions: $y_p = u_1y_1 + u_2y_2$. We may impose one extra condition, and we choose $u_1'y_1 + u_2'y_2 = 0$ so that $y_p' = u_1y_1' + u_2y_2'$ has no $u'$ terms. Then $y_p''$ $= u_1'y_1' + u_2'y_2' + u_1y_1''$ $+ u_2y_2''$. Substituting, the $u_1$ and $u_2$ terms cancel (each $y_i$ solves the homogeneous equation), leaving $u_1'y_1' + u_2'y_2' = g$. Solving these two linear equations by Cramer's rule gives the formulas, with $W$ as the determinant.

Worked example: A secant forcing

Find $y_p$ for $y'' + y = \sec t$ on $-\frac{\pi}{2} < t < \frac{\pi}{2}$.
  1. $y_1 = \cos t$, $y_2 = \sin t$, $W = \cos^{2} t + \sin^{2} t = 1$.
  2. $u_1' = -\sin t\sec t = -\tan t$, so $u_1 = \ln(\cos t)$.
  3. $u_2' = \cos t\sec t = 1$, so $u_2 = t$.

Answer: $y_p = \cos t\,\ln(\cos t) + t\sin t$

Worked example: A repeated root and $\frac{1}{t}$

Find $y_p$ for $y'' - 2y' + y = \frac{e^{t}}{t}$, $t > 0$.
  1. $y_1 = e^{t}$, $y_2 = te^{t}$, $W = e^{2t}$.
  2. $u_1' = -\frac{te^{t}\cdot e^{t}/t}{e^{2t}} = -1$ and $u_2' = \frac{e^{t}\cdot e^{t}/t}{e^{2t}} = \frac{1}{t}$.
  3. $u_1 = -t$, $u_2 = \ln t$, so $y_p = -te^{t} + te^{t}\ln t$.
  4. $-te^{t}$ is a homogeneous solution, so it can be dropped.

Answer: $y_p = te^{t}\ln t$

Worked example: Standard form matters

$y_1 = t$ and $y_2 = t^{2}$ solve $t^{2}y'' - 2ty' + 2y = 0$. Find $y_p$ for $t^{2}y'' - 2ty' + 2y = t^{3}$, $t > 0$.
  1. Divide by $t^{2}$: the forcing in standard form is $g = t$, not $t^{3}$.
  2. $W = t\cdot 2t - 1\cdot t^{2} = t^{2}$.
  3. $u_1' = -\frac{t^{2}\cdot t}{t^{2}} = -t$ and $u_2' = \frac{t\cdot t}{t^{2}} = 1$, so $u_1 = -\frac{t^{2}}{2}$, $u_2 = t$.

Answer: $y_p = -\frac{t^{3}}{2} + t^{3} = \frac{t^{3}}{2}$

Common mistake

Using the original right side instead of the standard-form $g$; the formulas assume the coefficient of $y''$ is 1. Another slip is swapping $y_1$ and $y_2$ in one formula but not the other, which flips a sign. Check by substituting $y_p$ into the equation.
The particular solution $\cos t\ln(\cos t) + t\sin t$ for the forcing $\sec t$ (dashed), on the interval where $\sec t$ is defined.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

This is one of the top rungs of Differential Equations.

Sources and further reading

  • OpenStax Calculus Volume 3, 7.2 Nonhomogeneous Linear Equations
  • Paul's Online Math Notes, Differential Equations: Variation of Parameters
  • MIT OpenCourseWare 18.03SC Differential Equations (Fall 2011), Unit II: Second Order Constant Coefficient Linear Equations
@teddyrookbook GitHub