5.5 Nonhomogeneous Equations and Undetermined Coefficients

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

any(n)+an1y(n1)++a1y+a0y=f(x). (1)

By Theorem 5 of Section 5.2, a general solution of Eq. (1) has the form

y=yc+yp (2)

where the complementary function yc(x) is a general solution of the associated homogeneous equation

any(n)+an1y(n1)++a1y+a0y=0, (3)

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

yp(x)=Amxm+Am1xm1++A1x+A0

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

f(x)=a cos kx+b sin kx.

Then it is reasonable to expect a particular solution of the same form:

yp(x)=A cos kx+B sin kx,

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.

Example 1

Find a particular solution of y+3y+4y=3x+2.

Solution

Here f(x)=3x+2 is a polynomial of degree 1, so our guess is that

yp(x)=Ax+B.

Then yp=A and yp=0, so yp will satisfy the differential equation provided that

(0)+3(A)+4(Ax+B)=3x+2,

that is,

(4Ax)+(3A+4B)=3x+2

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

yp(x)=34x116.

Example 2

Find a particular solution of y4y=2e3x.

Solution

Any derivative of e3x is a constant multiple of e3x, so it is reasonable to try

yp(x)=Ae3x.

Then yp=9Ae3x, so the given differential equation will be satisfied provided that

9Ae3x4(Ae3x)=2e3x;

that is, 5A=2, so that A=25. Thus our particular solution is yp(x)=25e3x.

Example 3

Find a particular solution of 3y+y2y=2cos x.

Solution

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

yp(x)=A cos x+B sin x,yp(x)=A sin x+B cos x,yp(x)=A cos xB sin x.

Then substitution of yp and its derivatives into the given differential equation yields

3(A cos xB sin x)+(A sin x+B cos x)2(A cos x+B sin x)=2 cos x,

that is (collecting coefficients on the left),

(5A+B)cos x+(A5B)sin x=2 cos x.

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

5A+B=2,A5B=0

with readily found solution A=513, B=113. Hence a particular solution is

yp(x)=513cos x+113sin x.

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.

Example 4

Find a particular solution of y4y=2e2x.

Solution

If we try yp(x)=Ae2x, we find that

yp4yp=4Ae2x4Ae2x=02e2x.

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

yp(x)=Axe2x,

for which

yp(x)=Ae2x+2Axe2xandyp(x)=4Ae2x+4Axe2x.

Substitution into the original differential equation yields

(4Ae2x+4Axe2x)4(Axe2x)=2e2x.

The terms involving xe2x obligingly cancel, leaving only 4Ae2x=2e2x, so that A=12. Consequently, a particular solution is

yp(x)=12xe2x.

The General Approach

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:

  1. A polynomial in x;

  2. An exponential function erx; (4)

  3. cos kx or sin kx.

Any such function, for example,

f(x)=(34x2)e5x4x3cos 10x,

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.

Example 5

Find a particular solution of

y+4y=3x3. (5)

Solution

The (familiar) complementary solution of Eq. (5) is

yc(x)=c1 cos 2x+c2 sin 2x.

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

yp=Ax3+Bx2+Cx+D,yp=3Ax2+2Bx+C,yp=6Ax+2B.

Substitution in Eq. (5) gives

yp+4yp=(6Ac+2B)+4(Ax3+Bx2+Cx+D)=4Ax3+4Bx2+(6A+4C)x+(2B+4D)=3x3.

We equate coefficients of like powers of x in the last equation to get

4A=3,4B=0,6A+4C=0,2B+4D=0

with solution A=34, B=0, C=98, and D=0. Hence a particular solution of Eq. (5) is

yp(x)=34x398x.

Example 6

Solve the initial value problem

y3y+2y=3ex10 cos 3x;y(0)=1,y(0)=2. (6)

Solution

The characteristic equation r23r+2=0 has roots r=1 and r=2, so the complementary function is

yc(x)=c1ex+c2e2x.

The terms involved in f(x)=3ex10 cos 3x and its derivatives are ex, cos 3x, and sin 3x. Because none of these appears in yc, we try

yp=Aex+B cos 3x+C sin 3x,yp=Aex3B sin 3x+3C cos 3x,yp=Aex9B cos 3x9C sin 3x.

After we substitute these expressions into the differential equation in (6) and collect coefficients, we get

yp3yp+2yp=6Aex+(7B9C)cos 3x+(9B7C) sin 3x=3ex10 cos 3x.

We equate the coefficients of the terms involving ex, those involving cos 3x, and those involving sin 3x. The result is the system

6A=3,7B9C=10,9B7C=0

with solution A=12, B=713, and C=913. This gives the particular solution

yp(x)=12ex+713cos 3x+913sin 3x,

which, however, does not have the required initial values in (6).

To satisfy those initial conditions, we begin with the general solution

y(x)=yc(x)+yp(x)=c1ex+c2e2x+12ex+713cos 3x+913sin 3x,

with derivative

y(x)=c1ex+2c2e2x12ex2113sin 3x+2713cos 3x.

The initial conditions in (6) lead to the equations

y(0)=c1+c2+12+713=1,y(0)=c1+2c212+2713=2

with solution c1=12, c2=613. The desired particular solution is therefore

y(x)=12ex+613e2x+12ex+713cos 3x+913sin 3x.

Example 7

Find the general form of a particular solution of

y(3)+9y=xsinx+x2e2x. (7)

Solution

The characteristic equation r3+9r=0 has roots r=0, r=3i, and r=3i. So the complementary function is

yc(x)=c1+c2cos 3x+c3sin 3x.

The derivatives of the right-hand side in Eq. (7) involve the terms

cos x,sin x,x cos x,x sin x,e2x,xe2x,andx2e2x.

Because there is no duplication with the terms of the complementary function, the trial solution takes the form

yp(x)=A cos x+B sin x+Cx cos x+Dx sin x+Ee2x+Fxe2x+Gx2e2x.

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.

The Case of Duplication

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

(Dr)3y=(2x3)erx. (8)

Proceeding as in Rule 1, our first guess would be

yp(x)=Aerx+Bxerx. (9)

This form of yp(x) will not be adequate because the complementary function of Eq. (8) is

yc(x)=c1erx+c2xerx+c3x2erx, (10)

so substitution of (9) in the left-hand side of (8) would yield zero rather than (2x3)erx.

To see how to amend our first guess, we observe that

(Dr)2[(2x3)erx]=[D2(2x3)]erx=0

by Eq. (13) of Section 5.3. If y(x) is any solution of Eq. (8) and we apply the operator (Dr)2 to both sides, we see that y(x) is also a solution of the equation (Dr)5y=0. The general solution of this homogeneous equation can be written as

y(x)=c1erx+c2xerx+c3x2erxyc+Ax3erx+Bx4erxyp.

Thus every solution of our original equation in (8) is the sum of a complementary function and a particular solution of the form

yp(x)=Ax3erx+Bx4erx. (11)

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

Ly=f1(x)+f2(x), (12)

it suffices to find separately particular solutions Y1(x) and Y2(x) of the two equations

Ly=f1(x)andLy=f2(x), (13)

respectively. For linearity then gives

L[Y1+Y2]=LY1+LY2=f1(x)+f2(x),

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

Pm(x)erx cos kxorPm(x)erx sin kx, (14)

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

f(x)=f1(x)+f2(x),

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.

Example 8

Find a particular solution of

y(3)+y=3ex+4x2. (16)

FIGURE 5.5.1.

Substitutions in the method of undetermined coefficients.

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]

Solution

The characteristic equation r3+r2=0 has roots r1=r2=0 and r3=1, so the complementary function is

yc(x)=c1+c2x+c3ex.

As a first step toward our particular solution, we form the sum

(Aex)+(B+Cx+Dx2).

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

yp=Aex+Bx2+Cx3+Dx4,yp=Aex+2Bx+3Cx2+4Dx3,yp=Aex+2B+6Cx+12Dx2,andy(3)p=Aex+6C+24Dx.

Substitution of these derivatives in Eq. (16) yields

2Aex+(2B+6C)+(6C+24D)x+12Dx2=3ex+4x2.

The system of equations

2A=3,2B+6C=0,6C+24D=0,12D=4

has the solution A=32, B=4, C=43, and D=13. Hence the desired particular solution is

yp(x)=32ex+4x243x3+13x4.

Example 9

Determine the appropriate form for a particular solution of

y+6y+13y=e3x cos 2x.

Solution

The characteristic equation r2+6r+13=0 has roots 3±2i, so the complementary function is

yc(x)=e3x(c1 cos 2x+c2 sin 2x).

This is the same form as a first attempt e3x(Acos 2x+Bsin 2x) at a particular solution, so we must multiply by x to eliminate duplication. Hence we would take

yp(x)=e3x(Ax cos 2x+Bx sin 2x).

Example 10

Determine the appropriate form for a particular solution of the fifth-order equation

(D2)3(D2+9)y=x2e2x+x sin 3x.

Solution

The characteristic equation (r2)3(r2+9)=0 has roots r=2, 2, 2, 3i, and 3i, so the complementary function is

yc(x)=c1e2x+c2xe2x+c3x2e2x+c4 cos 3x+c5 sin 3x.

As a first step toward the form of a particular solution, we examine the sum

[(A+Bx+Cx2)e2x]+[(D+Ex)cos 3x+(F+Gx) sin 3x].

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

yp(x)=(Ax3+Bx4+Cx5)e2x+(Dx+Ex2)cos 3x+(Fx+Gx2)sin 3x.

Variation of Parameters

Finally, let us point out the kind of situation in which the method of undetermined coefficients cannot be used. Consider, for example, the equation

y+y=tan x, (17)

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

sec2 x,2 sec2 x tan x,4 sec2 x tan2 x+2 sec4 x,.

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

y(n)+pn1(x)y(n1)++p1(x)y+p0(x)y=f(x), (18)

provided that we already know the general solution

yc=c1y1+c2y2++cnyn (19)

of the associated homogeneous equation

y(n)+pn1(x)y(n1)++p1(x)y+p0(x)y=0. (20)

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

yp(x)=u1(x)y1(x)+u2(x)y2(x)++un(x)yn(x) (21)

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 n2, but we will describe it in detail only for the case n=2. So we begin with the second-order nonhomogeneous equation

L[y]=y+P(x)y+Q(x)y=f(x) (22)

with complementary function

yc(x)=c1y1(x)+c2y2(x) (23)

on some open interval I where the functions P and Q are continuous. We want to find functions u1 and u2 such that

yp(x)=u1(x)y1(x)+u2(x)y2(x) (24)

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

yp=(u1y1+u2y2)+(u1y1+u2y2).

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:

u1y1+u2y2=0. (25)

Then

yp=u1y1+u2y2, (26)

and the product rule gives

yp=(u1y1+u2y2)+(u1y1+u2y2). (27)

But both y1 and y2 satisfy the homogeneous equation

y+Py+Qy=0

associated with the nonhomogeneous equation in (22), so

yi=PyiQyi (28)

for i=1, 2. It therefore follows from Eq. (27) that

yp=(u1y1+u2y2)P(u1y1+u2y2)Q(u1y1+u2y2).

In view of Eqs. (24) and (26), this means that

yp=(u1y1+u2y2)PypQyp;

hence

L[yp]=u1y1+u2y2. (29)

The requirement that yp satisfy the nonhomogeneous equation in (22)—that is, that L[yp]=f(x)—therefore implies that

u1y1+u2y2=f(x). (30)

Finally, Eqs. (25) and (30) determine the functions u1 and u2 that we need. Collecting these equations, we obtain a system

u1y1+u2y2=0,u1y1+u2y2=f(x) (31)

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

yp=u1y1+u2y2 (32)

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.

Example 11

Find a particular solution of the equation y+y=tanx.

Solution

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

y1=cos x,y2=sin x,y1=sin x,y2=cos x.

Hence the equations in (31) are

(u1)(cos x)+(u2)(sin x)=0,(u1)(sin x)+(u2)(cos x)=tan x.

We easily solve these equations for

u1=sin x tan x=sin2 xcos x=cos xsecx,u2=cos x tan x=sin x.

Hence we take

u1=(cosxsecx)dx=sinxln|sec x+tan x|

and

u2=sin x dx=cos x.

(Do you see why we choose the constants of integration to be zero?) Thus our particular solution is

yp(x)=u1(x)y1(x)+u2(x)y2(x)=(sin xln|sec x+tanx|)cos x+(cos x)(sin x);

that is,

yp(x)=(cos x)ln|sec x+tan x|.

5.5 Problems

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.

  1. y+16y=e3x

     

  2. yy2y=3x+4

     

  3. yy6y=2 sin 3x

     

  4. 4y+4y+y=3xex

     

  5. y+y+y=sin2 x

     

  6. 2y+4y+7y=x2

     

  7. y4y=sinh x

     

  8. y4y=cosh 2x

     

  9. y+2y3y=1+xex

     

  10. y+9y=2 cos 3x+3 sin 3x

     

  11. y(3)+4y=3x1

     

  12. y(3)+y=2sin x

     

  13. y+2y+5y=ex sin x

     

  14. y(4)2y+y=xex

     

  15. y(5)+5y(4)y=17

     

  16. y+9y=2x2e3x+5

     

  17. y+y=sin x+xcos x

     

  18. y(4)5y+4y=exxe2x

     

  19. y(5)+2y(3)+2y=3x21

     

  20. 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.

  1. y2y+2y=ex sin x

     

  2. y(5)y(3)=ex+2x25

     

  3. y+4y=3xcos 2x

     

  4. y(3)y12y=x2xe3x

     

  5. y+3y+2y=x(exe2x)

     

  6. y6y+13y=xe3x sin 2x

     

  7. y(4)+5y+4y=sin x+cos 2x

     

  8. y(4)+9y=(x2+1)sin 3x

     

  9. (D1)3(D24)y=xex+e2x+e2x

     

  10. y(4)2y+y=x2 cos x

Solve the initial value problems in Problems 31 through 40.

  1. y+4y=2x; y(0)=1, y(0)=2

     

  2. y+3y+2y=ex; y(0)=0, y(0)=3

     

  3. y+9y=sin 2x; y(0)=1, y(0)=0

     

  4. y+y=cos x; y(0)=1, y(0)=1

     

  5. y2y+2y=x+1; y(0)=3, y(0)=0

     

  6. y(4)4y=x2; y(0)=y(0)=1, y(0)=y(3)(0)=1

     

  7. y(3)2y+y=1+xex; y(0)=y(0)=0, y(0)=1

     

  8. y+2y+2y=sin 3x; y(0)=2, y(0)=0

     

  9. y(3)+y=x+ex; y(0)=1, y(0)=0, y(0)=1

     

  10. y(4)y=5; y(0)=y(0)=y(0)=y(3)(0)=0

     

  11. Find a particular solution of the equation

    y(4)y(3)yy2y=8x5.
  12. Find the solution of the initial value problem consisting of the differential equation of Problem 41 and the initial conditions

    y(0)=y(0)=y(0)=y(3)(0)=0.
    1. Write

      cos 3x+i sin 3x=e3ix=(cos x+i sin x)3

      by Euler’s formula, expand, and equate real and imaginary parts to derive the identities

      cos3 x=34cos x+14cos 3x,sin3 x=34sin x14sin 3x.
    2. Use the result of part (a) to find a general solution of

      y+4y=cos3 x.

Use trigonometric identities to find general solutions of the equations in Problems 44 through 46.

  1. y+y+y=sin xsin 3x

     

  2. y+9y=sin4 x

     

  3. 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.

  1. y+3y+2y=4ex

     

  2. y2y8y=3e2x

     

  3. y4y+4y=2e2x

     

  4. y4y=sinh2x

     

  5. y+4y=cos 3x

     

  6. y+9y=sin 3x

     

  7. y+9y=2sec3x

     

  8. y+y=csc2 x

     

  9. y+4y=sin2 x

     

  10. y4y=xex

     

  11. You can verify by substitution that yc=c1x+c2x1 is a complementary function for the nonhomogeneous second-order equation

    x2y+xyy=72x5.

    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

    y+1xy1x2y=72x3.

    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.

  1. x2y4xy+6y=x3; yc=c1x2+c2x3

     

  2. x2y3xy+4y=x4; yc=x2(c1+c2ln x)

     

  3. 4x2y4xy+3y=8x4/3; yc=c1x+c2x3/4

     

  4. x2y+xy+y=ln x; yc=c1cos(ln x)+c2sin(ln x)

     

  5. (x21)y2xy+2y=x21; yc=c1x+c2(1+x2)

     

  6. Carry out the solution process indicated in the text to derive the variation of parameters formula in (33) from Eqs. (31) and (32).

  7. 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.

5.5 Application Automated Variation of Parameters

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

y+y=tan x

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

yp(x)=(cos x)ln(1+sin xcos x)

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

yp(x)=(cos x)ln(cos(x/2)+sin(x/2)cos(x/2)sin(x/2)),

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 xx2 cos x
3. y+y=12x2 sin x yp(x)=3x2 sin x+(3x2x3) cos x
4. y2y+2y=2ex sin x yp(x)=xex cos x
5. y2y+2y=4xex sin x yp(x)=ex(xsin xx2 cos x)
6. y2y+2y=12x2ex sin x yp(x)=ex[3x2 sin x+(3x2x3) cos x]
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.136.235