The universal method that works for ANY forcing function
By the end of this lesson, you will be able to:
In the previous section, we learned undetermined coefficients — a quick method for finding particular solutions. But it only works when \(g(t)\) has a special form: polynomials, exponentials, sines, cosines, or products of these.
What if \(g(t) = \sec(t)\)? Or \(g(t) = e^t\sin(t)\)? Or some arbitrary function? The method of variation of parameters is a completely general approach that works for any \(g(t)\), no matter how exotic. It replaces the unknown constants in \(y_c\) with unknown functions, solves for them, and yields the particular solution.
Joseph-Louis Lagrange developed the method of variation of parameters in the late 1700s. His insight was revolutionary: instead of guessing the form of a particular solution, allow the constants to vary — turn them into functions of the independent variable. This elegance transformed differential equations from specific tricks into a unified framework.
Just as this powerful method eases the difficulty of solving complex differential equations, remember that mastery of difficult concepts comes through persistence. A method that works for any function is a gift — embrace its power.
Consider the second-order linear ODE in standard form:
We have already found the complementary solution (homogeneous solution):
where \(y_1\) and \(y_2\) are two linearly independent solutions of the homogeneous equation, and \(C_1, C_2\) are arbitrary constants.
The idea of variation of parameters is: replace the constants with functions. Let:
where \(u_1(t)\) and \(u_2(t)\) are unknown functions to be determined. Our goal is to find these functions such that \(y_p\) satisfies the original non-homogeneous equation.
We start by substituting \(y_p = u_1 y_1 + u_2 y_2\) into the ODE. To make progress, we impose one condition (a constraint) to simplify:
Then:
Substituting into \(a\,y_p'' + b\,y_p' + c\,y_p = g(t)\):
Rearranging:
Since \(y_1\) and \(y_2\) satisfy the homogeneous equation, the first two terms vanish:
Combined with our constraint \(u_1'\,y_1 + u_2'\,y_2 = 0\), we have a system of two equations:
Solving by Cramer's rule:
where \(W = W(y_1, y_2) = y_1\,y_2' - y_2\,y_1'\) is the Wronskian determinant.
Given the ODE \(a\,y'' + b\,y' + c\,y = g(t)\) in standard form, with complementary solution \(y_c = C_1 y_1 + C_2 y_2\), the particular solution is:
where:
The general solution is:
The Wronskian of two functions \(y_1\) and \(y_2\) is:
Geometric meaning: The Wronskian measures the "independence" of two solutions. If \(W \neq 0\) at some point, then \(y_1\) and \(y_2\) are linearly independent at that point. If \(y_1\) and \(y_2\) form a fundamental set (which they do for the homogeneous equation), then \(W \neq 0\) everywhere in the interval.
The Wronskian \(W(y_1, y_2) = y_1\,y_2' - y_2\,y_1'\) appears in the denominator of the variation of parameters formula. If \(W = 0\), the formula fails — because \(y_1\) and \(y_2\) would not be linearly independent. But for a fundamental set of solutions to the homogeneous equation, \(W \neq 0\) is guaranteed. This is why the method always works (in principle) once you have the complementary solution.
The coefficient of \(y''\) must be exactly 1 for the formula to apply directly. If your equation is \(2y'' + 6y' + 4y = 8\), first divide by 2 to get \(y'' + 3y' + 2y = 4\). The \(a\) in the formula is the coefficient in the standard form. If you forget to convert to standard form, you must remember to include the coefficient \(a\) explicitly in the denominators.
Here is the streamlined procedure to apply variation of parameters:
Use this method when:
Click each example to reveal the full solution. These are drawn from applied differential equations problems.
Step 1: Standard form. Already standard with \(a = 1\), \(g(t) = \tan(t)\).
Step 2: Complementary solution. For \(y'' + y = 0\), the characteristic equation is \(r^2 + 1 = 0\), giving \(r = \pm i\). Thus:
Step 3: Wronskian.
Step 4: Compute \(u_1\) and \(u_2\).
Using \(\sin^2(t) = 1 - \cos^2(t)\):
Step 5: Particular solution.
Step 6: General solution.
The logarithm \(\ln|\sec(t) + \tan(t)|\) is the antiderivative of \(\sec(t)\). This integral appears frequently in variation of parameters problems. Memorize it: \(\int \sec(t)\,dt = \ln|\sec(t)+\tan(t)| + C\).
Step 1: Standard form. Already standard with \(a = 1\), \(g(t) = 9\sec^2(3t)\).
Step 2: Complementary solution. For \(y'' + 9y = 0\), we have \(r^2 + 9 = 0\), so \(r = \pm 3i\). Thus:
Step 3: Wronskian.
Step 4: Compute \(u_1\) and \(u_2\).
Substituting \(w = \cos(3t)\), \(dw = -3\sin(3t)\,dt\):
Step 5: Particular solution.
Step 6: General solution.
Step 1: Standard form. Standard with \(a = 1\), \(g(t) = \sec^2(2t)\).
Step 2: Complementary solution. For \(y'' + 4y = 0\), we have \(r^2 + 4 = 0\), giving \(r = \pm 2i\). Thus:
Step 3: Wronskian.
Step 4 & 5: Compute \(u_1, u_2\), and \(y_p\).
Using \(\int \tan(u)\sec(u)\,du = \sec(u) + C\):
Step 6: General solution.
Step 1: Standard form. Standard with \(a = 1\), \(g(t) = e^t \sin(t)\).
Step 2: Complementary solution. For \(y'' - y = 0\), we have \(r^2 - 1 = 0\), giving \(r = \pm 1\). Thus:
Step 3: Wronskian.
Step 4: Compute \(u_1\) and \(u_2\).
For the integral \(\int e^{2t}\sin(t)\,dt\), use integration by parts twice or the formula \(\int e^{at}\sin(bt)\,dt = \frac{e^{at}(a\sin(bt)-b\cos(bt))}{a^2+b^2}\):
Thus:
Step 5: Particular solution.
Step 6: General solution.
Step 1: Standard form. Standard with \(a = 1\), \(g(t) = t^2 e^{-t}\).
Step 2: Complementary solution. For \(y'' + 2y' + y = 0\), the characteristic equation is \(r^2 + 2r + 1 = (r+1)^2 = 0\), giving \(r = -1\) (repeated). Thus:
Step 3: Wronskian.
Step 4: Compute \(u_1\) and \(u_2\).
Step 5: Particular solution.
Step 6: General solution.
For this problem, since \(g(t) = t^2 e^{-t}\) and we already have \(e^{-t}\) and \(te^{-t}\) in \(y_c\), undetermined coefficients would require us to guess \(y_p = (At^4 + Bt^3)e^{-t}\) (multiplying by \(t^2\) due to resonance). Variation of parameters bypasses all the guesswork!
Step 1: Standard form. Standard with \(a = 1\), \(g(t) = te^t\).
Step 2: Complementary solution. For \(y'' - 2y' + y = 0\), the characteristic equation is \(r^2 - 2r + 1 = (r-1)^2 = 0\), giving \(r = 1\) (repeated). Thus:
Step 3: Wronskian.
Step 4: Compute \(u_1\) and \(u_2\).
Step 5: Particular solution.
Step 6: General solution.
Step 1: Standard form. Standard with \(a = 1\), \(g(t) = \cosh(2t) = \frac{e^{2t}+e^{-2t}}{2}\).
Step 2: Complementary solution. For \(y'' + 4y' + 4y = 0\), the characteristic equation is \(r^2 + 4r + 4 = (r+2)^2 = 0\), giving \(r = -2\) (repeated). Thus:
Step 3: Wronskian.
Step 4: Compute \(u_1\) and \(u_2\).
Since \(\cosh(2t) = \frac{e^{2t}+e^{-2t}}{2}\):
Using integration by parts on \(\int te^{4t}\,dt\):
Thus:
Step 5 & 6: Particular solution and general solution. After substituting into \(y_p = u_1 y_1 + u_2 y_2\) and simplifying (which involves substantial algebra), the result is:
Note: The explicit form of \(y_p\) is algebraically complex. In practice, one would compute and simplify using computer algebra. The key point is that the method yields a closed form.
Physical Context: This equation models a damped harmonic oscillator (e.g., a mass-spring system or RLC electrical circuit) driven by a non-sinusoidal forcing function \(\sec(2t)\). The natural frequency is \(\omega_0 = 2\), and the forcing at that frequency is unusual because \(\sec(2t) = 1/\cos(2t)\) diverges periodically.
Step 1: Standard form. Standard with \(a = 1\), \(g(t) = \sec(2t)\).
Step 2: Complementary solution. For \(y'' + 4y = 0\), we have \(r^2 + 4 = 0\), giving \(r = \pm 2i\). Thus:
Step 3: Wronskian.
Step 4: Compute \(u_1\) and \(u_2\).
Step 5: Particular solution.
Step 6: General solution.
The term \(\dfrac{t}{2}\sin(2t)\) represents secular growth — a term that grows linearly with time. This arises because \(\sec(2t)\) contains components at the resonant frequency. In a physical system, this would lead to unbounded oscillations (in the absence of damping). The logarithmic term \(\dfrac{1}{4}\cos(2t)\ln|\cos(2t)|\) is periodic but behaves singularly when \(\cos(2t) = 0\). This illustrates why \(\sec(2t)\) is a problematic forcing function for this oscillator!
These problems are similar in style and difficulty to past exam questions. Click each problem to reveal the step-by-step solution.
Step 1: Find $y_c$. Characteristic equation: $(r-1)^2 = 0 \Rightarrow r = 1$ (repeated).
Step 2: Compute the Wronskian.
Step 3: Compute $u_1'$ and $u_2'$. With $g(t) = \dfrac{e^t}{t^2}$:
Step 4: Integrate to find $u_1$ and $u_2$.
Step 5: Particular solution.
Step 6: General solution. (The $-e^t$ can be absorbed into $c_1 e^t$)
Step 1: Find $y_c$. Characteristic equation: $r^2 + 4 = 0 \Rightarrow r = \pm 2i$.
Step 2: Compute the Wronskian.
Step 3: Compute $u_1'$ and $u_2'$. With $g(t) = \sec(2t)$:
Step 4: Integrate.
Step 5: Particular solution.
Step 6: General solution.
Explore the variation of parameters method by selecting a preset equation or entering your own. Watch the complementary solution, Wronskian, and particular solution come to life!
Test your mastery of variation of parameters! Try each problem, then check your answer.
Progress: 0 / 5 completed
For \(y'' + 4y = g(t)\) with \(y_1 = \cos(2t)\) and \(y_2 = \sin(2t)\), what is \(W(y_1, y_2)\)?
Which equation is in standard form?
Which forcing function would make undetermined coefficients difficult or impossible?
For \(y'' + 6y' + 9y = g(t)\), what is the complementary solution \(y_c\)?
The fundamental idea of variation of parameters is to replace the constants \(C_1, C_2\) in \(y_c = C_1 y_1 + C_2 y_2\) with what?
Given equation: \(\quad ay'' + by' + cy = g(t)\)
Complementary solution: \(\quad y_c = C_1 y_1 + C_2 y_2\)
Wronskian: \(\quad W(y_1, y_2) = \begin{vmatrix} y_1 & y_2 \\ y_1' & y_2' \end{vmatrix} = y_1 y_2' - y_2 y_1'\)
Particular solution functions:
Particular solution: \(\quad y_p = u_1 y_1 + u_2 y_2\)
General solution: \(\quad y = y_c + y_p\)