Differential Equations · Undergraduate

Variation of Parameters for Second-Order Equations

Quick answer

Undetermined coefficients works only for forcing terms like polynomials, exponentials, sines and cosines. Variation of parameters works for any continuous forcing g(t). Starting from two homogeneous solutions y₁ and y₂, look for y_p = u₁y₁ + u₂y₂ with functions u₁ and u₂ in place of constants. Two conditions give u₁′ = −y₂g/W and u₂′ = y₁g/W, where W = y₁y₂′ − y₁′y₂ is the Wronskian. Integrating gives the particular solution.

What you'll learn

  • Compute the Wronskian of two solutions
  • Find a particular solution by variation of parameters
  • Solve equations with forcing like sec t or eᵗ/t
  • Choose between undetermined coefficients and variation of parameters

Letting the constants vary

Undetermined coefficients guesses the form of a particular solution, which works only when the forcing is a polynomial, exponential, sine or cosine. For y′′+y=sec⁡ty'' + y = \sec t there is no good guess. Variation of parameters handles any continuous forcing.

For y′′+p(t)y′+q(t)y=g(t)y'' + p(t)y' + q(t)y = g(t), let y1y_1 and y2y_2 solve the homogeneous equation, and let W=y1y2′−y1′y2W = y_1y_2' - y_1'y_2 be their Wronskian. Look for

yp=u1(t) y1+u2(t) y2y_p = u_1(t)\,y_1 + u_2(t)\,y_2

with functions in place of the constants c1c_1 and c2c_2. The result is

u1′=−y2 gWu2′=y1 gWu_1' = -\frac{y_2\,g}{W} \qquad u_2' = \frac{y_1\,g}{W}

Integrate each, and yp=u1y1+u2y2y_p = u_1y_1 + u_2y_2.

Why the formulas hold

Two unknown functions need two conditions. Differentiating ypy_p gives u1y1′+u2y2′+(u1′y1+u2′y2)u_1y_1' + u_2y_2' + (u_1'y_1 + u_2'y_2). Choose the first condition to make the bracket zero:

u1′y1+u2′y2=0u_1'y_1 + u_2'y_2 = 0

Then yp′′y_p'' has only first derivatives of u1u_1 and u2u_2. Substituting into the equation, every term with u1u_1 or u2u_2 alone cancels, because y1y_1 and y2y_2 solve the homogeneous equation, leaving

u1′y1′+u2′y2′=gu_1'y_1' + u_2'y_2' = g

These are two linear equations in u1′u_1' and u2′u_2', and Cramer’s rule solves them with denominator WW. The Wronskian is nonzero because y1y_1 and y2y_2 are independent.

Worked examples

Common mistakes

Practice problems

  1. Find the Wronskian of cos⁡2t\cos 2t and sin⁡2t\sin 2t.

    Answer

    22

    Full solution

    cos⁡2t⋅2cos⁡2t−(−2sin⁡2t)sin⁡2t=2\cos 2t \cdot 2\cos 2t - (-2\sin 2t)\sin 2t = 2.

  2. Find the Wronskian of ete^t and e−te^{-t}.

    Answer

    −2-2

    Full solution

    et(−e−t)−et⋅e−t=−1−1e^t(-e^{-t}) - e^t \cdot e^{-t} = -1 - 1.

  3. Find a particular solution of y′′+y=csc⁡ty'' + y = \csc t.

    Answer

    yp=−tcos⁡t+sin⁡t ln⁡∣sin⁡t∣y_p = -t\cos t + \sin t\,\ln\lvert\sin t\rvert

    Full solution

    W=1W = 1, u1′=−sin⁡tcsc⁡t=−1u_1' = -\sin t\csc t = -1, u2′=cos⁡tcsc⁡t=cot⁡tu_2' = \cos t\csc t = \cot t. So u1=−tu_1 = -t and u2=ln⁡∣sin⁡t∣u_2 = \ln\lvert\sin t\rvert.

  4. Use variation of parameters to find a particular solution of y′′−y=ety'' - y = e^t.

    Answer

    yp=12tety_p = \tfrac{1}{2}te^t

    Full solution

    y1=ety_1 = e^t, y2=e−ty_2 = e^{-t}, W=−2W = -2. u1′=12u_1' = \tfrac{1}{2} and u2′=−12e2tu_2' = -\tfrac{1}{2}e^{2t}, so yp=t2et−14ety_p = \tfrac{t}{2}e^t - \tfrac{1}{4}e^t; drop the homogeneous −14et-\tfrac{1}{4}e^t.

  5. Which method would you use for y′′+4y=tan⁡2ty'' + 4y = \tan 2t?

    Answer

    Variation of parameters

    Full solution

    tan⁡2t\tan 2t is not a polynomial, exponential, sine or cosine, so there is no form to guess.

  6. Write the general solution of y′′+y=sec⁡ty'' + y = \sec t.

    Answer

    y=c1cos⁡t+c2sin⁡t+cos⁡tln⁡∣cos⁡t∣+tsin⁡ty = c_1\cos t + c_2\sin t + \cos t\ln\lvert\cos t\rvert + t\sin t

    Full solution

    Add the homogeneous solution to ypy_p from Example 1.

  7. Find a particular solution of y′′−2y′+y=ett2y'' - 2y' + y = \tfrac{e^t}{t^2} for t>0t > 0.

    Answer

    yp=−etln⁡ty_p = -e^t\ln t

    Full solution

    W=e2tW = e^{2t}, u1′=−1tu_1' = -\tfrac{1}{t}, u2′=1t2u_2' = \tfrac{1}{t^2}. So u1=−ln⁡tu_1 = -\ln t, u2=−1tu_2 = -\tfrac{1}{t}, and yp=−etln⁡t−ety_p = -e^t\ln t - e^t; drop −et-e^t.

  8. A student solves 2y′′+2y=sec⁡t2y'' + 2y = \sec t and gets yp=cos⁡tln⁡∣cos⁡t∣+tsin⁡ty_p = \cos t\ln\lvert\cos t\rvert + t\sin t. What went wrong?

    Answer

    The equation was not divided by 22 first; ypy_p should be half that.

    Full solution

    In standard form g=12sec⁡tg = \tfrac{1}{2}\sec t, so yp=12(cos⁡tln⁡∣cos⁡t∣+tsin⁡t)y_p = \tfrac{1}{2}(\cos t\ln\lvert\cos t\rvert + t\sin t).

Frequently asked questions

What is variation of parameters?

A method for a particular solution of y″ + p y′ + q y = g. It replaces the constants in c₁y₁ + c₂y₂ by functions u₁(t) and u₂(t) and solves for them.

What are the formulas?

u₁′ = −y₂g/W and u₂′ = y₁g/W, where W = y₁y₂′ − y₁′y₂. Then y_p = u₁y₁ + u₂y₂.

What is the Wronskian?

W = y₁y₂′ − y₁′y₂. It is nonzero exactly when y₁ and y₂ are independent solutions.

When should I use variation of parameters instead of undetermined coefficients?

When g is not a polynomial, exponential, sine, cosine or product of these, for example sec t, tan t, ln t or eᵗ/t.

Does the leading coefficient matter?

Yes. The formulas assume the equation starts with y″. Divide through by the coefficient of y″ first.

What to learn next