Learn Without Walls
← Lesson 3 Lesson 4 of 4 Practice Problems →

Lesson 4: Variation of Parameters

Estimated time: 35-45 minutes

Learning Objectives

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

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

  1. Write in standard form (leading coefficient = 1).
  2. Find yh = c1y1 + c2y2.
  3. Compute the Wronskian W = y1y2' - y2y1'.
  4. Set up the integrals for the formula.
  5. Evaluate the integrals (this is often the hardest step).
  6. 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

MethodUse WhenAdvantage
Undetermined Coefficientsg(t) is polynomial, exponential, sin/cos, or products thereofFaster, no integration required
Variation of ParametersAny 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).

Answer: W = cos(2t)(2cos(2t)) - sin(2t)(-2sin(2t)) = 2cos²(2t) + 2sin²(2t) = 2.

2. Could you use undetermined coefficients for y'' + y = et ln(t)?

Answer: No. ln(t) is not a polynomial, exponential, or trig function. You must use variation of parameters.

3. Why must the ODE be in standard form (leading coefficient 1) for variation of parameters?

Answer: The formula assumes the equation is y'' + py' + qy = g. If you have ay'' + by' + cy = f(t), you must divide by a first so that g(t) = f(t)/a.

Key Takeaways

Module 4 Complete!

Practice Problems

10 problems covering all second-order linear ODE techniques.

Practice Problems

Module Quiz

Test your mastery of second-order methods.

Take the Quiz