Second-Order Differential Equations

# 48 Nonhomogeneous Linear Equations

### Learning Objectives

• Write the general solution to a nonhomogeneous differential equation.
• Solve a nonhomogeneous differential equation by the method of undetermined coefficients.
• Solve a nonhomogeneous differential equation by the method of variation of parameters.

In this section, we examine how to solve nonhomogeneous differential equations. The terminology and methods are different from those we used for homogeneous equations, so let’s start by defining some new terms.

### General Solution to a Nonhomogeneous Linear Equation

Consider the nonhomogeneous linear differential equation

The associated homogeneous equation

is called the complementary equation. We will see that solving the complementary equation is an important step in solving a nonhomogeneous differential equation.

Definition

A solution of a differential equation that contains no arbitrary constants is called a particular solution to the equation.

General Solution to a Nonhomogeneous Equation

Let be any particular solution to the nonhomogeneous linear differential equation

Also, let denote the general solution to the complementary equation. Then, the general solution to the nonhomogeneous equation is given by

#### Proof

To prove is the general solution, we must first show that it solves the differential equation and, second, that any solution to the differential equation can be written in that form. Substituting into the differential equation, we have

So is a solution.

Now, let be any solution to Then

so is a solution to the complementary equation. But, is the general solution to the complementary equation, so there are constants and such that

Hence, we see that

Verifying the General Solution

Given that is a particular solution to the differential equation write the general solution and check by verifying that the solution satisfies the equation.

The complementary equation is which has the general solution So, the general solution to the nonhomogeneous equation is

To verify that this is a solution, substitute it into the differential equation. We have

Then

So, is a solution to

Given that is a particular solution to write the general solution and verify that the general solution satisfies the equation.

Hint

Find the general solution to the complementary equation.

In the preceding section, we learned how to solve homogeneous equations with constant coefficients. Therefore, for nonhomogeneous equations of the form we already know how to solve the complementary equation, and the problem boils down to finding a particular solution for the nonhomogeneous equation. We now examine two techniques for this: the method of undetermined coefficients and the method of variation of parameters.

### Undetermined Coefficients

The method of undetermined coefficients involves making educated guesses about the form of the particular solution based on the form of When we take derivatives of polynomials, exponential functions, sines, and cosines, we get polynomials, exponential functions, sines, and cosines. So when has one of these forms, it is possible that the solution to the nonhomogeneous differential equation might take that same form. Let’s look at some examples to see how this works.

Undetermined Coefficients When Is a Polynomial

Find the general solution to

The complementary equation is with general solution Since the particular solution might have the form If this is the case, then we have and For to be a solution to the differential equation, we must find values for and such that

Setting coefficients of like terms equal, we have

Then, and so and the general solution is

In (Figure), notice that even though did not include a constant term, it was necessary for us to include the constant term in our guess. If we had assumed a solution of the form (with no constant term), we would not have been able to find a solution. (Verify this!) If the function is a polynomial, our guess for the particular solution should be a polynomial of the same degree, and it must include all lower-order terms, regardless of whether they are present in

Undetermined Coefficients When Is an Exponential

Find the general solution to

The complementary equation is with the general solution Since the particular solution might have the form Then, we have and For to be a solution to the differential equation, we must find a value for such that

So, and Then, and the general solution is

Find the general solution to

Hint

Use as a guess for the particular solution.

In the previous checkpoint, included both sine and cosine terms. However, even if included a sine term only or a cosine term only, both terms must be present in the guess. The method of undetermined coefficients also works with products of polynomials, exponentials, sines, and cosines. Some of the key forms of and the associated guesses for are summarized in (Figure).

Key Forms for the Method of Undetermined Coefficients
Initial guess for
(a constant) (a constant)
(Note: The guess must include both terms even if )
(Note: The guess must include all three terms even if or are zero.)
Higher-order polynomials Polynomial of the same order as
(Note: The guess must include both terms even if either or )

Keep in mind that there is a key pitfall to this method. Consider the differential equation Based on the form of we guess a particular solution of the form But when we substitute this expression into the differential equation to find a value for we run into a problem. We have

and

so we want

which is not possible.

Looking closely, we see that, in this case, the general solution to the complementary equation is The exponential function in is actually a solution to the complementary equation, so, as we just saw, all the terms on the left side of the equation cancel out. We can still use the method of undetermined coefficients in this case, but we have to alter our guess by multiplying it by Using the new guess, we have

and

Substitution gives

So, and This gives us the following general solution

Note that if were also a solution to the complementary equation, we would have to multiply by again, and we would try

Problem-Solving Strategy: Method of Undetermined Coefficients
1. Solve the complementary equation and write down the general solution.
2. Based on the form of make an initial guess for
3. Check whether any term in the guess for is a solution to the complementary equation. If so, multiply the guess by Repeat this step until there are no terms in that solve the complementary equation.
4. Substitute into the differential equation and equate like terms to find values for the unknown coefficients in
5. Add the general solution to the complementary equation and the particular solution you just found to obtain the general solution to the nonhomogeneous equation.
Solving Nonhomogeneous Equations

Find the general solutions to the following differential equations.

1. The complementary equation is which has the general solution (step 1). Based on the form of our initial guess for the particular solution is (step 2). None of the terms in solve the complementary equation, so this is a valid guess (step 3).
Now we want to find values for and so substitute into the differential equation. We have

so we want to find values of and such that

Therefore,

This gives and so (step 4).
Putting everything together, we have the general solution

2. The complementary equation is which has the general solution (step 1). Based on the form our initial guess for the particular solution is (step 2). However, we see that this guess solves the complementary equation, so we must multiply by which gives a new guess: (step 3). Checking this new guess, we see that it, too, solves the complementary equation, so we must multiply by t again, which gives (step 3 again). Now, checking this guess, we see that does not solve the complementary equation, so this is a valid guess (step 3 yet again).
We now want to find a value for so we substitute into the differential equation. We have

and
Substituting into the differential equation, we want to find a value of so that

This gives so (step 4). Putting everything together, we have the general solution

3. The complementary equation is which has the general solution (step 1). Based on the form our initial guess for the particular solution is (step 2). None of the terms in solve the complementary equation, so this is a valid guess (step 3). We now want to find values for and so we substitute into the differential equation. We have and so we want to find values of and such that

Therefore,

This gives and so (step 4). Putting everything together, we have the general solution

4. The complementary equation is which has the general solution (step 1). Based on the form our initial guess for the particular solution is (step 2). However, we see that the constant term in this guess solves the complementary equation, so we must multiply by which gives a new guess: (step 3). Checking this new guess, we see that none of the terms in solve the complementary equation, so this is a valid guess (step 3 again). We now want to find values for and so we substitute into the differential equation. We have and so we want to find values of and such that

Therefore,

This gives and so (step 4). Putting everything together, we have the general solution

Find the general solution to the following differential equations.

Hint

Use the problem-solving strategy.

### Variation of Parameters

Sometimes, is not a combination of polynomials, exponentials, or sines and cosines. When this is the case, the method of undetermined coefficients does not work, and we have to use another approach to find a particular solution to the differential equation. We use an approach called the method of variation of parameters.

To simplify our calculations a little, we are going to divide the differential equation through by so we have a leading coefficient of 1. Then the differential equation has the form

where and are constants.

If the general solution to the complementary equation is given by we are going to look for a particular solution of the form In this case, we use the two linearly independent solutions to the complementary equation to form our particular solution. However, we are assuming the coefficients are functions of x, rather than constants. We want to find functions and such that satisfies the differential equation. We have

Substituting into the differential equation, we obtain

Note that and are solutions to the complementary equation, so the first two terms are zero. Thus, we have

If we simplify this equation by imposing the additional condition the first two terms are zero, and this reduces to So, with this additional condition, we have a system of two equations in two unknowns:

Solving this system gives us and which we can integrate to find u and v.

Then, is a particular solution to the differential equation. Solving this system of equations is sometimes challenging, so let’s take this opportunity to review Cramer’s rule, which allows us to solve the system of equations using determinants.

Rule: Cramer’s Rule

The system of equations

has a unique solution if and only if the determinant of the coefficients is not zero. In this case, the solution is given by

Using Cramer’s Rule

Use Cramer’s rule to solve the following system of equations.

We have

Then,

and

Thus,

Thus,

Use Cramer’s rule to solve the following system of equations.

Hint

Use the process from the previous example.

Problem-Solving Strategy: Method of Variation of Parameters
1. Solve the complementary equation and write down the general solution
2. Use Cramer’s rule or another suitable technique to find functions and satisfying
3. Integrate and to find and Then, is a particular solution to the equation.
4. Add the general solution to the complementary equation and the particular solution found in step 3 to obtain the general solution to the nonhomogeneous equation.
Using the Method of Variation of Parameters

Find the general solution to the following differential equations.

1. The complementary equation is with associated general solution Therefore, and Calculating the derivatives, we get and (step 1). Then, we want to find functions and so that

Applying Cramer’s rule, we have

and

Integrating, we get

Then we have

The term is a solution to the complementary equation, so we don’t need to carry that term into our general solution explicitly. The general solution is

2. The complementary equation is with associated general solution So, and (step 1). Then, we want to find functions and such that

Applying Cramer’s rule, we have

and

Integrating first to find u, we get

Now, we integrate to find v. Using substitution (with ), we get

Then,

The general solution is

Find the general solution to the following differential equations.

Hint

### Key Concepts

• To solve a nonhomogeneous linear second-order differential equation, first find the general solution to the complementary equation, then find a particular solution to the nonhomogeneous equation.
• Let be any particular solution to the nonhomogeneous linear differential equation

and let denote the general solution to the complementary equation. Then, the general solution to the nonhomogeneous equation is given by

• When is a combination of polynomials, exponential functions, sines, and cosines, use the method of undetermined coefficients to find the particular solution. To use this method, assume a solution in the same form as multiplying by x as necessary until the assumed solution is linearly independent of the general solution to the complementary equation. Then, substitute the assumed solution into the differential equation to find values for the coefficients.
• When is not a combination of polynomials, exponential functions, or sines and cosines, use the method of variation of parameters to find the particular solution. This method involves using Cramer’s rule or another suitable technique to find functions and satisfying

Then, is a particular solution to the differential equation.

### Key Equations

• Complementary equation
• General solution to a nonhomogeneous linear differential equation

Solve the following equations using the method of undetermined coefficients.

In each of the following problems,

1. Write the form for the particular solution for the method of undetermined coefficients.
2. [T] Use a computer algebra system to find a particular solution to the given equation.

a.
b.

a.
b.

a.
b.

Solve the differential equation using either the method of undetermined coefficients or the variation of parameters.

Solve the differential equation using the method of variation of parameters.

Find the unique solution satisfying the differential equation and the initial conditions given, where is the particular solution.

In each of the following problems, two linearly independent solutions— and —are given that satisfy the corresponding homogeneous equation. Use the method of variation of parameters to find a particular solution to the given nonhomogeneous equation. Assume x > 0 in each exercise.

### Glossary

complementary equation
for the nonhomogeneous linear differential equation

the associated homogeneous equation, called the complementary equation, is

method of undetermined coefficients
a method that involves making a guess about the form of the particular solution, then solving for the coefficients in the guess
method of variation of parameters
a method that involves looking for particular solutions in the form where and are linearly independent solutions to the complementary equations, and then solving a system of equations to find and
particular solution
a solution of a differential equation that contains no arbitrary constants