DifferentialEquations
Chapter 4 · Section 4.4

4.4 Variation of Parameters

In Section 4.3 we found particular solutions by guessing their shape. That works beautifully, but only when two things are true at the same time: the coefficients are constant, and the right-hand side belongs to the small family of "UC functions" (polynomials, exponentials, sines, cosines, and their products). Step outside that family and the guessing game stops working.

This section develops a method that needs neither condition. If you know two independent solutions of the homogeneous equation, variation of parameters always produces a particular solution, whatever continuous forcing term you are given. The price is that you must evaluate integrals, and sometimes they are hard.

Why we need another method

Consider the forcing term . Undetermined coefficients would start from a guess built from and all its derivatives. But differentiating gives , differentiating again produces , and so on: each derivative brings in a new function. There is no finite family to put into a guess, so the method has nothing to work with.

The same thing happens with forcing terms such as , , or . And undetermined coefficients is useless for any equation with non-constant coefficients, for example

even though its right-hand side looks perfectly innocent.

Variation of parameters handles all of these cases. Its only requirement is that we already know the complementary function .

First step: put the equation in normalized form

We work with a second-order linear equation

on an interval where . Before doing anything else, divide by the leading coefficient :

We call this the normalized (or standard) form. Throughout this section, always means the right-hand side after this division. We assume that , and are continuous on , and that form a fundamental set of solutions of the homogeneous equation on (Section 4.1). In particular their Wronskian

is never zero on . (Section 4.6 proves this fact carefully.)

Common mistake: forgetting to normalize

The formulas below are derived for an equation whose leading coefficient is exactly . If you apply them to using instead of , you get a wrong answer, and nothing in the algebra warns you. Example 4.4.4 shows this trap on a concrete equation. Even with constant coefficients, an equation like needs .

Deriving the method, one step at a time

The idea. The complementary function solves the homogeneous equation for every choice of the constants. It cannot solve the nonhomogeneous one, because constants are too rigid. So we let the "parameters" vary: we replace the constants by unknown functions and look for a particular solution of the form

That is where the name comes from. We now have two unknown functions, and , but only one requirement, namely that satisfies the differential equation. One equation cannot pin down two functions. This gives us room to add a second condition of our own choosing, and we will choose it to make the algebra as simple as possible.

Step 1: differentiate once. By the product rule,

Step 2: impose the extra condition. If we differentiate again as it stands, second derivatives and will appear, and we would be trading one second-order equation for something worse. To prevent that, we demand

Then the first derivative simplifies to

Why are we allowed to impose condition (A)?

We are not claiming that every pair that makes a solution must satisfy (A). We are only searching among the pairs that do. If this restricted search succeeds, the we find is a genuine solution and the question is settled; how we found it does not matter. Below we will see that the search always succeeds: the conditions lead to a linear system whose determinant is the Wronskian, which is never zero. So the extra condition costs nothing and makes everything first order in .

Step 3: differentiate again. From ,

Step 4: substitute into the equation. Put , , into and collect the terms that multiply and :

Both brackets are zero, because and solve the homogeneous equation. What survives must equal :

Step 5: the 2×2 system. Conditions (A) and (B) form a linear algebraic system for the two unknowns and (at each fixed ):

The coefficient matrix is exactly the Wronskian matrix. Its determinant is never zero on , so the system has exactly one solution at every point.

Step 6: Cramer's rule. Replace the first column by the right-hand side to get , and the second column to get :

Step 7: integrate. Any antiderivatives will do:

Theorem 4.4.1 (Variation of parameters)

Let , , be continuous on an open interval , and let be a fundamental set of solutions of on , with Wronskian . Then

is a particular solution of on , and the general solution is .

What about the constants of integration?

If you add constants, and , then changes by , which is part of the complementary function anyway. So you may set all constants of integration to zero. Similarly, if your contains a term that is a multiple of or , you may drop it.

An integral formula for the particular solution

Instead of indefinite integrals we may use definite integrals starting at a fixed point . Writing for the integration variable and combining the two terms,

Because , this particular choice satisfies and . In words: it is the response of a system that starts at rest at . Engineers recognize as an impulse response, and the formula as a superposition of responses to short "kicks" . Example 4.4.5 makes this concrete.

Method in a nutshell
  1. Write the equation in normalized form . Note the interval where are continuous.
  2. Find (or take as given) two independent solutions of the homogeneous equation.
  3. Compute and simplify it.
  4. Form and . Simplify before integrating.
  5. Integrate (constants may be dropped) and set . Remove any multiples of , .
  6. Write , then apply initial conditions if there are any.

Two Wronskians come up again and again for constant-coefficient equations, so it pays to remember them:

Which method should you use?

  • Constant coefficients and a UC right-hand side (such as , , ): use undetermined coefficients. It needs only differentiation and algebra, and it is usually faster.
  • Right-hand side not of UC type (such as , , , ): use variation of parameters.
  • Variable coefficients: variation of parameters is the only method of this chapter that works, provided are known (given, or found as in Section 4.5 for Cauchy–Euler equations, or by reduction of order).
  • You need a formula valid for a general forcing , say to study a whole class of inputs: use the integral formula above.

Try it yourself

The solver below runs the method step by step: complementary function, Wronskian, , , the integrals and the final answer. The first preset is the trigonometric case . The second is a repeated-root case, . Change the numbers and compare with your own hand computation.

Worked examples

Example 4.4.1

Find the general solution of on the interval .

Solution
  1. Why this interval? is continuous only between consecutive zeros of . On we have , so the theory applies there. The equation is already normalized, with .
  2. Homogeneous solutions. gives , so , .
  3. Wronskian. .
  4. The derivatives , .
  5. Integrate. Since , we get (no absolute value needed, as here) and .
  6. Particular solution. .
  7. General solution.
Figure 4.4.1. Example 4.4.1. The forcing (left) blows up at , the ends of the interval. The particular solution (right) nevertheless stays bounded and tends to at both ends.
Example 4.4.2

Solve the initial-value problem , , , for .

Solution
  1. Why not undetermined coefficients? The factor is not a UC function, so no finite guess exists. The equation is normalized with , continuous for .
  2. Homogeneous solutions. , a double root. So , , and .
  3. The derivatives , . Notice how the exponentials cancel completely. This always happens in the repeated-root case with forcing .
  4. Integrate. , .
  5. Particular solution. .
  6. General solution. .
  7. Initial conditions. Differentiating, . At : From the first, . Substituting into the second gives , so and .
  8. Answer. , for .
Figure 4.4.2. The solution of Example 4.4.2 (solid) touches the axis at with zero slope, as the initial conditions demand, and blows up as , just as the forcing does. The dashed curve is the particular solution produced by variation of parameters.
Example 4.4.3

A damped oscillator is driven by a force that is not of UC type: , for . Find the general solution.

Solution
  1. Homogeneous solutions. gives . So , .
  2. Wronskian. Using with , : . (You can confirm it directly: , , and the cross terms cancel.)
  3. The derivatives , . With :
  4. Integrate. . Since and on our interval, .
  5. General solution.
Example 4.4.4 (variable coefficients)

Verify that and solve , and then find the general solution of

Solution
  1. Check , . For : , , so . For : . Both work.
  2. Normalize. The leading coefficient is , which is nonzero for . Dividing by : So , not .
  3. Wronskian. , which is nonzero for .
  4. The derivatives , .
  5. Integrate. . By parts, , so .
  6. Particular solution.
  7. Check. and . Then . Correct.
  8. General solution. , for .

If you had used (the un-normalized right-hand side), the integrals would still go through, but the resulting function would fail the check in the seventh step. Normalizing first is not optional.

Example 4.4.5 (response of an oscillator starting at rest)

Think of as time. A mass on a spring with natural frequency is at rest when an external force (per unit mass) starts to act: (a) Show that . (b) Find the response to a constant force switched on at .

Solution
  1. Fundamental set. , , with .
  2. The kernel. Using the integral formula with , by the subtraction formula .
  3. Initial conditions. The integral-formula particular solution already satisfies , so no homogeneous part is needed. This proves (a).
  4. Constant force. With :
  5. Interpretation. The static deflection under the force would be . A force applied suddenly makes the mass oscillate between and : the peak is twice the static value. Structural engineers call this the dynamic amplification of a suddenly applied load.
Figure 4.4.3. Response of Example 4.4.5 to a constant force switched on at , measured in units of the static deflection . The mass oscillates about the static position and reaches twice the static deflection.

Extension to third and higher order

The same idea works for (again normalized, leading coefficient ). With a fundamental set , try . Now there are three unknown functions, so we may impose two extra conditions. We impose them exactly as before, to stop derivatives of from appearing in and . Substituting into the equation then gives the third condition. The result is the system

Its determinant is the Wronskian , which is never zero on . By Cramer's rule,

where is the determinant obtained from by replacing its -th column by . For an equation of order the pattern is the same: conditions with right-hand side , and a last one with right-hand side . Remember to divide by the leading coefficient first.

Example 4.4.6 (third order)

Find the general solution of on .

Solution
  1. Homogeneous solutions. gives . So , , .
  2. Wronskian. Expanding along the first column,
  3. The three minors. Replace column by and expand:
  4. The derivatives. With and :
  5. Integrate. Since , we get . Also and . (All logarithms have positive arguments on .)
  6. General solution.

Exercises

  1. Find the general solution of on .
    Answer
  2. Find the general solution of on .
    Answer
  3. Find the general solution of for .
    Answer
  4. Find the general solution of for .
    Answer
  5. Find the general solution of .
    Answer
  6. Given that and solve , find the general solution of on . (Normalize first.)
    Answer (variation of parameters gives , )
  7. Verify that and solve for , then solve .
    Answer
  8. Find the general solution of the third-order equation on .
    Answer
  9. Solve the initial-value problem , , . (Use Example 4.4.1.)
    Answer , for
  10. Solve twice: by undetermined coefficients and by variation of parameters. Explain why the two particular solutions differ.
    Answer . Variation of parameters gives ; the extra term is a multiple of and is absorbed into .
  11. Show that the solution of , , is . Evaluate it for .
    Answer With , , , the kernel is . For : .