Tải bản đầy đủ - 0 (trang)
4 Nonhomogeneous Equations with Constant Coefficients: The Method of Undetermined Coefficients

4 Nonhomogeneous Equations with Constant Coefficients: The Method of Undetermined Coefficients

Tải bản đầy đủ - 0trang

4.4 Nonhomogeneous Equations with Constant Coefficients



3. If fi x



xm eΑx cos Βx or fi x

S



223



xm eΑx sin Βx, the associated set of functions is



eΑx cos Βx, xeΑx cos Βx, x2 eΑx cos Βx, . . . , xm eΑx cos Βx,

eΑx sin Βx, xeΑx sin Βx, x2 eΑx sin Βx, . . . , xm eΑx sin Βx .



For each function fi x in f x , determine the associated set of functions S. If any

of the functions in S appears in the general solution to the corresponding homogeneous equation, yh x , multiply each function in S by xr to obtain a new set xr S,

where r is the smallest positive integer so that each function in xr S is not a solution

of the corresponding homogeneous equation. A particular solution is obtained by

taking the linear combination of all functions in the associated sets where repeated

functions should appear only once in the particular solution.



4.4.1 Second-Order Equations

EXAMPLE 4.4.1: Solve the nonhomogeneous equations (a) y

+ 6y 2ex and (b) y

5y 6y 3e 2x .



SOLUTION: (a) The corresponding homogeneous equation y

6y 0 has general solution yh c1 e 2x c2 e 3x .

In[566]:= homsol

Out[566]=



DSolve y x

5y x

0, y x , x

3x

2x

C 1

C 2



y x



5y



5y



6y x



Next, we determine the form of y p x . We choose S

ex because f x

x

x

2e . Notice that e is not a solution to the homogeneous equation, so we

take y p x to be the linear combination of the functions in S. Therefore,

Aex .



yp x

In[567]:= yp x

Out[567]= a



a Exp x



x



Substituting this solution into y

Aex



5Aex



In[568]:= eqn



yp



Out[568]= 12 a



x



6Aex



x

2



5y



2ex , we have



6y

12Aex



5yp x



2ex .



6yp x



x



Equating the coefficients of ex then gives us A



1/ 6.



2 Exp x



224



Chapter 4 Higher-Order Differential Equations



In[569]:= aval

Out[569]=



SolveAlways eqn, x

1

, x

6



a



1 x

6e ,



Hence, a particular solution is y p x

In[570]:= yp x



1

6



a Exp x /. a



x



Out[570]=



6



and a general solution of the nonhomogeneous equation is

y



yp



yh



In[571]:= gensol



e



c1 e

3x



2x



C 1



c2 e

e



2x



1 x

e.

6



3x



C 2



yp x



x



Out[571]=



3x



6



C 1



2x



C 2



In this case, we find the same general solution with DSolve.

In[572]:= gensol

5y x

6y x

2 Exp x ,

DSolve y x

y x , x, GeneratedParameters c

x



Out[572]=



y x



3x



6



c 1



2x



c 2



We then graph the general solution for various values of the arbitrary

constants in the same way as in other examples. See Figure 4-19.

In[573]:= toplot



grays



Table gensol 1, 1, 2 ,

c 1 , 1, 1 , c 2 , 1, 1

Table GrayLevel i ,

i, 0, 0.7, 0.7/ 8



Plot Evaluate toplot , x, 3, 5 ,

PlotStyle grays, PlotRange > 3, 5 ,

AspectRatio > 1



(b) In this case, we see that f x

3e 2x so the associated set is S

e 2x .

2x

However, because y e is a solution to the corresponding homogeneous equation, we must multiply each element of this set by xr so that

no element is a solution of the corresponding homogeneous equation.

We multiply the element of S by x to obtain xS

xe 2x because xe 2x is

5y 6y 0. Hence, y p x

Axe 2x . Differentiating

not a solution of y

y p x twice



4.4 Nonhomogeneous Equations with Constant Coefficients



225



5

4

3

2

1

-2



4



2

-1

-2

-3



Figure 4-19



Various solutions of y



In[574]:= yp x



ax Exp



5y



2ex



6y



2x



yp x

x



yp



2x



Out[574]= a

Out[574]=



2x



2a

2x



4a



4a



x

2x



x



and substituting into the nonhomogeneous equation yields

y



5y



6y



Ae



2x



In[575]:= eqn

Out[575]=



so A



3 and y p x



4a

3



3xe



In[576]:= aval

Out[576]=



2x



4Ae



a



4Axe

3e



yp



5 Ae



2x



10 a



5yp x

2x



x



6yp x

5 a



2x



2x



.



SolveAlways eqn, x

3



2Axe



2x



6Axe



2x



x



2x



2x



2x



3 Exp

2a



2x



2x

x



2x



226



Chapter 4 Higher-Order Differential Equations



In[577]:= yp x

Out[577]= 3



2x



A general solution of y

y



yh



yp x /.aval 1

x



5y



6y



yp



c1 e



2x



3e

2x



is



c2 e



3x



3xe



2x



.



As in (a), we can use DSolve to obtain equivalent results. For example,

entering

In[578]:= gensol

5y x

6y x

3 Exp

DSolve y x

y 0

a, y 0

b ,y x ,x

Out[578]=



2x ,



y x

3x



3



2a



b



3



x



3a



x



b



x



3



x



x



solves the equation subject to the initial conditions y 0

a and y 0

and names the resulting output gensol. Thus entering



3



2



1



-2



-1



1



2



3



-1



-2

Figure 4-20 Various solutions of y



5y



6y



3e



2x



b



4.4 Nonhomogeneous Equations with Constant Coefficients



In[579]:= toplot



grays



227



Table gensol 1, 1, 2 , a, 1, 1 ,

b, 1, 1

Table GrayLevel i ,

i , 0 , 0. 7 , 0 . 7 / 8



Plot Evaluate toplot , x, 2, 3 ,

PlotStyle grays, PlotRange > 2, 3 ,

AspectRatio > 1



defines toplot to be the set consisting of nine functions correspond5y 6y 3e 2x that satisfy the initial coning to the solutions of y

b for a

1, 0, and 1 and b

1, 0, and 1;

ditions y 0

a and y 0

and then graphs the set of functions toplot on the interval 2, 3 in

Figure 4-20.



EXAMPLE 4.4.2: Solve

4



d2y

dt 2



y



t



2



5 cos t



e



t/ 2



.



SOLUTION: The corresponding homogeneous equation is 4y

with general solution yh c1 e t/ 2 c2 et/ 2 .

In[580]:= DSolve 4y

Out[580]=



y t



e



t

t/ 2



0



0, y t , t



y t

C 1



y



e



t/ 2



C 2



A fundamental set of solutions for the corresponding homogeneous

equation is S

e t/ 2 , et/ 2 . The associated set of functions for t 2 is

1, t , the associated set of functions for 5 cos t is F2

cos t, sin t ,

F1

t/ 2

t/ 2

is F3

e

. Note that

and the associated set of functions for e

e t/ 2 is an element of S so we multiply F3 by t resulting in tF3

te t/ 2 .

Then, we search for a particular solution of the form

yp



A



Bt



C cos t



D sin t



Ete



t/ 2



,



where A, B, C, D, and E are constants to be determined.

In[581]:= yp t

Out[581]= a



b t



a b t c Cos t

d Sin t

e t Exp t/2

e e t/2 t c Cos t

d Sin t



No element of F1 is

contained in S and no

element of F2 is contained

in S.



228



Chapter 4 Higher-Order Differential Equations



Computing y p and y p

In[582]:= dyp



yp t



d2yp



Out[582]= b

Out[582]=



yp



e e



1

e e

4



t/ 2



e e



t

1

e e

2



t/ 2



t/ 2



t/ 2



t



t



d Cos t

c Cos t



c Sin t

d Sin t



and substituting into the nonhomogeneous equation results in

A



Bt



5C cos t



5D sin t



4Ee



t/ 2



t



2



5 cos t



e



t/ 2



.



In[583]:= eqn

Out[583]=



4 yp t

yp t

t 2 5 Cos t

Exp t/2

a b t e e t/2 t c Cos t

d Sin t

1

e e t/2 t c Cos t

4

e e t/ 2

4

d Sin t

2 e t/2 t 5 Cos t



Equating coefficients results in

A

so A



2

2, B



B

1, C



1



5C



1, D



0, and E



In[584]:= cvals

Solve

4e

Out[584]=



a



y p is then given by y p



5D



4E



1



1/ 4.



2, b



a



0



1, 5c



5, 5d



0,



1



2, b



2



5



t



1, c



cos t



1, d



0, e



1

4



1

t/ 2

4 te



In[585]:= yp t /.cvals 1

1

e t/2 t Cos t

Out[585]= 2 t

4



and a general solution is given by

y



yh



yp



c1 e



t/ 2



c2 et/ 2



2



t



cos t



1

te

4



t/ 2



.



Note that A Bt 5C cos t 5D sin t 4Ee t/ 2 t 2 5 cos t e t/ 2 is

true for all values of t. Evaluating for five different values of t gives us

five equations that we then solve for A, B, C, D, and E, resulting in the

same solutions as already obtained.



4.4 Nonhomogeneous Equations with Constant Coefficients



In[586]:= e1



eqn/.t > 0



Out[586]=



c



a



In[587]:= e2



Out[587]=



Out[587]=



Out[587]=



4



c



e



eqn/.t > Π/2

eqn/.t > Π



e4



eqn/.t > 1



e5



eqn/.t > 2

b Π 1

e e

d

2

2



1

8

a

1

4

a



Π/ 4



e e



Π



b Π



c



Π/ 2



e e



e

e



b



d Sin 1



a



2 b



d Sin 2



Π/ 4



2

e e



Π



e



Π/ 2



Π



3



e



Π



4



Π/ 4



4

Π/ 2



d



Π

2

c e e



e e



Π/ 4



Π/ 2



Π



c Cos 1

3 e

4 e



4



d Sin 1



Out[587]=



8



e3



a



229



1

e



1

2 e

e



5 Cos 1



c Cos 2

e

2 e



4

1

e



d Sin 2



c Cos 1



c Cos 2



5 Cos 2



In[588]:= Solve e1, e2, e3, e4, e5 ,

a, b, c, d, e //Simplify

Out[588]=



0, b



d



1, a



2, c



1

4



1, e



Last, we check our calculation with DSolve and simplify.

In[589]:= sol2

y t

DSolve 4y t

Exp t/2 , y t , t

Out[589]=



t



2



5 Cos t



y t

e



t/ 2



C 1



2 Cos t



et/ 2 C 2

4 Sin t



t 1 t/ 2

e

t

4 2

et/2 Sin t



1

4



e

e



t/ 2



t/ 2



1 t/ 2

e

Cos t

2



2 t

2 et / 2



230



Chapter 4 Higher-Order Differential Equations



In[590]:= Simplify sol2

Out[590]=



y t

1

e t/ 2 1

4

4 et C 2



8 et / 2



t



4 et / 2 t



4 C 1



Cos t



In order to solve an initial-value problem, first determine a general solution and

then use the initial conditions to solve for the unknown constants in the general

solution.



EXAMPLE 4.4.3: Solve y



4y



cos 2t, y 0



0, y 0



0.



SOLUTION: A general solution of the corresponding homogeneous

c1 cos 2t c2 sin 2t. For this equation, F

cos 2t,

equation is yh

sin 2t . Because elements of F are solutions to the corresponding homogeneous equation, we multiply each element of F by t resulting in tF

t cos 2t, t sin 2t . Therefore, we assume that a particular solution has the

form

y p At cos 2t Bt sin 2t,

where A and B are constants to be determined. Proceeding in the same

manner as before, we compute y p and y p

In[591]:= yp t

yp t



a t Cos 2t



b t Sin 2 t



yp t

Out[591]= a Cos 2 t

2 b t Cos 2 t

b Sin 2 t

2 a t Sin 2 t

Out[591]= 4 b Cos 2 t

4 a t Cos 2 t

4 a Sin 2 t

4 b t Sin 2 t



and then substitute into the nonhomogeneous equation.

In[592]:= eqn



yp



t



4yp t



Cos 2t



Out[592]= 4 b Cos 2 t

4 a t Cos 2 t

4 a Sin 2 t

4 b t Sin 2 t

4 a t Cos 2 t

b t Sin 2 t

Cos 2 t



Equating coefficients readily yields A

0 and B

1/ 4. Alternatively,

remember that 4A sin 2t 4B cos 2t

cos 2t is true for all values of t.



4.4 Nonhomogeneous Equations with Constant Coefficients



Evaluating for two values of t and then solving for A and B gives the

same result.

In[593]:= e1



eqn/.t > 0

eqn/.t > Π/4



e2



e1, e2



cvals Solve

Out[593]= 4 b

1



Out[593]=



4 a



Out[593]=



a



It follows that y p



1

4t



0

0, b



1

4



sin 2t and y



c1 cos 2t



In[594]:= yp t /.cvals

1

t Sin 2 t

Out[594]=

4

In[595]:= y t



c2 sin 2t



1

4t



sin 2t.



1



c2 Sin 2t 1/4 t Sin 2t

1

t Sin 2 t

c2 Sin 2 t

4



c1 Cos 2t



Out[595]= c1 Cos 2 t



Applying the initial conditions

In[596]:= y t



In[597]:= cvals

Out[597]=



results in y



1

4t



c1



Solve

0, c2



1

Sin 2 t

4



1

t Cos 2 t

2



Out[596]= 2 c2 Cos 2 t

2 c1 Sin 2 t



y 0



0, y 0



0



0



sin 2t, which we graph with Plot in Figure 4-21.



In[598]:= y t /.cvals 1

1

t Sin 2 t

Out[598]=

4

In[599]:= Plot Evaluate y t /.cvals



1



, t, 0, 16Π



We verify the calculation with DSolve.

In[600]:= Clear y

DSolve

4y t

Cos 2t , y 0

y t

y 0 ,

0 y t ,t

1

y t

t Sin 2 t

Out[600]=

4



0,



231



232



Chapter 4 Higher-Order Differential Equations



10



5



10



20



30



40



50



-5



-10



Figure 4-21



The forcing function causes the solution to become unbounded as t



Initial-value problems and boundary-value problems can exhibit dramatically different behavior.



EXAMPLE 4.4.4: Show that the boundary-value problem

4y



4y



y0







37y



cos 3x



has infinitely many solutions.



SOLUTION: First, we find a general solution of the corresponding

homogeneous equation.

In[601]:= Clear x, y

homsol

4y x

37y x

0,

DSolve 4y x

y x ,x

x/ 2

x/ 2

Out[601]=

y x

C 2 Cos 3 x

C 1 Sin 3 x



Using the Method of Undetermined Coefficients, we find a particular

A cos 3x

solution to the nonhomogeneous equation of the form y p

B sin 3x. Substitution into the nonhomogeneous equation yields.

In[602]:= yp x



capa Cos 3x



step1

4yp x

4yp x

Simplify



capb Sin 3x



37yp x



Cos 3x //



4.4 Nonhomogeneous Equations with Constant Coefficients



Out[602]=



1



capa 12 capb Cos 3 x

12 capa capb Sin 3 x



233



0



This equation is true for all values of x. In particular, substituting x

and x Π/ 6 yields two equations

In[603]:= eq1

Out[603]=



1



step1 /. x > 0

capa



In[604]:= eq2

Out[604]=



0



12 capb



0



step1 /. x > Π/6



12 capa



capb



0



that we then solve for A and B

In[605]:= vals

Out[605]=



to see that A



Solve eq1, eq2

12

1

, capb

capa

145

145



1/ 145 and B



In[606]:= yp x



12/ 145.



yp x /. vals



In[607]:= y x



x/ 2



e



yp



Out[607]=



1



C 2 Cos 3x

x



1

Cos 3 x

145

12

Sin 3 x

145



x/ 2



e



x/ 2



C 1 Sin 3 x



2

145 1 e



Π/ 2



1

145



C 2



In[609]:= y Π

1

Out[609]=

145



so c2



C 1 Sin 3x



C 2 Cos 3 x



Applying the boundary conditions indicates that

In[608]:= y 0

1

Out[608]=

145



x/ 2



Π/ 2



C 2



; c1 is arbitrary.

Solve y 0

y Π

2 Π/ 2

C 2

Π/ 2

145 1



In[610]:= cval

Out[610]=



In[611]:= N cval

Out[611]=



C 2



0.0114193



In[612]:= y x

y x /. cval 1

Π x

2 2 2 Cos 3 x

1

Cos 3 x

Out[612]=

Π/ 2

145

145 1

12

x/ 2

Sin 3 x

C 1 Sin 3 x

145



c2



1

145



e



Π/ 2



c2



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

4 Nonhomogeneous Equations with Constant Coefficients: The Method of Undetermined Coefficients

Tải bản đầy đủ ngay(0 tr)

×