1 / 15
Chapter 2 · Second-Order ODEs
Variation of Parameters
The Universal Method for ANY Forcing Function
Dr. Mohamed Mabrok · Qatar University
Why We Need Variation of Parameters
Undetermined Coefficients
(Limited)
Polynomials, exponentials, trig
$ay'' + by' + cy = g(t)$
Variation of Parameters
(Universal!)
Works for ANY g(t)
When UC Fails
Functions like $\tan(t)$, $\sec(t)$, $\ln(t)$, $1/t$, $e^t/t^2$, etc. require Variation of Parameters!
The Brilliant Idea: Varying the Parameters
Standard Homogeneous Solution
$$y_c = C_1 y_1(t) + C_2 y_2(t)$$
The Key Insight
What if the constants aren't constant?
$$C_1 \to u_1(t), \quad C_2 \to u_2(t)$$
$$y_p = u_1(t)y_1(t) + u_2(t)y_2(t)$$
Why This Works
By letting $C_1$ and $C_2$ vary as functions, we gain enough flexibility to match ANY forcing function $g(t)$.
Deriving the Variation of Parameters Formulas
STEP 1
Start with $y_p = u_1 y_1 + u_2 y_2$ and compute derivatives
$$y_p' = u_1' y_1 + u_1 y_1' + u_2' y_2 + u_2 y_2'$$
STEP 2
Impose constraint: $u_1' y_1 + u_2' y_2 = 0$ (simplification)
$$y_p' = u_1 y_1' + u_2 y_2'$$
STEP 3
Compute $y_p''$
$$y_p'' = u_1' y_1' + u_1 y_1'' + u_2' y_2' + u_2 y_2''$$
STEP 4
Substitute into $ay'' + by' + cy = g(t)$ and simplify
$$u_1' y_1' + u_2' y_2' = \frac{g(t)}{a}$$
The Wronskian Determinant
We now 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}$$
Apply Cramer's Rule
Solving this system introduces a key determinant:
$$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'$$
Fundamental Property
If $W(y_1, y_2) \neq 0$, then $y_1$ and $y_2$ are linearly independent, and a unique particular solution exists!
The Variation of Parameters Formulas
The Complete Solution
$$u_1(t) = -\int \frac{y_2(t) \cdot g(t)}{a \cdot W(t)} dt$$
$$u_2(t) = \int \frac{y_1(t) \cdot g(t)}{a \cdot W(t)} dt$$
$$y_p = u_1(t)y_1(t) + u_2(t)y_2(t)$$
$$y = C_1 y_1 + C_2 y_2 + u_1 y_1 + u_2 y_2$$
Important!
Don't forget the factor $1/a$ in the formulas! This is the coefficient of $y''$.
The 5-Step Method
1
Solve the homogeneous equation to find $y_1(t)$ and $y_2(t)$
2
Compute the Wronskian: $W = y_1 y_2' - y_2 y_1'$
3
Find $u_1(t) = -\int \frac{y_2 g}{aW} dt$
4
Find $u_2(t) = \int \frac{y_1 g}{aW} dt$
5
Assemble: $y = C_1 y_1 + C_2 y_2 + u_1 y_1 + u_2 y_2$
Pro Tip
Steps 3 and 4 (the integrations) are often the hardest part. Take your time with these!
Worked Example
Solve: $y'' + y = \tan(t)$
STEPS 1-2
Homogeneous solution and Wronskian
$$r^2 + 1 = 0 \implies y_1 = \cos(t), \quad y_2 = \sin(t)$$
$$W = \cos^2(t) + \sin^2(t) = 1$$
STEPS 3-4
Find $u_1$ and $u_2$
$$u_1 = -\int \sin(t) \tan(t) dt = \sin(t) - \ln|\sec(t) + \tan(t)|$$
$$u_2 = \int \cos(t) \tan(t) dt = -\cos(t)$$
STEP 5
General solution
$$y = C_1 \cos(t) + C_2 \sin(t) - \cos(t) \ln|\sec(t) + \tan(t)|$$
Worked Example
Solve: $y'' + 9y = 9\sec^2(3t)$
STEPS 1-2
Setup
$$r^2 + 9 = 0 \implies y_1 = \cos(3t), \quad y_2 = \sin(3t)$$
$$W = 3$$
STEPS 3-4
Integrate
$$u_1 = -\int \frac{\sin(3t) \cdot 9\sec^2(3t)}{3} dt = -\sec(3t)$$
$$u_2 = \int \frac{\cos(3t) \cdot 9\sec^2(3t)}{3} dt = \ln|\sec(3t) + \tan(3t)|$$
STEP 5
Solution
$$y = C_1\cos(3t) + C_2\sin(3t) - 1 + \sin(3t)\ln|\sec(3t) + \tan(3t)|$$
Worked Example
Solve: $y'' - y = e^t \sin(t)$
STEPS 1-2
Characteristic equation
$$r^2 - 1 = 0 \implies r = \pm 1$$
$$y_1 = e^t, \quad y_2 = e^{-t}, \quad W = -2$$
STEPS 3-4
Integrals
$$u_1 = \frac{1}{2}\int \sin(t) dt = -\frac{1}{2}\cos(t)$$
$$u_2 = -\frac{1}{2}\int e^{2t}\sin(t) dt = -\frac{e^{2t}(2\sin(t) + \cos(t))}{10}$$
STEP 5
General solution
$$y = C_1 e^t + C_2 e^{-t} - e^t\frac{2\cos(t) + \sin(t)}{5}$$
Worked Example
Solve: $y'' + 2y' + y = t^2 e^{-t}$
STEPS 1-2
Repeated roots
$$(r+1)^2 = 0 \implies y_1 = e^{-t}, \quad y_2 = t e^{-t}, \quad W = e^{-2t}$$
STEPS 3-4
Find $u_1$ and $u_2$
$$u_1 = -\int t^3 dt = -\frac{t^4}{4}$$
$$u_2 = \int t^2 dt = \frac{t^3}{3}$$
STEP 5
Particular solution
$$y = C_1 e^{-t} + C_2 t e^{-t} + \frac{t^4 e^{-t}}{12}$$
Comparison: Undetermined Coefficients vs Variation of Parameters
| Feature |
Undetermined Coefficients |
Variation of Parameters |
| Works for which g(t)? |
Polynomials, exponentials, sin/cos |
ANY function |
| Method Complexity |
Easy (guess & match) |
Requires integration |
| Resonance |
Needs modification |
Handles naturally |
| Integration |
No |
Yes (often hard) |
| Wronskian Needed |
No |
Yes |
Use UC When...
$g(t)$ is polynomial, exponential, or trig. UC is faster when applicable!
Use VP When...
$g(t)$ is exotic ($\tan$, $\sec$, $\ln$, $1/t$, etc.) or UC doesn't apply.
Worked Example
Solve: $y'' - 2y' + y = \frac{e^t}{t^2}$
UC cannot handle $1/t^2$. VP is the only method!
STEPS 1-2
Homogeneous solution
$$(r-1)^2 = 0 \implies y_1 = e^t, \quad y_2 = t e^t, \quad W = e^{2t}$$
STEPS 3-4
Integration
$$u_1 = -\int \frac{1}{t} dt = -\ln|t|$$
$$u_2 = \int \frac{1}{t^2} dt = -\frac{1}{t}$$
STEP 5
Solution
$$y = C_1 e^t + C_2 t e^t - e^t(\ln|t| + 1)$$
Common Mistakes to Avoid
⚠️ Typical Errors
- Forgetting the factor $1/a$: Always divide $g(t)$ by the leading coefficient!
- Wronskian computation: Watch for sign errors in $y_1 y_2' - y_2 y_1'$.
- Missing the negative sign: Remember $u_1 = -\int \frac{y_2 g}{aW} dt$ (with minus!).
- Not simplifying $y_p$: Terms often cancel after algebra — always expand and simplify.
- Using VP unnecessarily: If UC works, use it — VP is a last resort for exotic functions.
Key Verification
Always verify $W \neq 0$ before proceeding. If $W = 0$, your solution functions are linearly dependent!
Key Takeaways & Summary
The Variation of Parameters Method
- The Core Idea: Replace constants $C_1, C_2$ with functions $u_1(t), u_2(t)$.
- The Constraint: Impose $u_1' y_1 + u_2' y_2 = 0$ to simplify the algebra.
- The Wronskian: Compute $W = y_1 y_2' - y_2 y_1'$ — this is essential!
- The Formulas: Use $u_1 = -\int \frac{y_2 g}{aW} dt$ and $u_2 = \int \frac{y_1 g}{aW} dt$.
- Universal Power: VP works for ANY $g(t)$ — this is your ultimate weapon!
Next Topic
Coming up: Euler Equations — how to handle ODEs with variable coefficients, not just constants.
🔊
Voice
1×