Learning Objectives
- 7.2.1 Write the general solution to a nonhomogeneous differential equation.
- 7.2.2 Solve a nonhomogeneous differential equation by the method of undetermined coefficients.
- 7.2.3 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.
Theorem 7.4
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
□
Example 7.11
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.
Solution
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
Checkpoint 7.10
Given that is a particular solution to write the general solution and verify that the general solution satisfies the 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.
Example 7.12
Undetermined Coefficients When Is a Polynomial
Find the general solution to
Solution
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 Example 7.12, 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
Example 7.13
Undetermined Coefficients When Is an Exponential
Find the general solution to
Solution
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
Checkpoint 7.11
Find the general solution to
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 Table 7.2.
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
- Solve the complementary equation and write down the general solution.
- Based on the form of make an initial guess for
- 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.
- Substitute into the differential equation and equate like terms to find values for the unknown coefficients in
- Add the general solution to the complementary equation and the particular solution you just found to obtain the general solution to the nonhomogeneous equation.
Example 7.14
Solving Nonhomogeneous Equations
Find the general solutions to the following differential equations.
Solution
- 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
- 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
- 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
- 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
Checkpoint 7.12
Find the general solution to the following differential equations.
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
Example 7.15
Using Cramer’s Rule
Use Cramer’s rule to solve the following system of equations.
Solution
We have
Then,
and
Thus,
In addition,
Thus,
Checkpoint 7.13
Use Cramer’s rule to solve the following system of equations.
Problem-Solving Strategy
Method of Variation of Parameters
- Solve the complementary equation and write down the general solution
- Use Cramer’s rule or another suitable technique to find functions and satisfying
- Integrate and to find and Then, is a particular solution to the equation.
- 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.
Example 7.16
Using the Method of Variation of Parameters
Find the general solution to the following differential equations.
Solution
- 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
- 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
Checkpoint 7.14
Find the general solution to the following differential equations.
Section 7.2 Exercises
Solve the following equations using the method of undetermined coefficients.
In each of the following problems,
- Write the form for the particular solution for the method of undetermined coefficients.
- [T] Use a computer algebra system to find a particular solution to the given equation.
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.