Lesson 4: Variation of Parameters
Estimated time: 35-45 minutes
Learning Objectives
By the end of this lesson, you will be able to:
- Explain when variation of parameters is preferred over undetermined coefficients
- Compute the Wronskian of two solutions
- Apply the variation of parameters formula to find yp
- Solve nonhomogeneous ODEs with non-standard forcing functions
- Compare the two methods and choose the right one for each problem
Why Another Method?
Undetermined coefficients works beautifully for polynomials, exponentials, and trig functions. But what about g(t) = tan(t), g(t) = sec(t), g(t) = 1/t, or g(t) = et/t? For these, we need variation of parameters -- a completely general method.
The Formula
Given y'' + p(t)y' + q(t)y = g(t) with homogeneous solutions y1 and y2:
Variation of Parameters Formula:
yp(t) = -y1∫(y2g/W) dt + y2∫(y1g/W) dt
where W = W(y1, y2) = y1y2' - y2y1' is the Wronskian.
Important: The ODE must be in standard form y'' + p(t)y' + q(t)y = g(t) with leading coefficient 1. If the leading coefficient is a ≠ 1, divide through by a first.
Step-by-Step Procedure
- Write in standard form (leading coefficient = 1).
- Find yh = c1y1 + c2y2.
- Compute the Wronskian W = y1y2' - y2y1'.
- Set up the integrals for the formula.
- Evaluate the integrals (this is often the hardest step).
- Write yp and combine with yh.
Worked Examples
Example 1: y'' + y = sec(t)
This cannot be done by undetermined coefficients (sec is not polynomial, exponential, or trig).
Step 1: Already in standard form. g(t) = sec(t).
Step 2: r² + 1 = 0 ⇒ r = ±i. y1 = cos t, y2 = sin t.
Step 3: W = cos(t) · cos(t) - sin(t) · (-sin(t)) = cos²t + sin²t = 1.
Step 4: yp = -cos(t) ∫[sin(t) sec(t)/1] dt + sin(t) ∫[cos(t) sec(t)/1] dt
= -cos(t) ∫ tan(t) dt + sin(t) ∫ 1 dt
= -cos(t) · (-ln|cos t|) + sin(t) · t
Answer: yp = cos(t) ln|cos t| + t sin(t).
General solution: y = c1cos t + c2sin t + cos(t) ln|cos t| + t sin(t).
Example 2: y'' + y = tan(t)
Step 1: y1 = cos t, y2 = sin t, W = 1 (same as above).
Step 2: yp = -cos(t) ∫ sin(t) tan(t) dt + sin(t) ∫ cos(t) tan(t) dt
= -cos(t) ∫ sin²t/cos t dt + sin(t) ∫ sin t dt
= -cos(t) ∫ (sec t - cos t) dt + sin(t)(-cos t)
= -cos(t)[ln|sec t + tan t| - sin t] - sin(t) cos(t)
= -cos(t) ln|sec t + tan t| + sin(t) cos(t) - sin(t) cos(t)
Answer: yp = -cos(t) ln|sec t + tan t|.
Example 3: y'' - 2y' + y = et/t
Step 1: r² - 2r + 1 = (r-1)² = 0. y1 = et, y2 = tet.
Step 2: W = et(et + tet) - tet(et) = e2t + te2t - te2t = e2t.
Step 3: g(t) = et/t.
yp = -et∫[tet(et/t)/e2t] dt + tet∫[et(et/t)/e2t] dt
= -et∫ 1 dt + tet∫ (1/t) dt = -tet + tet ln|t|.
Answer: yp = tet(ln|t| - 1). The -tet part is absorbed into yh, so yp = tet ln|t|.
When to Use Which Method
| Method | Use When | Advantage |
|---|---|---|
| Undetermined Coefficients | g(t) is polynomial, exponential, sin/cos, or products thereof | Faster, no integration required |
| Variation of Parameters | Any g(t), including tan, sec, 1/t, ln(t), etc. | Always works (if you can do the integrals) |
Check Your Understanding
1. For y'' + 4y = sec(2t), find the Wronskian of y1 = cos(2t), y2 = sin(2t).
2. Could you use undetermined coefficients for y'' + y = et ln(t)?
3. Why must the ODE be in standard form (leading coefficient 1) for variation of parameters?
Key Takeaways
- Variation of parameters works for any forcing function g(t), not just special forms.
- The formula: yp = -y1∫(y2g/W)dt + y2∫(y1g/W)dt.
- The ODE must be in standard form (leading coefficient 1) before applying the formula.
- Use undetermined coefficients when possible (faster); use variation of parameters when you must.
- The hardest part is usually evaluating the integrals.