For the differential equation

*a*, *b*, and *c* are constants and the right‐hand term *d*( *x*) is of a special form. If these restrictions do not apply to a given nonhomogeneous linear differential equation, then a more powerful method of determining a particular solution is needed: the method known as **variation of parameters**.

The first step is to obtain the general solution of the corresponding homogeneous equation, which will have the form

*y* _{1} and *y* _{2} are known functions. The next step is to *vary the parameters*; that is, to replace the constants *c* _{1} and *c* _{2} by (as yet unknown) functions *v* _{1}( *x*) and *v* _{2}( *x*) to obtain the form of a particular solution

The goal is to determine these functions *v* _{1} and *v* _{2}. Then, since the functions *y* _{1} and *y* _{2} are already known, the expression above for *y* _{h}then gives the general solution of the non‐homogeneous differential equation, as guaranteed by Theorem B.

Since there are two unknowns to be determined, *v* _{1} and *v* _{2}, two equations or conditions are required to obtain a solution. One of these conditions will naturally be satisfying the given differential equation. But another condition will be imposed first. Since

Now, to simplify the rest of the process—and to produce the first condition on *v* _{1} and *v* _{2}—set

*This will always be the first condition in determining* *v* _{1} and *v* _{2}; *the second condition will be the satisfaction of the given differential equation* (*).

**Example 1**: Give the general solution of the differential equation *y*″ + *y* = tan *x*.

Since the nonhomogeneous right‐hand term, *d* = tan *x*, is not of the special form the method of undetermined coefficients can handle, variation of parameters is required. The first step is to obtain the general solution of the corresponding homogeneous equation, *y*″ + *y* = 0. The auxiliary polynomial equation is *m* = ± *i* = 0 ± 1 *i*. The general solution of the homogeneous equation is therefore

Now, vary the parameters *c* _{1} and *c* _{2} to obtain

Differentialtion yields

Nest, remember the first condition to be imposed on *v* _{1} and *v* _{2}:

This reduces the expression for

Substitution into the given nonhomogeneous equation *y*″ + *y* = tan *x* yields

Therefore, the two conditions on *v* _{1} and *v* _{2} are

To solve these two equations for *v* _{1}′ and *v* _{2}′, first multiply the first equation by sin *x*; then multiply the second equation by cos *x*:

Adding these equations yields

Substituting *v* _{1}′ = sin *x* back into equation (1) [or equation (2)] then gives

Now, integrate to find *v* _{1} and *v* _{2} (and ignore the constant of integration in each case):

Therefore, a particular solution of the given nonhomogeneous differential equation is

Combining this with the general solution of the corresponding homogeneous equation gives the general solution of the nonhomogeneous equation:

In general, when the method of variation of parameters is applied to the second‐order nonhomogeneous linear differential equation

*v* _{1}( *x*) *y* _{1} + *v* _{2}( *x*) *y* _{2} (where *y* _{h }= *c* _{1} *y* _{1} +*c* _{2} *y* _{2} is the general solution of the corresponding homogeneous equation), the two conditions on *v* _{1} and *v* _{2} will always be

So after obtaining the general solution of the corresponding homogeneous equation ( *y* _{h }= *c* _{1} *y* _{1} + *c* _{2} *y* _{2}) and varying the parameters by writing *v* _{1} *y* _{1} + *v* _{2} *y* _{2}, go directly to equations (1) and (2) above and solve for *v* _{1}′ and *v* _{2}′.

**Example 2**: Give the general solution of the differential equation

Because of the In *x* term, the right‐hand side is not one of the special forms that the method of undetermined coefficients can handle; variation of parameters is required. The first step requires obtaining the general solution of the corresponding homogeneous equation, *y*″ – 2 *y*′ + *y* = 0:

Varying the parameters gives the particular solution

Cancel out the common factor of *e* ^{x }in both equations; then subtract the resulting equations to obtain

Substituting this back into either equation (1) or (2) determines

Now, integrate (by parts, in both these cases) to obtain *v* _{1} and *v* _{2} from *v* _{2}′ and *v* _{2}′:

Therefore, a particular solution is

Consequently, the general solution of the given nonhomogeneous equation is

**Example 3**: Give the general solution of the following differential equation, given that *y* _{1} = *x* and *y* _{2} = *x* ^{3} are solutions of its corresponding homogeneous equation:

Since the functions *y* _{1} = *x* and *y* _{2} = *x* ^{3} are linearly independent, Theorem A says that the general solution of the corresponding homogeneous equation is

Varying the parameters *c* _{1} and *c* _{2} gives the form of a particular solution of the given nonhomogeneous equation:

*v* _{1} and *v* _{2} are as yet undetermined. The two conditions on *v* _{1} and *v* _{2} which follow from the method of variation of parameters are

*y* _{1} = *x, y* _{2} = *x* ^{3}, *a* = *x* ^{2}, *d* = 12 *x* ^{4}) become

Solving this system for *v* _{1}′ and *v* _{2}′ yields

Therefore, the particular solution obtained is