Skip to content
Mar 11

ODE: Variation of Parameters

MT
Mindli Team

AI-Generated Content

ODE: Variation of Parameters

When facing a nonhomogeneous linear differential equation—the kind that models everything from forced mechanical vibrations to current in an RLC circuit—finding a particular solution is the final step to a complete answer. While the method of Undetermined Coefficients works for specific, simple forcing functions, it fails for arbitrary ones like $e^x \sec(x)$ or $t^{-1}\ln(t)$. Enter the Variation of Parameters, a powerful, systematic algorithm that works for any continuous nonhomogeneous term, provided you first know the solution to the associated homogeneous equation. This method trades guesswork for computation, offering a reliable, if sometimes involved, path to the particular solution $y_p(t)$.

The Foundational Idea: From Constants to Functions

The logic of Variation of Parameters is an elegant extension of what you already know. Consider a general second-order linear ODE: $$y'' + p(t)y' + q(t)y = g(t).$$ Assume you have solved the corresponding homogeneous equation ($g(t)=0$) and found a fundamental set of solutions $\{y_1(t), y_2(t)\}$. The general homogeneous solution is $y_h(t) = c_1 y_1(t) + c_2 y_2(t)$, where $c_1$ and $c_2$ are constants.

The key insight is to vary these parameters—to promote the constants to unknown functions $u_1(t)$ and $u_2(t)$. We postulate that a particular solution to the nonhomogeneous equation can be written in the same form as the homogeneous solution, but with these variable functions: $$y_p(t) = u_1(t) y_1(t) + u_2(t) y_2(t).$$ If we simply substitute this into the ODE, we have one equation but two unknown functions ($u_1$ and $u_2$). To make the problem tractable, we impose a clever auxiliary condition to simplify the derivatives: we demand that $$u_1' y_1 + u_2' y_2 = 0.$$ This condition is chosen to eliminate the terms involving second derivatives of $u_1$ and $u_2$ when we compute $y_p''$. With this condition, the first derivative of $y_p$ simplifies to: $$y_p' = u_1 y_1' + u_2 y_2'.$$ Taking the derivative again (now the product rule will involve $u_1'$ and $u_2'$) and substituting $y_p$, $y_p'$, and $y_p''$ into the original nonhomogeneous ODE leads, after significant simplification using the fact that $y_1$ and $y_2$ are homogeneous solutions, to a second condition: $$u_1' y_1' + u_2' y_2' = g(t).$$

The Role of the Wronskian

We now have a system of two linear equations for the derivatives $u_1'$ and $u_2'$: $$\begin{cases} u_1' y_1 + u_2' y_2 = 0 \\[4pt] u_1' y_1' + u_2' y_2' = g(t) \end{cases}$$ This system can be solved using Cramer's rule. The determinant of the coefficient matrix is precisely the Wronskian, $W(y_1, y_2)(t)$, defined as: $$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'.$$ For a fundamental set of solutions, the Wronskian is always non-zero. Solving the system gives the formulas at the heart of the method: $$u_1'(t) = \frac{-y_2(t) g(t)}{W(y_1, y_2)(t)}, \quad u_2'(t) = \frac{y_1(t) g(t)}{W(y_1, y_2)(t)}.$$ The particular solution is then obtained by integration: $$u_1(t) = \int \frac{-y_2(t) g(t)}{W(t)} \, dt, \quad u_2(t) = \int \frac{y_1(t) g(t)}{W(t)} \, dt, \quad \text{and finally } y_p(t) = u_1(t)y_1(t) + u_2(t)y_2(t).$$ Note that we use the indefinite integral here, and the constants of integration can be set to zero, as they would only add multiples of the homogeneous solution to $y_p$, which is already accounted for in $y_h$.

Extension to Higher-Order Equations

The method generalizes elegantly to an $n$th-order linear ODE of the form $$y^{(n)} + p_{n-1}(t)y^{(n-1)} + \cdots + p_1(t)y' + p_0(t)y = g(t).$$ Given a fundamental set $\{y_1, y_2, \dots, y_n\}$ for the homogeneous equation, we seek a particular solution as $$y_p(t) = u_1(t)y_1(t) + u_2(t)y_2(t) + \cdots + u_n(t)y_n(t).$$ We impose $n-1$ auxiliary conditions to streamline differentiation, all set to zero: $$\begin{aligned} u_1' y_1 + u_2' y_2 + \cdots + u_n' y_n &= 0, \\ u_1' y_1' + u_2' y_2' + \cdots + u_n' y_n' &= 0, \\ & \vdots \\ u_1' y_1^{(n-2)} + u_2' y_2^{(n-2)} + \cdots + u_n' y_n^{(n-2)} &= 0. \end{aligned}$$ The final condition comes from substituting into the ODE itself: $$u_1' y_1^{(n-1)} + u_2' y_2^{(n-1)} + \cdots + u_n' y_n^{(n-1)} = g(t).$$ This system is solved for $u_1', u_2', \dots, u_n'$ using the Wronskian of the fundamental set, $W(y_1, y_2, \dots, y_n)(t)$. The formula for each is analogous, involving cofactor determinants. The process is computationally heavier but remains a guaranteed procedure.

Advantages Over Undetermined Coefficients

Variation of Parameters holds two decisive advantages that make it indispensable for engineering analysis:

  1. Universal Applicability: It works for any continuous nonhomogeneous term $g(t)$. Undetermined Coefficients is limited to $g(t)$ that are a sum of terms of the form $t^m e^{\alpha t} \cos(\beta t)$ or $t^m e^{\alpha t} \sin(\beta t)$. If $g(t)$ is $\ln(t)$, $\sec(t)$, or a non-standard function, Variation of Parameters is your only direct analytical choice.
  2. Theoretical Clarity: It provides a closed-form integral formula for the particular solution, which is useful for theoretical proofs and sensitivity analysis. It directly reveals how the forcing function $g(t)$ is "filtered" through the homogeneous solutions.

The trade-off is computational complexity. The integrals you get can be non-elementary or messy, and the method requires you to fully solve the homogeneous equation first. Undetermined Coefficients, when applicable, is usually faster and involves simpler algebra.

Computational Procedure: A Step-by-Step Guide

Let's solidify the method with a structured workflow for a second-order equation:

  1. Solve the Homogeneous ODE: Find a fundamental set of solutions $\{y_1, y_2\}$ and the homogeneous solution $y_h = c_1 y_1 + c_2 y_2$.
  2. Compute the Wronskian: Calculate $W(t) = y_1 y_2' - y_2 y_1'$. Simplify it. This step is critical; an error here will propagate.
  3. Set Up the Integrands: Form the expressions for the derivatives of the parameter functions:

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

  1. Integrate: Find $u_1(t)$ and $u_2(t)$ by integrating the expressions from the previous step:

$$u_1(t) = \int u_1'(t) \, dt, \quad u_2(t) = \int u_2'(t) \, dt.$$ Omit the constants of integration.

  1. Construct the Particular Solution: Assemble $y_p(t) = u_1(t)y_1(t) + u_2(t)y_2(t)$.
  2. Form the General Solution: The complete solution to the nonhomogeneous ODE is $y(t) = y_h(t) + y_p(t)$.

Worked Example: Find a particular solution to $y'' + y = \sec(t)$.

  • Step 1: The homogeneous solution is $y_h = c_1 \cos(t) + c_2 \sin(t)$. So, $y_1 = \cos(t)$, $y_2 = \sin(t)$.
  • Step 2: Compute the Wronskian: $W = (\cos(t))(\cos(t)) - (\sin(t))(-\sin(t)) = \cos^2(t) + \sin^2(t) = 1$.
  • Step 3: Set up integrands with $g(t) = \sec(t)$:

$$u_1' = \frac{-\sin(t) \sec(t)}{1} = -\tan(t), \quad u_2' = \frac{\cos(t) \sec(t)}{1} = 1.$$

  • Step 4: Integrate:

$$u_1 = \int -\tan(t) \, dt = \ln|\cos(t)|, \quad u_2 = \int 1 \, dt = t.$$

  • Step 5 & 6: Construct $y_p$ and the general solution:

$$y_p = \ln|\cos(t)| \cdot \cos(t) + t \cdot \sin(t),$$ $$y = c_1 \cos(t) + c_2 \sin(t) + \cos(t) \ln|\cos(t)| + t \sin(t).$$

Common Pitfalls

  1. Applying the Method Before Solving the Homogeneous Equation: Variation of Parameters is not a guesswork method. You must have a correct fundamental set $\{y_1, y_2, ...\}$ before you begin. Attempting to skip this step will lead to an unsolvable system.
  2. Incorrect Wronskian Calculation: A sign error or simplification mistake in computing $W(t)$ will make the formulas for $u_1'$ and $u_2'$ incorrect. Always double-check this determinant. Remember, for a fundamental set, $W(t) \neq 0$.
  3. Including Constants of Integration: When integrating $u_1'$ and $u_2'$, do not add constants $+C$. Adding them would yield $y_p = u_1 y_1 + u_2 y_2 + C_1 y_1 + C_2 y_2$, where the last two terms are just part of the homogeneous solution. The method is designed to produce a particular solution without these extra terms.
  4. Misidentifying $g(t)$: Ensure the ODE is in standard form (leading coefficient 1) before identifying $g(t)$. For an equation like $t^2 y'' + t y' + y = \ln(t)$, you must first divide by $t^2$ to get $y'' + \frac{1}{t}y' + \frac{1}{t^2}y = \frac{\ln(t)}{t^2}$. Here, $g(t)=\frac{\ln(t)}{t^2}$, not $\ln(t)$.

Summary

  • Variation of Parameters is a general method for finding a particular solution $y_p$ to a nonhomogeneous linear ODE by replacing the constants in the homogeneous solution with unknown functions and solving for them.
  • The method's core machinery relies on the Wronskian of the fundamental solution set to derive formulas for the derivatives of these variable parameters.
  • It is applicable to ODEs of any order and, crucially, works for arbitrary continuous forcing functions $g(t)$, making it more versatile than the method of Undetermined Coefficients.
  • The computational procedure is systematic: 1) Solve the homogeneous ODE, 2) Compute the Wronskian, 3) Form the integrands for $u_i'$, 4) Integrate to find $u_i$, 5) Assemble $y_p$.
  • The primary trade-off for its generality is increased computational complexity, often involving integrals that are difficult to evaluate, but the method guarantees a correct analytical path forward where other methods fail.

Write better notes with AI

Mindli helps you capture, organize, and master any subject with AI-powered summaries and flashcards.