We learned in Section 5.3 how to solve homogeneous linear equations with constant coefficients, but we saw in Section 5.4 that an external force in a simple mechanical system contributes a nonhomogeneous term to its differential equation. The general nonhomogeneous nth-order linear equation with constant coefficients has the form
By Theorem 5 of Section 5.2, a general solution of Eq. (1) has the form
where the complementary function yc(x) is a general solution of the associated homogeneous equation
and yp(x) is a particular solution of Eq. (1). Thus our remaining task is to find yp.
The method of undetermined coefficients is a straightforward way of doing this when the given function f(x) in Eq. (1) is sufficiently simple that we can make an intelligent guess as to the general form of yp. For example, suppose that f(x) is a polynomial of degree m. Then, because the derivatives of a polynomial are themselves polynomials of lower degree, it is reasonable to suspect a particular solution
that is also a polynomial of degree m, but with as yet undetermined coefficients. We may, therefore, substitute this expression for yp into Eq. (1), and then—by equating coefficients of like powers of x on the two sides of the resulting equation—attempt to determine the coefficients A0, A1, …, Am so that yp will, indeed, be a particular solution of Eq. (1).
Similarly, suppose that
Then it is reasonable to expect a particular solution of the same form:
a linear combination with undetermined coefficients A and B. The reason is that any derivative of such a linear combination of cos kx and sin kx has the same form. We may therefore substitute this form of yp in Eq. (1), and then—by equating coefficients of cos kx and sin kx on both sides of the resulting equation—attempt to determine the coefficients A and B so that yp will, indeed, be a particular solution.
It turns out that this approach does succeed whenever all the derivatives of f(x) have the same form as f(x) itself. Before describing the method in full generality, we illustrate it with several preliminary examples.
Find a particular solution of y″+3y′+4y=3x+2.
Here f(x)=3x+2 is a polynomial of degree 1, so our guess is that
Then yp′=A and yp″=0, so yp will satisfy the differential equation provided that
that is,
for all x. This will be true if the x-terms and constant terms on the two sides of this equation agree. It therefore suffices for A and B to satisfy the two linear equations 4A=3 and 3A+4B=2 that we readily solve for A=34 and B=−116. Thus we have found the particular solution
Find a particular solution of y″−4y=2e3x.
Any derivative of e3x is a constant multiple of e3x, so it is reasonable to try
Then yp″=9Ae3x, so the given differential equation will be satisfied provided that
that is, 5A=2, so that A=25. Thus our particular solution is yp(x)=25e3x.
Find a particular solution of 3y″+y′−2y=2cos x.
A first guess might be yp(x)=Acos x, but the presence of y′ on the left-hand side signals that we probably need a term involving sin x as well. So we try
Then substitution of yp and its derivatives into the given differential equation yields
that is (collecting coefficients on the left),
This will be true for all x provided that the cosine and sine terms on the two sides of this equation agree. It therefore suffices for A and B to satisfy the two linear equations
with readily found solution A=−513, B=113. Hence a particular solution is
The following example, which superficially resembles Example 2, indicates that the method of undetermined coefficients is not always quite so simple as we have made it appear.
Find a particular solution of y″−4y=2e2x.
If we try yp(x)=Ae2x, we find that
Thus, no matter how A is chosen, Ae2x cannot satisfy the given nonhomogeneous equation. In fact, the preceding computation shows that Ae2x satisfies instead the associated homogeneous equation. Therefore, we should begin with a trial function yp(x) whose derivative involves both e2x and something else that can cancel upon substitution into the differential equation to leave the e2x term that we need. A reasonable guess is
for which
Substitution into the original differential equation yields
The terms involving xe2x obligingly cancel, leaving only 4Ae2x=2e2x, so that A=12. Consequently, a particular solution is
Our initial difficulty in Example 4 resulted from the fact that f(x)=2e2x satisfies the associated homogeneous equation. Rule 1, given shortly, tells what to do when we do not have this difficulty, and Rule 2 tells what to do when we do have it.
The method of undetermined coefficients applies whenever the function f(x) in Eq. (1) is a linear combination of (finite) products of functions of the following three types:
A polynomial in x;
An exponential function erx; (4)
cos kx or sin kx.
Any such function, for example,
has the crucial property that only finitely many linearly independent functions appear as terms (summands) in f(x) and its derivatives of all orders. In Rules 1 and 2 we assume that Ly=f(x) is a nonhomogeneous linear equation with constant coefficients and that f(x) is a function of this kind.
Note that this rule is not a theorem requiring proof; it is merely a procedure to be followed in searching for a particular solution yp. If we succeed in finding yp, then nothing more need be said. (It can be proved, however, that this procedure will always succeed under the conditions specified here.)
In practice we check the supposition made in Rule 1 by first using the characteristic equation to find the complementary function yc, and then write a list of all the terms appearing in f(x) and its successive derivatives. If none of the terms in this list duplicates a term in yc, then we proceed with Rule 1.
Find a particular solution of
The (familiar) complementary solution of Eq. (5) is
The function f(x)=3x3 and its derivatives are constant multiples of the linearly independent functions x3, x2, x, and 1. Because none of these appears in yc, we try
Substitution in Eq. (5) gives
We equate coefficients of like powers of x in the last equation to get
with solution A=34, B=0, C=−98, and D=0. Hence a particular solution of Eq. (5) is
Solve the initial value problem
The characteristic equation r2−3r+2=0 has roots r=1 and r=2, so the complementary function is
The terms involved in f(x)=3e−x−10 cos 3x and its derivatives are e−x, cos 3x, and sin 3x. Because none of these appears in yc, we try
After we substitute these expressions into the differential equation in (6) and collect coefficients, we get
We equate the coefficients of the terms involving e−x, those involving cos 3x, and those involving sin 3x. The result is the system
with solution A=12, B=713, and C=913. This gives the particular solution
which, however, does not have the required initial values in (6).
To satisfy those initial conditions, we begin with the general solution
with derivative
The initial conditions in (6) lead to the equations
with solution c1=−12, c2=613. The desired particular solution is therefore
Find the general form of a particular solution of
The characteristic equation r3+9r=0 has roots r=0, r=−3i, and r=3i. So the complementary function is
The derivatives of the right-hand side in Eq. (7) involve the terms
Because there is no duplication with the terms of the complementary function, the trial solution takes the form
Upon substituting yp in Eq. (7) and equating coefficients of like terms, we get seven equations determining the seven coefficients A, B, C, D, E, F, and G.
Now we turn our attention to the situation in which Rule 1 does not apply: Some of the terms involved in f(x) and its derivatives satisfy the associated homogeneous equation. For instance, suppose that we want to find a particular solution of the differential equation
Proceeding as in Rule 1, our first guess would be
This form of yp(x) will not be adequate because the complementary function of Eq. (8) is
so substitution of (9) in the left-hand side of (8) would yield zero rather than (2x−3)erx.
To see how to amend our first guess, we observe that
by Eq. (13) of Section 5.3. If y(x) is any solution of Eq. (8) and we apply the operator (D−r)2 to both sides, we see that y(x) is also a solution of the equation (D−r)5y=0. The general solution of this homogeneous equation can be written as
Thus every solution of our original equation in (8) is the sum of a complementary function and a particular solution of the form
Note that the right-hand side in Eq. (11) can be obtained by multiplying each term of our first guess in (9) by the least positive integral power of x (in this case, x3) that suffices to eliminate duplication between the terms of the resulting trial solution yp(x) and the complementary function yc(x) given in (10). This procedure succeeds in the general case.
To simplify the general statement of Rule 2, we observe that to find a particular solution of the nonhomogeneous linear differential equation
it suffices to find separately particular solutions Y1(x) and Y2(x) of the two equations
respectively. For linearity then gives
and therefore yp=Y1+Y2 is a particular solution of Eq. (12). (This is a type of “superposition principle” for nonhomogeneous linear equations.)
Now our problem is to find a particular solution of the equation Ly=f(x), where f(x) is a linear combination of products of the elementary functions listed in (4). Thus f(x) can be written as a sum of terms each of the form
where Pm(x) is a polynomial in x of degree m. Note that any derivative of such a term is of the same form but with both sines and cosines appearing. The procedure by which we arrived earlier at the particular solution in (11) of Eq. (8) can be generalized to show that the following procedure is always successful.
In practice we seldom need to deal with a function f(x) exhibiting the full generality in (14). The table in Fig. 5.5.1 lists the form of yp in various common cases, corresponding to the possibilities m=0, r=0, and k=0.
On the other hand, it is common to have
where f1(x) and f2(x) are different functions of the sort listed in the table in Fig. 5.5.1. In this event we take as yp the sum of the trial solutions for f1(x) and f2(x), choosing s separately for each part to eliminate duplication with the complementary function. This procedure is illustrated in Examples 8 through 10.
Find a particular solution of
f(x) | yp |
---|---|
Pm(x)=b0+b1x+b2x2+⋯+bmxma cos k x+b sin k xerx(a cos k x+b sin k x)Pm(x)erxPm(x)(a cos k x+b sin k x) | xs(A0+A1x+A2x2+⋯+Amxm)xs(A cos k x+B sin k x)xserx(A cos k x+B sin k x)xs(A0+A1x+A2x2+⋯+Amxm)erxxs[(A0+A1x+⋯+Amxm)coskx+(B0+B1x+⋯+Bmxm)sinkx] |
The characteristic equation r3+r2=0 has roots r1=r2=0 and r3=−1, so the complementary function is
As a first step toward our particular solution, we form the sum
The part Aex corresponding to 3ex does not duplicate any part of the complementary function, but the part B+Cx+Dx2 must be multiplied by x2 to eliminate duplication. Hence we take
Substitution of these derivatives in Eq. (16) yields
The system of equations
has the solution A=32, B=4, C=−43, and D=13. Hence the desired particular solution is
Determine the appropriate form for a particular solution of
The characteristic equation r2+6r+13=0 has roots −3±2i, so the complementary function is
This is the same form as a first attempt e−3x(Acos 2x+Bsin 2x) at a particular solution, so we must multiply by x to eliminate duplication. Hence we would take
Determine the appropriate form for a particular solution of the fifth-order equation
The characteristic equation (r−2)3(r2+9)=0 has roots r=2, 2, 2, 3i, and −3i, so the complementary function is
As a first step toward the form of a particular solution, we examine the sum
To eliminate duplication with terms of yc(x), the first part—corresponding to x2e2x—must be multiplied by x3, and the second part—corresponding to xsin 3x—must be multiplied by x. Hence we would take
Finally, let us point out the kind of situation in which the method of undetermined coefficients cannot be used. Consider, for example, the equation
which at first glance may appear similar to those considered in the preceding examples. Not so; the function f(x)=tanx has infinitely many linearly independent derivatives
Therefore, we do not have available a finite linear combination to use as a trial solution.
We discuss here the method of variation of parameters, which—in principle (that is, if the integrals that appear can be evaluated)—can always be used to find a particular solution of the nonhomogeneous linear differential equation
provided that we already know the general solution
of the associated homogeneous equation
Here, in brief, is the basic idea of the method of variation of parameters. Suppose that we replace the constants, or parameters, c1, c2, …, cn in the complementary function in Eq. (19) with variables: functions u1, u2, …, un of x. We ask whether it is possible to choose these functions in such a way that the combination
is a particular solution of the nonhomogeneous equation in (18). It turns out that this is always possible.
The method is essentially the same for all orders n≧2, but we will describe it in detail only for the case n=2. So we begin with the second-order nonhomogeneous equation
with complementary function
on some open interval I where the functions P and Q are continuous. We want to find functions u1 and u2 such that
is a particular solution of Eq. (22).
One condition on the two functions u1 and u2 is that L[yp]=f(x). Because two conditions are required to determine two functions, we are free to impose an additional condition of our choice. We will do so in a way that simplifies the computations as much as possible. But first, to impose the condition L[yp]=f(x), we must compute the derivatives yp′ and yp″. The product rule gives
To avoid the appearance of the second derivatives u1″ and u2″, the additional condition that we now impose is that the second sum here must vanish:
Then
and the product rule gives
But both y1 and y2 satisfy the homogeneous equation
associated with the nonhomogeneous equation in (22), so
for i=1, 2. It therefore follows from Eq. (27) that
In view of Eqs. (24) and (26), this means that
hence
The requirement that yp satisfy the nonhomogeneous equation in (22)—that is, that L[yp]=f(x)—therefore implies that
Finally, Eqs. (25) and (30) determine the functions u1 and u2 that we need. Collecting these equations, we obtain a system
of two linear equations in the two derivatives u1′ and u2′. Note that the determinant of coefficients in (31) is simply the Wronskian W(y1,y2). Once we have solved the equations in (31) for the derivatives u1′ and u2′, we integrate each to obtain the functions u1 and u2 such that
is the desired particular solution of Eq. (22). In Problem 63 we ask you to carry out this process explicitly and thereby verify the formula for yp(x) in the following theorem.
Find a particular solution of the equation y″+y=tanx.
The complementary function is yc(x)=c1cos x+c2sin x, and we could simply substitute directly in Eq. (33). But it is more instructive to set up the equations in (31) and solve for u1′ and u2′, so we begin with
Hence the equations in (31) are
We easily solve these equations for
Hence we take
and
(Do you see why we choose the constants of integration to be zero?) Thus our particular solution is
that is,
In Problems 1 through 20, find a particular solution yp of the given equation. In all these problems, primes denote derivatives with respect to x.
y″+16y=e3x
y″−y′−2y=3x+4
y″−y′−6y=2 sin 3x
4y″+4y′+y=3xex
y″+y′+y=sin2 x
2y″+4y′+7y=x2
y″−4y=sinh x
y″−4y=cosh 2x
y″+2y′−3y=1+xex
y″+9y=2 cos 3x+3 sin 3x
y(3)+4y′=3x−1
y(3)+y′=2−sin x
y″+2y′+5y=ex sin x
y(4)−2y″+y=xex
y(5)+5y(4)−y=17
y″+9y=2x2e3x+5
y″+y=sin x+xcos x
y(4)−5y″+4y=ex−xe2x
y(5)+2y(3)+2y″=3x2−1
y(3)−y=ex+7
In Problems 21 through 30, set up the appropriate form of a particular solution yp, but do not determine the values of the coefficients.
y″−2y′+2y=ex sin x
y(5)−y(3)=ex+2x2−5
y″+4y=3xcos 2x
y(3)−y″−12y′=x−2xe−3x
y″+3y′+2y=x(e−x−e−2x)
y″−6y′+13y=xe3x sin 2x
y(4)+5y″+4y=sin x+cos 2x
y(4)+9y″=(x2+1)sin 3x
(D−1)3(D2−4)y=xex+e2x+e−2x
y(4)−2y″+y=x2 cos x
Solve the initial value problems in Problems 31 through 40.
y″+4y=2x; y(0)=1, y′(0)=2
y″+3y′+2y=ex; y(0)=0, y′(0)=3
y″+9y=sin 2x; y(0)=1, y′(0)=0
y″+y=cos x; y(0)=1, y′(0)=−1
y″−2y′+2y=x+1; y(0)=3, y′(0)=0
y(4)−4y″=x2; y(0)=y′(0)=1, y″(0)=y(3)(0)=−1
y(3)−2y″+y′=1+xex; y(0)=y′(0)=0, y″(0)=1
y″+2y′+2y=sin 3x; y(0)=2, y′(0)=0
y(3)+y″=x+e−x; y(0)=1, y′(0)=0, y″(0)=1
y(4)−y=5; y(0)=y′(0)=y″(0)=y(3)(0)=0
Find a particular solution of the equation
Find the solution of the initial value problem consisting of the differential equation of Problem 41 and the initial conditions
Write
by Euler’s formula, expand, and equate real and imaginary parts to derive the identities
Use the result of part (a) to find a general solution of
Use trigonometric identities to find general solutions of the equations in Problems 44 through 46.
y″+y′+y=sin xsin 3x
y″+9y=sin4 x
y″+y=xcos3 x
In Problems 47 through 56, use the method of variation of parameters to find a particular solution of the given differential equation.
y″+3y′+2y=4ex
y″−2y′−8y=3e−2x
y″−4y′+4y=2e2x
y″−4y=sinh2x
y″+4y=cos 3x
y″+9y=sin 3x
y″+9y=2sec3x
y″+y=csc2 x
y″+4y=sin2 x
y″−4y=xex
You can verify by substitution that yc=c1x+c2x−1 is a complementary function for the nonhomogeneous second-order equation
But before applying the method of variation of parameters, you must first divide this equation by its leading coefficient x2 to rewrite it in the standard form
Thus f(x)=72x3 in Eq. (22). Now proceed to solve the equations in (31) and thereby derive the particular solution yp=3x5.
In Problems 58 through 62, a nonhomogeneous second-order linear equation and a complementary function yc are given. Apply the method of Problem 57 to find a particular solution of the equation.
x2y″−4xy′+6y=x3; yc=c1x2+c2x3
x2y″−3xy′+4y=x4; yc=x2(c1+c2ln x)
4x2y″−4xy′+3y=8x4/3; yc=c1x+c2x3/4
x2y″+xy′+y=ln x; yc=c1cos(ln x)+c2sin(ln x)
(x2−1)y″−2xy′+2y=x2−1; yc=c1x+c2(1+x2)
Apply the variation of parameters formula in (33) to find the particular solution yp(x)=−xcos x of the nonhomogeneous equation y″+y=2sin x.
The variation of parameters formula in (33) is especially amenable to implementation in a computer algebra system when the indicated integrals would be too tedious or inconvenient for manual evaluation. For example, suppose that we want to find a particular solution of the nonhomogeneous equation
of Example 11, with complementary function yc(x)=c1cos x+c2sin x. Then the Maple commands
y1 := cos(x):
y2 := sin(x):
f := tan(x):
W := y1*diff(y2,x) - y2*diff(y1,x):
W := simplify(W):
yp := -y1*int(y2*f/W,x) + y2*int(y1*f/W,x):
simplify(yp);
implement (33) and produce the result
equivalent to the result yp(x)=−(cos x)ln (secx+tanx) found in Example 11. The analogous Mathematica commands
y1 = Cos[x];
y2 = Sin[x];
f = Tan[x];
W = y1*D[y2,x] - y2*D[y1,x] // Simplify
yp = -y1*Integrate[y2*f/W,x] + y2*Integrate[y1*f/W,x];
Simplify[yp]
produce the result
which (by the usual difference-of-squares technique) also is equivalent to the result found in Example 11.
To solve similarly a second-order linear equation y″+P(x)y′+Q(x)y=f(x) whose complementary function yc(x)=c1y1(x)+c2y2(x) is known, we need only insert the corresponding definitions of y1(x), y2(x), and f(x) in the initial lines shown here. Find in this way the indicated particular solution yp(x) of the nonhomogeneous equations in Problems 1 through 6.
1. y″+y=2 sin x | yp(x)=−xcos x |
2. y″+y=4x sin x | yp(x)=xsin x−x2 cos x |
3. y″+y=12x2 sin x | yp(x)=3x2 sin x+(3x−2x3) cos x |
4. y″−2y′+2y=2ex sin x | yp(x)=−xex cos x |
5. y″−2y′+2y=4xex sin x | yp(x)=ex(xsin x−x2 cos x) |
6. y″−2y′+2y=12x2ex sin x | yp(x)=ex[3x2 sin x+(3x−2x3) cos x] |
3.141.37.10