2.3 Method of Variation of Parameters

The universal method that works for ANY forcing function

What You'll Learn

By the end of this lesson, you will be able to:

  1. Understand why variation of parameters is more general than undetermined coefficients
  2. Compute the Wronskian determinant for a fundamental set of solutions
  3. Apply the variation of parameters formula to find particular solutions
  4. Solve any second-order linear ODE with any forcing function \(g(t)\)
  5. Visualize how the method constructs the particular solution

Why Is This Method Powerful?

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.

— Joseph-Louis Lagrange (1736–1813), visionary of variational methods
إِنَّ مَعَ الْعُسْرِ يُسْرًا
"Indeed, with hardship comes ease."
— Quran 94:5-6

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.

Theory of Variation of Parameters

The Setup

Consider the second-order linear ODE in standard form:

$$a\,y'' + b\,y' + c\,y = g(t)$$

We have already found the complementary solution (homogeneous solution):

$$y_c(t) = C_1 y_1(t) + C_2 y_2(t)$$

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:

$$y_p(t) = u_1(t)\,y_1(t) + u_2(t)\,y_2(t)$$

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.

Deriving the Formulas

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:

$$u_1'\,y_1 + u_2'\,y_2 = 0$$

Then:

$$y_p' = u_1\,y_1' + u_2\,y_2'$$
$$y_p'' = u_1'\,y_1' + u_1\,y_1'' + u_2'\,y_2' + u_2\,y_2''$$

Substituting into \(a\,y_p'' + b\,y_p' + c\,y_p = g(t)\):

$$a(u_1'\,y_1' + u_1\,y_1'' + u_2'\,y_2' + u_2\,y_2'') + b(u_1\,y_1' + u_2\,y_2') + c(u_1\,y_1 + u_2\,y_2) = g(t)$$

Rearranging:

$$u_1(a\,y_1'' + b\,y_1' + c\,y_1) + u_2(a\,y_2'' + b\,y_2' + c\,y_2) + a(u_1'\,y_1' + u_2'\,y_2') = g(t)$$

Since \(y_1\) and \(y_2\) satisfy the homogeneous equation, the first two terms vanish:

$$a(u_1'\,y_1' + u_2'\,y_2') = g(t)$$

Combined with our constraint \(u_1'\,y_1 + u_2'\,y_2 = 0\), we have a system of two equations:

$$u_1'\,y_1 + u_2'\,y_2 = 0$$
$$u_1'\,y_1' + u_2'\,y_2' = \frac{g(t)}{a}$$

Solving by Cramer's rule:

$$u_1' = -\frac{y_2 \cdot g(t)}{a \cdot W}, \quad u_2' = \frac{y_1 \cdot g(t)}{a \cdot W}$$

where \(W = W(y_1, y_2) = y_1\,y_2' - y_2\,y_1'\) is the Wronskian determinant.

Theorem — Variation of Parameters Formula

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:

$$y_p(t) = u_1(t)\,y_1(t) + u_2(t)\,y_2(t)$$

where:

$$u_1(t) = -\int \frac{y_2(t) \cdot g(t)}{a \cdot W(t)} \, dt, \quad u_2(t) = \int \frac{y_1(t) \cdot g(t)}{a \cdot W(t)} \, dt$$

The general solution is:

$$y(t) = y_c(t) + y_p(t) = C_1\,y_1 + C_2\,y_2 + u_1\,y_1 + u_2\,y_2$$
The Wronskian Determinant

The Wronskian of two functions \(y_1\) and \(y_2\) is:

$$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'$$

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.

Key Insight: Why the Wronskian Matters

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.

Important: Standard Form

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.

Step-by-Step Method

Here is the streamlined procedure to apply variation of parameters:

  1. Standard form. Write the equation as \(y'' + py' + qy = g(t)\) (or \(a\,y'' + b\,y' + c\,y = g(t)\) if \(a \neq 1\)). Identify \(g(t)\) and the coefficient \(a\).
  2. Find the complementary solution. Solve the homogeneous equation \(y'' + py' + qy = 0\) to get \(y_c = C_1 y_1 + C_2 y_2\). Identify \(y_1(t)\) and \(y_2(t)\).
  3. Compute the Wronskian. Calculate \(W(y_1, y_2) = y_1\,y_2' - y_2\,y_1'\). (Simplify if possible.)
  4. Compute \(u_1\) and \(u_2\). Use the formulas: $$u_1(t) = -\int \frac{y_2(t) \cdot g(t)}{a \cdot W(t)} \, dt, \quad u_2(t) = \int \frac{y_1(t) \cdot g(t)}{a \cdot W(t)} \, dt$$ Evaluate these integrals. (You may need integration by parts, trigonometric identities, etc.)
  5. Construct the particular solution. Form \(y_p = u_1(t)\,y_1(t) + u_2(t)\,y_2(t)\). Simplify if possible.
  6. Write the general solution. The general solution is \(y = y_c + y_p = C_1 y_1 + C_2 y_2 + y_p\). Apply initial conditions if given.
When to Use Variation of Parameters

Use this method when:

  • \(g(t)\) is not a polynomial, exponential, sine, cosine, or simple product thereof (so undetermined coefficients won't work easily)
  • \(g(t)\) is a quotient of trig functions like \(\sec(t), \csc(t), \tan(t)\), etc.
  • You want the most general method that works for any \(g(t)\)
Undetermined coefficients is faster when \(g(t)\) has the standard special forms and there's no resonance/overlap with \(y_c\).

Worked Examples

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:

$$y_c = C_1 \cos(t) + C_2 \sin(t), \quad y_1 = \cos(t), \quad y_2 = \sin(t)$$

Step 3: Wronskian.

$$W = \cos(t) \cdot \cos(t) - \sin(t) \cdot (-\sin(t)) = \cos^2(t) + \sin^2(t) = 1$$

Step 4: Compute \(u_1\) and \(u_2\).

$$u_1 = -\int \sin(t) \cdot \tan(t) \, dt = -\int \frac{\sin^2(t)}{\cos(t)} \, dt$$

Using \(\sin^2(t) = 1 - \cos^2(t)\):

$$u_1 = -\int \frac{1-\cos^2(t)}{\cos(t)} \, dt = -\int \left(\sec(t) - \cos(t)\right) dt = \sin(t) - \ln|\sec(t) + \tan(t)|$$
$$u_2 = \int \cos(t) \cdot \tan(t) \, dt = \int \sin(t) \, dt = -\cos(t)$$

Step 5: Particular solution.

$$y_p = u_1 \cos(t) + u_2 \sin(t) = [\sin(t) - \ln|\sec(t)+\tan(t)|]\cos(t) + (-\cos(t))\sin(t)$$
$$y_p = \sin(t)\cos(t) - \cos(t)\ln|\sec(t)+\tan(t)| - \cos(t)\sin(t) = -\cos(t)\ln|\sec(t)+\tan(t)|$$

Step 6: General solution.

$$\boxed{y(t) = C_1\cos(t) + C_2\sin(t) - \cos(t)\ln|\sec(t)+\tan(t)|}$$
Note on \(\sec(t)\) and \(\tan(t)\)

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:

$$y_c = C_1 \cos(3t) + C_2 \sin(3t), \quad y_1 = \cos(3t), \quad y_2 = \sin(3t)$$

Step 3: Wronskian.

$$W = \cos(3t) \cdot 3\cos(3t) - \sin(3t) \cdot (-3\sin(3t)) = 3[\cos^2(3t) + \sin^2(3t)] = 3$$

Step 4: Compute \(u_1\) and \(u_2\).

$$u_1 = -\int \frac{\sin(3t) \cdot 9\sec^2(3t)}{3} \, dt = -3\int \sin(3t)\sec^2(3t) \, dt = -3\int \frac{\sin(3t)}{\cos^2(3t)} \, dt$$

Substituting \(w = \cos(3t)\), \(dw = -3\sin(3t)\,dt\):

$$u_1 = -3 \cdot \left(-\frac{1}{3}\right)\int \frac{dw}{w^2} = \int w^{-2}\,dw = -\frac{1}{w} = -\frac{1}{\cos(3t)} = -\sec(3t)$$
$$u_2 = \int \frac{\cos(3t) \cdot 9\sec^2(3t)}{3} \, dt = 3\int \cos(3t)\sec^2(3t) \, dt = 3\int \sec(3t) \, dt$$
$$= 3 \cdot \frac{1}{3}\ln|\sec(3t)+\tan(3t)| = \ln|\sec(3t)+\tan(3t)|$$

Step 5: Particular solution.

$$y_p = -\sec(3t)\cos(3t) + \ln|\sec(3t)+\tan(3t)| \cdot \sin(3t) = -1 + \sin(3t)\ln|\sec(3t)+\tan(3t)|$$

Step 6: General solution.

$$\boxed{y(t) = C_1\cos(3t) + C_2\sin(3t) + \sin(3t)\ln|\sec(3t)+\tan(3t)| - 1}$$

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:

$$y_c = C_1\cos(2t) + C_2\sin(2t), \quad y_1 = \cos(2t), \quad y_2 = \sin(2t)$$

Step 3: Wronskian.

$$W = \cos(2t) \cdot 2\cos(2t) - \sin(2t) \cdot (-2\sin(2t)) = 2$$

Step 4 & 5: Compute \(u_1, u_2\), and \(y_p\).

$$u_1 = -\int \frac{\sin(2t)\sec^2(2t)}{2} \, dt = -\frac{1}{2}\int \tan(2t)\sec(2t) \, dt$$

Using \(\int \tan(u)\sec(u)\,du = \sec(u) + C\):

$$u_1 = -\frac{1}{2} \cdot \frac{1}{2}\sec(2t) = -\frac{1}{4}\sec(2t)$$
$$u_2 = \int \frac{\cos(2t)\sec^2(2t)}{2} \, dt = \frac{1}{2}\int \sec(2t) \, dt = \frac{1}{2} \cdot \frac{1}{2}\ln|\sec(2t)+\tan(2t)| = \frac{1}{4}\ln|\sec(2t)+\tan(2t)|$$
$$y_p = -\frac{1}{4}\sec(2t)\cos(2t) + \frac{1}{4}\ln|\sec(2t)+\tan(2t)|\sin(2t) = -\frac{1}{4} + \frac{1}{4}\sin(2t)\ln|\sec(2t)+\tan(2t)|$$

Step 6: General solution.

$$\boxed{y(t) = C_1\cos(2t) + C_2\sin(2t) + \frac{1}{4}\sin(2t)\ln|\sec(2t)+\tan(2t)| - \frac{1}{4}}$$

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:

$$y_c = C_1 e^{t} + C_2 e^{-t}, \quad y_1 = e^{t}, \quad y_2 = e^{-t}$$

Step 3: Wronskian.

$$W = e^{t} \cdot (-e^{-t}) - e^{-t} \cdot e^{t} = -1 - 1 = -2$$

Step 4: Compute \(u_1\) and \(u_2\).

$$u_1 = -\int \frac{e^{-t} \cdot e^t\sin(t)}{-2} \, dt = \frac{1}{2}\int \sin(t) \, dt = -\frac{1}{2}\cos(t)$$
$$u_2 = \int \frac{e^{t} \cdot e^t\sin(t)}{-2} \, dt = -\frac{1}{2}\int e^{2t}\sin(t) \, dt$$

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}\):

$$\int e^{2t}\sin(t)\,dt = \frac{e^{2t}(2\sin(t)-\cos(t))}{5}$$

Thus:

$$u_2 = -\frac{1}{2} \cdot \frac{e^{2t}(2\sin(t)-\cos(t))}{5} = -\frac{e^{2t}(2\sin(t)-\cos(t))}{10}$$

Step 5: Particular solution.

$$y_p = -\frac{1}{2}\cos(t) \cdot e^{t} + \left[-\frac{e^{2t}(2\sin(t)-\cos(t))}{10}\right] \cdot e^{-t}$$
$$= -\frac{1}{2}e^{t}\cos(t) - \frac{e^{t}(2\sin(t)-\cos(t))}{10} = e^{t}\left[-\frac{1}{2}\cos(t) - \frac{2\sin(t)-\cos(t)}{10}\right]$$
$$= e^{t}\left[\frac{-5\cos(t) - 2\sin(t) + \cos(t)}{10}\right] = \frac{e^{t}(-4\cos(t)-2\sin(t))}{10} = -\frac{e^{t}(2\cos(t)+\sin(t))}{5}$$

Step 6: General solution.

$$\boxed{y(t) = C_1 e^{t} + C_2 e^{-t} - \frac{e^{t}(2\cos(t)+\sin(t))}{5}}$$

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:

$$y_c = (C_1 + C_2 t)e^{-t}, \quad y_1 = e^{-t}, \quad y_2 = te^{-t}$$

Step 3: Wronskian.

$$W = e^{-t} \cdot (e^{-t} - te^{-t}) - te^{-t} \cdot (-e^{-t}) = e^{-2t} - te^{-2t} + te^{-2t} = e^{-2t}$$

Step 4: Compute \(u_1\) and \(u_2\).

$$u_1 = -\int \frac{te^{-t} \cdot t^2 e^{-t}}{e^{-2t}} \, dt = -\int t^3 \, dt = -\frac{t^4}{4}$$
$$u_2 = \int \frac{e^{-t} \cdot t^2 e^{-t}}{e^{-2t}} \, dt = \int t^2 \, dt = \frac{t^3}{3}$$

Step 5: Particular solution.

$$y_p = -\frac{t^4}{4} \cdot e^{-t} + \frac{t^3}{3} \cdot te^{-t} = e^{-t}\left(-\frac{t^4}{4} + \frac{t^4}{3}\right) = e^{-t} \cdot \frac{-3t^4 + 4t^4}{12} = \frac{t^4 e^{-t}}{12}$$

Step 6: General solution.

$$\boxed{y(t) = (C_1 + C_2 t)e^{-t} + \frac{t^4 e^{-t}}{12}}$$
Observation: Undetermined Coefficients Would Also Work

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:

$$y_c = (C_1 + C_2 t)e^{t}, \quad y_1 = e^{t}, \quad y_2 = te^{t}$$

Step 3: Wronskian.

$$W = e^{t} \cdot (e^{t} + te^{t}) - te^{t} \cdot e^{t} = e^{2t} + te^{2t} - te^{2t} = e^{2t}$$

Step 4: Compute \(u_1\) and \(u_2\).

$$u_1 = -\int \frac{te^{t} \cdot te^t}{e^{2t}} \, dt = -\int t^2 \, dt = -\frac{t^3}{3}$$
$$u_2 = \int \frac{e^{t} \cdot te^t}{e^{2t}} \, dt = \int t \, dt = \frac{t^2}{2}$$

Step 5: Particular solution.

$$y_p = -\frac{t^3}{3} \cdot e^{t} + \frac{t^2}{2} \cdot te^{t} = e^{t}\left(-\frac{t^3}{3} + \frac{t^3}{2}\right) = \frac{t^3 e^{t}}{6}$$

Step 6: General solution.

$$\boxed{y(t) = (C_1 + C_2 t)e^{t} + \frac{t^3 e^{t}}{6}}$$

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:

$$y_c = (C_1 + C_2 t)e^{-2t}, \quad y_1 = e^{-2t}, \quad y_2 = te^{-2t}$$

Step 3: Wronskian.

$$W = e^{-2t}(-2te^{-2t} + e^{-2t}) - te^{-2t}(-2e^{-2t}) = e^{-4t}(1 - 2t + 2t) = e^{-4t}$$

Step 4: Compute \(u_1\) and \(u_2\).

$$u_1 = -\int \frac{te^{-2t} \cdot \cosh(2t)}{e^{-4t}} \, dt = -\int t e^{2t}\cosh(2t) \, dt$$

Since \(\cosh(2t) = \frac{e^{2t}+e^{-2t}}{2}\):

$$u_1 = -\frac{1}{2}\int t(e^{4t} + 1) \, dt = -\frac{1}{2}\left[\int te^{4t}\,dt + \int t\,dt\right]$$

Using integration by parts on \(\int te^{4t}\,dt\):

$$\int te^{4t}\,dt = \frac{te^{4t}}{4} - \frac{e^{4t}}{16}$$

Thus:

$$u_1 = -\frac{1}{2}\left[\frac{te^{4t}}{4} - \frac{e^{4t}}{16} + \frac{t^2}{2}\right]$$
$$u_2 = \int \frac{e^{-2t} \cdot \cosh(2t)}{e^{-4t}} \, dt = \int e^{2t}\cosh(2t) \, dt = \frac{1}{2}\int e^{2t}(e^{2t} + e^{-2t}) \, dt$$
$$= \frac{1}{2}\left[\int e^{4t}\,dt + \int 1\,dt\right] = \frac{1}{2}\left[\frac{e^{4t}}{4} + t\right]$$

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:

$$\boxed{y(t) = (C_1 + C_2 t)e^{-2t} + y_p(t)}$$

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:

$$y_c = C_1\cos(2t) + C_2\sin(2t), \quad y_1 = \cos(2t), \quad y_2 = \sin(2t)$$

Step 3: Wronskian.

$$W = \cos(2t) \cdot 2\cos(2t) - \sin(2t) \cdot (-2\sin(2t)) = 2$$

Step 4: Compute \(u_1\) and \(u_2\).

$$u_1 = -\int \frac{\sin(2t) \sec(2t)}{2} \, dt = -\frac{1}{2}\int \tan(2t) \, dt = \frac{1}{4}\ln|\cos(2t)|$$
$$u_2 = \int \frac{\cos(2t) \sec(2t)}{2} \, dt = \frac{1}{2}\int 1 \, dt = \frac{t}{2}$$

Step 5: Particular solution.

$$y_p = \frac{1}{4}\ln|\cos(2t)| \cdot \cos(2t) + \frac{t}{2} \cdot \sin(2t)$$

Step 6: General solution.

$$\boxed{y(t) = C_1\cos(2t) + C_2\sin(2t) + \frac{1}{4}\cos(2t)\ln|\cos(2t)| + \frac{t}{2}\sin(2t)}$$
Engineering Insight

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!

📝 Exam-Style Practice Problems

These problems are similar in style and difficulty to past exam questions. Click each problem to reveal the step-by-step solution.

Practice 1: Variation of parameters for $y'' - 2y' + y = \dfrac{e^t}{t^2}$

Solution

Step 1: Find $y_c$. Characteristic equation: $(r-1)^2 = 0 \Rightarrow r = 1$ (repeated).

$$y_c = c_1 e^t + c_2 te^t, \quad y_1 = e^t, \quad y_2 = te^t$$

Step 2: Compute the Wronskian.

$$W = \begin{vmatrix} e^t & te^t \\ e^t & e^t + te^t \end{vmatrix} = e^t(e^t + te^t) - te^t \cdot e^t = e^{2t} + te^{2t} - te^{2t} = e^{2t}$$

Step 3: Compute $u_1'$ and $u_2'$. With $g(t) = \dfrac{e^t}{t^2}$:

$$u_1' = \frac{-y_2 g}{W} = \frac{-te^t \cdot \frac{e^t}{t^2}}{e^{2t}} = \frac{-\frac{e^{2t}}{t}}{e^{2t}} = -\frac{1}{t}$$
$$u_2' = \frac{y_1 g}{W} = \frac{e^t \cdot \frac{e^t}{t^2}}{e^{2t}} = \frac{\frac{e^{2t}}{t^2}}{e^{2t}} = \frac{1}{t^2}$$

Step 4: Integrate to find $u_1$ and $u_2$.

$$u_1 = \int -\frac{1}{t}\,dt = -\ln|t|$$
$$u_2 = \int \frac{1}{t^2}\,dt = -\frac{1}{t}$$

Step 5: Particular solution.

$$y_p = u_1 y_1 + u_2 y_2 = -\ln|t| \cdot e^t + \left(-\frac{1}{t}\right) \cdot te^t = -e^t\ln|t| - e^t$$

Step 6: General solution. (The $-e^t$ can be absorbed into $c_1 e^t$)

$$\boxed{y = c_1 e^t + c_2 te^t - e^t\ln|t|}$$
Practice 2: Variation of parameters for $y'' + 4y = \sec(2t)$

Solution

Step 1: Find $y_c$. Characteristic equation: $r^2 + 4 = 0 \Rightarrow r = \pm 2i$.

$$y_c = c_1\cos(2t) + c_2\sin(2t), \quad y_1 = \cos(2t), \quad y_2 = \sin(2t)$$

Step 2: Compute the Wronskian.

$$W = \begin{vmatrix} \cos(2t) & \sin(2t) \\ -2\sin(2t) & 2\cos(2t) \end{vmatrix} = 2\cos^2(2t) + 2\sin^2(2t) = 2$$

Step 3: Compute $u_1'$ and $u_2'$. With $g(t) = \sec(2t)$:

$$u_1' = \frac{-\sin(2t) \cdot \sec(2t)}{2} = \frac{-\tan(2t)}{2}$$
$$u_2' = \frac{\cos(2t) \cdot \sec(2t)}{2} = \frac{1}{2}$$

Step 4: Integrate.

$$u_1 = \int \frac{-\tan(2t)}{2}\,dt = \frac{1}{4}\ln|\cos(2t)|$$
$$u_2 = \int \frac{1}{2}\,dt = \frac{t}{2}$$

Step 5: Particular solution.

$$y_p = \frac{1}{4}\ln|\cos(2t)| \cdot \cos(2t) + \frac{t}{2} \cdot \sin(2t)$$

Step 6: General solution.

$$\boxed{y = c_1\cos(2t) + c_2\sin(2t) + \frac{1}{4}\cos(2t)\ln|\cos(2t)| + \frac{t}{2}\sin(2t)}$$

Interactive Variation of Parameters Calculator

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!

Plot: Solutions yc, yp, and y = yc + yp

Try These
  • Select a preset to see detailed calculations
  • Modify coefficients to explore variations
  • Change the forcing function to see how it affects yp
  • Observe how the particular solution combines with yc to form the general solution

Practice Problems

Test your mastery of variation of parameters! Try each problem, then check your answer.

Progress: 0 / 5 completed

Problem 1 — Wronskian Computation

For \(y'' + 4y = g(t)\) with \(y_1 = \cos(2t)\) and \(y_2 = \sin(2t)\), what is \(W(y_1, y_2)\)?

Problem 2 — Standard Form

Which equation is in standard form?

Problem 3 — When to Use Variation of Parameters

Which forcing function would make undetermined coefficients difficult or impossible?

Problem 4 — Complementary Solution

For \(y'' + 6y' + 9y = g(t)\), what is the complementary solution \(y_c\)?

Problem 5 — Understanding Variation of Parameters

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?

Quick Reference Card

Variation of Parameters Formula

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:

$$u_1(t) = -\int \frac{y_2(t) \cdot g(t)}{a \cdot W(t)} \, dt, \quad u_2(t) = \int \frac{y_1(t) \cdot g(t)}{a \cdot W(t)} \, dt$$

Particular solution: \(\quad y_p = u_1 y_1 + u_2 y_2\)

General solution: \(\quad y = y_c + y_p\)