haihongyuan.com

Matlab英文教材2

Mathematical Methods (10/24.539)

II. Linear Differential Equations

Introduction

Many systems can be represented in mathematical form using Linear Differential Equations. This subject is the main focus of most introductory courses in Differential Equations. In

addition, linear ODEs with constant coefficients can be solved using relatively simple analytical approaches, and the characteristic solutions that are obtained are simple elementary functions (sinusoids, exponentials, etc.) and they give significant insight into the physical behavior of the systems under study. Also, much of the mathematical notation and terminology (i.e. linear independence, homogeneous, particular, general, and unique solutions, etc.) associated with all differential equations can be introduced concisely and logically through the discussion of linear ODEs. Thus, this is an important subject that warrants a brief review here -- just to make sure everyone has the same base background.

Note: Although this section of notes will not be treated in detail in this class, you should be sure you are quite comfortable with all the concepts reviewed here…

In particular, this section overviews the key terminology and analytical procedures needed to solve linear ODEs (of second and higher order). This material is broken into a number of subsections, as follows: Second Order Systems

? ? ? Undetermined Coefficients (UC)

? Overview of Variation of Parameters (VOP)

? Development of VOP Equations for 2nd Order System Examples of Analytical Solution Methods

? - Solve y''+4y=x2+8cos2x using the UC method

? - Solve Example 2.1 again using the VOP method

? - Solve xy''+(2x+3)y'+4y=e2x by simplification using ON

Math Methods -- Section II: Linear Differential Equations 2

General Characteristics

In general, a linear nth order differential equation can be written as

nn?1 (2.1) y()+pn?1(x)y()+"+p1(x)y'+po(x)y=r(x)

where the pi(x) coefficients and right hand side forcing function, r(x), are continuous functions. For example, the standard form for a second order system is

(2.2) y''+p(x)y'+q(x)y=r(x)

The General Solution to a problem of this type (i.e. linear ODE) can be written as the sum of a homogeneous solution and a particular solution,

(2.3) y(x)=yh(x)+yp(x)

where y(x) is the general solution, yh(x) is the homogeneous solution (sometimes referred to as the complementary solution) containing n arbitrary constants, and yp(x) is the particular solution containing no arbitrary constants.

The Unique Solution is generated by specifying n unique conditions that must be satisfied, thereby identifying the arbitrary constants within the homogeneous solution. The manner in which the conditions are specified puts the linear ODE within one of two categories:

Initial Value Problems (IVPs): For this class of problems, there is only one boundary point location, which is typically referred to as the initial point. With n initial conditions specified at this single point, one can uniquely define n constants.

Boundary Value Problems (BVPs): For this category, two or more boundary points are

specified. With a total of n boundary conditions at these two or more boundary locations, one can at least define n-1 constants, with the final constant sometimes representing an arbitrary normalization (the difference here is specific to eigenvalue versus fixed-source problems -- to be discussed later).

We will discuss various analytical solution methods for linear ODEs and other related topics in this section of notes. Some of the topics highlighted, and their inter-relationships, are as follows: Homogeneous Equations:

Constant coefficient equations -- assume solutions of the form yh(x)≈eλx

Euler-Cauchy equations -- assume solutions of the form yh(x)≈xm

Variable coefficient case - use power series solution (done later)

Particular Solutions:

Undetermined Coefficients -- useful for simple r(x) and constant coefficient equations

Variation of Parameter -- a more general method (also more difficult to use)

Reduction of Order: A technique for obtaining a second solution given one known solution -- let y2(x)=u(x)y1(x).

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 3Linear Independence: A method for addressing whether n solutions are linearly independent and form a basis. If the Wronskian is nonzero, W(y1,y2)≠0, then y1 and y2 are linearly independent.

Differential Operators: This section develops a new notation, which is often convenient and, sometimes, it can lead to important simplifications in special situations.

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 4

Homogeneous Equations with Constant Coefficients

A general constant coefficient homogeneous linear ODE can be written as

nn?1y()+an?1y()+"+a1y'+aoy=0 (2.4) One usually assumes a solution of the form z(x)=eλx (for constant λ). Substitution of this expression into the original equation gives

λneλx+an?1λn?1eλx+"+a1λeλx+a0eλx=0

Dividing by eλx gives the characteristic equation

λn+an?1λn?1+"+a1λ+a0=0 (2.5) and the roots of the characteristic polynomial represent values of λ that satisfy the assumed form for z(x). For an nth order system, there will be n roots (not necessarily distinct) to the nth order characteristic equation.

The general solution becomes a linear combination of the individual solutions to the

homogeneous equation with the restriction that the n solutions must be linearly independent. For n distinct roots, the homogeneous solution can be written as

yh(x)=∑cizi(x)=∑cieλix (2.6)

i=1i=1nn

The n linearly independent solutions form the basis of solutions on the interval of interest.

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 5

Linear Independence

General Discussion

The subject of linear independence is very important since n linearly independent solutions are needed to form the homogeneous solution to an nth order linear ODE. Here we will restrict our arguments to a second order system and then generalize for the nth order case.

Let’s define y1(x) and y2(x) as two solutions to a 2nd order linear ODE. Simply stated, if y1/y2 = constant, then these two functions are linearly dependent. However, if y1/y2 = f(x), then y1(x) and y2(x) are linearly independent, since their ratio varies with x.

This check on linear independence is often quite straightforward for 2nd order systems, but for the general case, simply looking at ratios of functions is usually not sufficient. However, this check can be generalized as shown below.

General Check for Linear Independence

Second Order Systems

The homogeneous solution is a linear combination of the two linearly independent individual solutions, y1(x) and y2(x), or

y(x)=k1y1(x)+k2y2(x) (2.7) Now, if y1(x) and y2(x) are really linearly independent, then this is a valid homogeneous solution. As such, we can take the derivative of this expression, giving

y'(x)=k1y1'(x)+k2y2'(x) (2.8) Writing these two equations, evaluated at any value x=x0 on the interval of interest, as a matrix equation gives

?y1(x0)y2(x0)??k1??y(x0)? (2.9) ????=?? y'xy'xy'xk()()()20??2?0??10?

For this (assumed to be valid) system to have a non-trivial solution, the coefficient matrix must not be singular (i.e. its determinant must be non-zero). Thus we have the condition that y1(x0)y2(x0)=(y1y2'?y1'y2)x=x≠0 (2.10) 0y1'(x0)y2'(x0)

implies linear independence.

This particular determinant appears frequently and is called the Wronskian of y1 and y2 and is denoted as W(y1, y2). Therefore,

W(y1,y2)≠0 (2.11) implies that y1 and y2 are linearly independent.

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 6

Higher Order Systems

The above result extends nicely to nth order systems. In particular,

y1

y1'

(n?1)y1 W(y1,y2,",yn)=y2y2'#""ynyn' (2.12) ≠0 n?1)(n?1)"y(y2n

implies that y1,y2,",yn are all linearly independent.

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 7

Reduction of Order

General Discussion

One often needs to obtain a second solution when one solution is already known. This occurs, for example, if the two individual solutions to a 2nd order system are linearly dependent, or if one solution is known by inspection of the equations (or by some other means). In these cases, the Reduction of Order Method can be used to find a second linearly independent solution.

Development of the Method

Given a valid solution to a homogeneous linear 2nd order differential equation, one can obtain a second linearly independent solution by letting

(2.13) y2(x)=u(x)y1(x)

where y1(x) is known and u(x) is to be determined. This technique applied to a 2nd order system is as follows:

Given the original differential equation

(2.14) y''(x)+p(x)y'(x)+q(x)y(x)=0

y2=uy1

y2'=u'y1+uy1'

y2''=u''y1+u'y1'+u'y1'+uy1''

y2''=u''y1+2u'y1'+uy1'' with known solution y1(x), we let or

Now, substitution into the original equation gives

or

u''y1+2u'y1'+uy1''+p(u'y1+uy1')+quy1=0 u''y1+u'(2y1'+py1)+u(y1''+py1'+qy1)=0

Letting z = u′ and noting that the third term vanishes from definition of the original ODE, we have a 1st order equation for z (i.e. the original 2nd order equation and one solution leads to a 1st order ODE for the second solution -- thus, the phrase “reduction of order”), or

z'y1+z(2y1'+py1)=0 (2.15) Now, separating variables and integrating gives ?2y'?z'=??+p? z?y1?

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 8

or lnz=?2lny1?∫p(x)dx lnzy12=?∫p(x)dx 1?∫p(x)dx (2.16) ey12()z(x)=

Finally, since du/dx = z, we have

u(x)=∫z(x)dx and y2(x)=u(x)y1(x) (2.17) General Note

If, in a 2nd order equation, the dependent variable y does not appear explicitly, one has

F(x,y',y'')=0. In this case, one can let z = y′ and obtain a 1st order equation for z and then find y(x) by integration. This technique was used in the above development, and it is quite useful in many situations.

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 9

Homogeneous 2nd Order Systems with Constant Coefficients

General Discussion

A 2nd order constant coefficient homogeneous system can be written as

y''+ay'+by=0 (2.18) Assuming a solution of the form eλx, the corresponding characteristic equation becomes

λ2+aλ+b=0

and the roots of this quadratic equation are given by

λ1,2?a±= (2.19) 2

With known (distinct) roots, the general solution can be written as

y(x)=c1eλ1x+c2eλ2x

The actual form of the solution is strongly dependent on whether the roots are real versus

complex or distinct versus repeated. In fact three special cases can be identified based on

whether the term inside the radical is positive, negative, or zero. These three cases are identified in detail in the remainder of this subsection.

Three Special Cases

I. Real Distinct Roots:

If a2 - 4b > 0, the roots are real and distinct. Therefore the general solution is usually written as above, or

y(x)=c1eλ1x+

c2eλ2x (2.20) One particular subset here is when a = 0 and b < 0. For this special case, λ1,2=±α= and the solution, y(x), may also be written as

y(x)=k1sinhαx+k2coshαx (2.21) The correspondence between the coefficients, c1, c2 and k1, k2, for the two forms for this special case is easily developed if one recalls the definition of the hyperbolic functions in terms of the real exponentials, or eαx?e?αxeαx+e?αx

sinhαx= and coshαx= (2.22) 22

Now putting these into eqn. (2.21) gives

eαx?e?αxeαx+e?αx?k1+k2?αx?k2?k1??αxy(x)=k1+k2=??e+??e 22?2??2?

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 10and, from the last relationship, it is obvious that the correspondence among the coefficients is given by c1=k+kk?k (2.23) and c2=22

II. Complex Conjugate Roots:

If a2 - 4b < 0, the roots are complex conjugates. In this case the roots can be written as

λ1,2=α±iβ with α= (2.24) Recalling the definition of the complex exponential and the complex form of the sine and cosine functions,

(2.25) e±iβx=cosβx±isinβx eiβx?e?iβxeiβx+e?iβx

sinβx= and cosβx= (2.26) 2i2

c1eλ1x=c1eαxeiβx=c1eαx(cosβx+isinβx)

c2eλ2x=c2eαxe?iβx=c2eαx(cosβx?isinβx) the standard form of the solution, y(x), can be rewritten using

to get

y(x)=eαxc1eiβx+c2e?iβx=eαx(k1cosβx+k2sinβx) (2.27) ()

where the relationship between the two formulations is simply

k1=c1+c2 and k2=(c1?c2)i (2.28) III. Repeated Roots:

If a2 - 4b = 0, one obtains repeated roots. For this situation, the double root is given by a (2.29) λ1,2=? 2

Therefore, there is only one independent solution,

y1(x)=e?ax2 (2.30) y''+p(x)y'+q(x)y=0 To find a second basis solution, let’s use the Reduction of Order Method. For the general case,

we have from eqns. (2.16) and (2.17) that z(x)=1?∫p(x)dxey1withu(x)=∫z(x)dx and y2(x)=u(x)y1(x)

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 11For the present case, p(x) = a and y1(x)=e?ax2, therefore z(x) becomes

ax?e?ax=1 z(x)=?e??

and u(x) is given by

u(x)=∫(1)dx=x (2.31) Therefore, y2(x)=xe?ax and y(x)=(c1+c2x)e?ax2 (2.32) Special Note

This technique of multiplying by some power of x is quite useful for Linear Constant Coefficient Equations with repeated roots. This is also true for particular solutions to constant coefficient ODEs when the forcing function is of the same form as the homogeneous solution (to be

discussed later).

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 12

Homogeneous 2nd Order Euler-Cauchy Equations

General Discussion

In general, variable coefficient linear ODEs are rather difficult to solve analytically. In a

subsequent section we will use the Power Series Method to address this problem from an

analytical viewpoint, and we will use a numerical scheme for the general case. However, there is one special case of a variable coefficient system, called the Euler-Cauchy equation, that occurs quite frequently in applications and has a solution scheme very similar to that of constant

coefficient systems. This subsection is devoted to developing the solution method for this

special system - the homogeneous 2nd order Euler-Cauchy equation.

For 2nd order, the standard Euler-Cauchy equation has the form

(2.33) x2y''+axy'+by=0

where a and b are constants. We assume a solution of the form

y=xm (2.34) Therefore,

y'=mxm?1 and y''=m(m?1)xm?2 (2.35) Upon substitution into the original ODE given in eqn. (2.33), we get

[m(m?1)+am+b]xm=0

m2+(a?1)m+b=0 and dividing by xm gives the characteristic equation,

The roots of this quadratic equation are given by

m1,2= (2.36)

As for the case of constant coefficients, the actual form of the solution is strongly dependent on whether the roots are real versus complex or distinct versus repeated. In fact three special cases can be identified based on whether the term inside the radical is positive, negative, or zero.

These three cases, for the Euler Cauchy equation, are identified in detail in the remainder of this subsection.

Three Special Cases

I. Real Distinct Roots:

If (a-1)2 - 4b > 0, the roots are real and distinct. Therefore the general solution is simply

written as

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008) y(x)=c1xm1+c2xm2 (2.37)

Math Methods -- Section II: Linear Differential Equations 13II. Complex Conjugate Roots:

If (a-1)2 - 4b < 0, the roots are complex conjugates. In this case the roots can be written as

m1,2=α±iβ with α= (2.38) Before writing the general solution in terms of complex roots, however, let’s look at alternate ways to write xm. The goal here is to write the solution in terms of real functions, if possible. First consider the following form for xm,

x=em()lnxm=emlnx (2.39) Now, if m=α+iβ, then

iβlnx?=xα?xm=xα+iβ=xαxiβ=xα?e (2.40) ?cos(βlnx)+isin(βlnx)?? ??and similarly

(2.41) x=xα?iβ=xα??cos(βlnx)?isin(βlnx)??

y(x)=c1xm+c2x=xα??(c1+c2)cos(βlnx)+(c1?c2)isin(βlnx)?? Therefore,

or

(2.42) y(x)=xα??k1cos(βlnx)+k2sin(βlnx)??

where k1=c1+c2 and k2=(c1?c2)i (2.43) Note also that the following expressions are often useful in justifying the relationship of the standard solution in eqn. (2.37) and the form given in eqn. (2.42):

eiβlnx?e?iβlnxxiβ?x?iβsin(βlnx)== (2.44) 2i2ieiβlnx+e?iβlnxxiβ+x?iβ

cos(βlnx)== (2.45) 22

III. Repeated Roots:

If (a-1)2 - 4b = 0, one obtains repeated roots. For this situation, the double root is given by (2.46) m1,2=(1?a)2

Therefore, there is only one independent solution,

y1(x)=xm=x(1?a)2 (2.47) To find a second basis solution, let’s use the Reduction of Order Method again. For the general case,

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 14 y''+p(x)y'+q(x)y=0

we have from eqns. (2.16) and (2.17) that z(x)=1?∫p(x)dxe2y1withu(x)=∫z(x)dx and y2(x)=u(x)y1(x)

For the present case, p(x) = a/x , q(x) = b/x2, and y1(x)=xm=x(1?a)2. Therefore z(x) becomes z(x)=x?2ma?∫ex=x?2me?alnx=x?2mx?a

but m = (1-a)/2, thus x?2m=xa?1 , and z(x)=xa?1x?a=x?1=

Finally, u(x)=∫()()1 xdx (2.48) =lnx x

Therefore,

y2(x)=xmlnx and y(x)=(c1+c2lnx)xm (2.49) Special Note

This technique of multiplying by ln(x) is quite useful for Euler-Cauchy equations with repeated roots. This form also appears on occasion for particular solutions when the forcing function for the Euler-Cauchy equation is of the same form as the homogeneous solution (to be discussed shortly).

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 15

Finding Particular Solutions

Undetermined Coefficients (UC)

The method of undetermined coefficients is rather straightforward but it is generally useful only for constant coefficient linear systems. In addition, the forcing function, r(x), must be a relatively simple function that has a finite number of linearly independent derivatives

(exponentials, polynomials, sinusoids, or a linear combination of such functions usually work nicely).

General rule: Choose yp(x) to have the same form as the RHS forcing function and all its linearly independent derivatives. Evaluate the unknown coefficients within yp(x) by substitution into the original inhomogeneous ODE, and simply equate the coefficients of the like terms on both sides of the equations.

Special rule: If yp(x) via the general rule for a constant coefficient linear system contains terms that are solutions to the homogeneous equations, one then multiplies this choice by x (from the Reduction of Order Method).

Example 2.1 provides an example of the method of Undetermined Coefficients.

Variation of Parameters (VOP)

A more general method for finding particular solutions is the variation of parameter technique. The method can be summarized as follows:

Given

nn?1y()+pn?1(x)y()+"+p1(x)y'+p0(x)y=r(x) (2.50) with homogeneous solution

yh(x)=c1y1(x)+c2y2(x)+c3y3(x)+" (2.51)

(2.52) yp(x)=u1(x)y1(x)+u2(x)y2(x)+u3(x)y3(x)+"

W1(x)W(x)r(x)dx and u2(x)=∫2r(x)dx W(x)W(x)

Wi(x)r(x)dx (2.53) W(x)

"

"one can write the particular solution as where u1(x)=∫or, in general, ui(x)=∫where the Wronskian for an nth order system is given by y1

y1'

(n?1)y1 W(x)=y2y2'#ynyn' (2.54) n?1)(n?1)"y(y2n

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 16

and Wi(x) is the determinant obtained after replacing the ith column of W(x) with the vector [00"01]T. For example, in a 3rd order system, W2(x) is given by

y10y3

W2(x)=y1'0y3'

y1''1y3''

The development of these equations for the specific case of a second order system is given in the next subsection. Generalization to higher order systems is straightforward. Note that the

equations given here are only valid if the original ODE has the form given in eqn. (2.50) -- that is, with a lead coefficient of unity for the y(n) term.

Example 2.2 illustrates the Variation of Parameters method using the same problem statement as given in Example 2.1 (which used the Undetermined Coefficients approach). Variation of Parameters - Detailed Development for 2nd Order Systems

This subsection derives the summary equations presented above for the Variation of Parameters method. The development here is specific to a second order system, but it is easily extended to higher order linear ODEs.

Let’s start with the general 2nd order equation written in standard form,

y''+p(x)y'+q(x)y=r(x)

(2.55) (2.56)

with homogeneous solution

yh(x)=c1y1(x)+c2y2(x)

Now assume yp of the form

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

(2.57)

which gives

(2.58) yp=u1y1+u2y2 and yp'=u1y1'+u1'y1+u2y2'+u2'y2

At this point we recognize that an additional constraint, beyond the original balance equation,

will be needed because we are trying to find two unknowns, u1 and u2. For simplicity, let’s choose the following relationship,

u1'y1+u2'y2=0

yp'=u1y1'+u2y2'

(2.59)

which greatly simplifies the above equation for yp’, giving

(2.60)

Now the second derivative becomes

yp''=u1y1''+u1'y1'+u2y2''+u2'y2'

(2.61)

Substitution of these expressions into the original equation gives

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 17

u1y1''+u1'y1'+u2y2''+u2'y2'+pu1y1'+pu2y2'+qu1y1+qu2y2=r

Rearranging gives

u1(y1''+py1'+qy1)+u2(y2''+py2'+qy2)+u1'y1'+u2'y2'=r

Therefore, since both the first and second terms vanish (because y1 and y2 are solutions to the homogeneous equation), we have

u1'y1'+u2'y2'=r (2.62) Writing eqns. (2.59) and (2.62) in matrix form (two equations with two unknowns) gives ?y1y2??u1'??0??y'y'??u'?=?r? ??2??2??1 (2.63)

Using Cramer’s rule the solution to this system can be written as 0y20y2

ry2'1y2'Wu1'=r=1r =y1y2WW

y1'y2'

y10

y'1Wu2'=1r=2r WW (2.64) (2.65)

Finally, integrating these latter expressions to give u1 and u2 allows one to write the desired expression for yp(x) as yp(x)=y1∫WWr(x)dx+y2∫r(x)dx WW (2.66) This result is consistent with the general relationships given above.

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 18

Operator Notation

General Discussion

Linear ODEs are very common in engineering analysis. Because they occur so frequently, it is often convenient to use a shorthand notation to simplify the sometimes lengthy and very detailed differential equations that are characteristic of many real systems. In particular, let’s define the common derivative operation with the following notation: dyd2ydnyn2, Dy=, and Dy= Dy=dxdxdx (2.67) The quantities D, D2,", Dn are called differential operators and they have properties analogous to algebraic quantities. For example, a general 2nd order linear ODE can be written simply as Ly = r, where the L operator is the combination of three operators and is given by L=D2+pD+q and Ly = D2+pD+qy=r () (2.68) This simplified notation is very convenient once one becomes comfortable with the

interpretation of the operators utilized.

1. Linear operators with constant coefficients can be factored and the order of the operation is unimportant. For example, the following operator expressions are all equivalent:

(D2+3D+2y=(D+2)(D+1)y=(D+1)(D+2)y )

2. Linear operators with variable coefficients can also be factored, but the order of operation is extremely important. To see this, consider the following two operator expressions that are nearly identical, except for the order of operation:

Case 1:

(xD+1)(D?2)y=(xD+1)(y'?2y) =xD(y'?2y)+(y'?2y)

=xy''?2xy'+y'?2y

Case 2:

(D?2)(xD+1)y=(D?2)(xy'+y) =D(xy'+y)?2(xy'+y)

=xy''+y'+y'?2xy'?2y

=xy''+2y'?2xy'?2y

Thus, it is clear that Case 1 and Case 2 lead to different results. Therefore,

(xD+1)(D?2)y≠(D?2)(xD+1)y

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 19Summary Note

The point here is that linear operator notation can be very useful at times, and it is used

extensively in the literature -- so the student must become familiar with its use. In addition, proper factorization of linear operators can also help in the solution of some very complicated systems. Example 2.3 further explains this approach. However, for variable coefficient systems, the order of operation is very important and care must be exercised when working with such systems!

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 20

Example 2.1 -- Method of Undetermined Coefficients

Problem Description:

Solve the following 2nd order equation using the method of undetermined coefficients: y''+4y=x2+8cos2x

Problem Solution:

1. Let’s first find the homogeneous solution. The characteristic equation is

λ2+4=0 λ1,2==±2i

yh(x)=c1cos2x+c2sin2x with roots

Therefore the homogeneous solution is

2. Now for the particular solution we choose an expression of the form of the forcing function and all its derivatives, or

yp(x)=k1+k2x+k3x2+x(k4sin2x+k5cos2x)

where the last term is multiplied by x because cos 2x already appears within the homogeneous solution. Taking the first and second derivatives of this expression gives

yp'(x)=k2+2k3x+x(2k4cos2x?2k5sin2x)+(k4sin2x+k5cos2x)

yp''(x)=2k3?x(4k4sin2x+4k5cos2x)+(2k4cos2x?2k5sin2x)

+(2k4cos2x?2k5sin2x)

or

yp''(x)=2k3?4k4xsin2x?4k5xcos2x+4k4cos2x?4k5sin2x

Substitution of these expressions into the original linear ODE gives

2k3?4k4xsin2x?4k5xcos2x+4k4cos2x?4k5sin2x+

4k1+4k2x+4k3x+4k4xsin2x+4k5xcos2x=x+8cos2x22

First note that the terms containing xsin2x and xcos2x vanish. Now equating coefficients of like terms for the polynomial terms gives

2k3+4k1=0, 4k2=0, and 4k3=1

11k1=?, k2=0, and k3= 84

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008) Thus the first three coefficients become

Math Methods -- Section II: Linear Differential Equations 21Similarly for the sinusoidal terms, we have

or 4k4=8 and ?4k5=0 k4=2 and k5=0

11yp(x)=?+x2+2xsin2x 84Therefore, the particular solution is

3. Finally, combining the homogeneous and particular solutions gives the desired general solution, or 11y(x)=yh(x)+yp(x)=c1cos2x+c2sin2x?+x2+2xsin2x 84

Example 2.2 explores a different approach for developing this solution using the Variation of Parameters method.

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 22

Example 2.2 -- Variation of Parameters

Problem Description:

Solve the following 2nd order equation using the variation of parameter method:

y''+4y=x2+8cos2x

Problem Solution:

1. The homogeneous solution for this problem was derived previously (see Example 2.1) as yh(x)=c1cos2x+c2sin2x

yp(x)=u1y1+u2y2 2. Now for the particular solution, assume that yp(x) can be written as

where

y1=cos2x and y2=sin2x

From our previous development for the Variation of Parameter technique (note that the system is already in standard form), we have

where yp(x)=y1∫W1Wr(x)dx+y2∫2r(x)dx WWy1y2cos2xsin2xW===2cos22x+2sin22x=2 y1'y2'?2sin2x2cos2x

W1=0y20sin2x==?sin2x 1y2'12cos2x

and

y10cos2x0W2===cos2x y1'1?2sin2x1r(x)=x2+8cos2x

For performing the integrals and various manipulations, note the following integral relationships and trigonometric identities:

2∫cosaxdx=xsin2ax +24a1sin2ax 2a∫sinaxcosaxdx=

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 23

and

2x2x2∫xsinaxdx=asinax+acosax?acosax 22x2x2∫xcosaxdx=a2cosax?a3sinax+asinax 2sinαcosβ=11sin(α+β)+sin(α?β) 22sin2α=2sinαcosα

W11r=?x2sin2x+8sin2xcos2x W2Now, with these expressions and relationships, the integrands and actual integrals become: ()

??sin22x??W1??2x2x2sin2x+cos2x?cos2x?+8???∫Wr(x)dx=?2??4824??????

111=?xsin2x?cos2x+x2cos2x?sin22x484 W2122 r=?xcos2x+8cos2x???W2

??x1W1??2x2x2??cos2x?sin2x+sin2x?+8?+sin4x??∫Wr(x)dx=2??482?? ??28??

1111=xcos2x?sin2x+x2sin2x+2x+sin4x4842

111yp=?xsin2xcos2x?cos22x+x2cos22x484

11 ?sin22xcos2x+xsin2xcos2x?sin22x 48

11 +x2sin22x+2xsin2x+sin4xsin2x42

111yp=?+x2?sin22xcos2x+2xsin2x+sin4xsin2x 842

11yp(x)=?+x2+2xsin2x 84Therefore, yp(x) becomes or Therefore, using the last trigonometric identity given above, one final simplification gives

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 24Finally, combining this with the homogeneous solution gives 11y(x)=c1cos2x+c2sin2x?+x2+2xsin2x 84

which is the same solution as that from Example 2.1.

Clearly, Examples 2.1 and 2.2 show that, if possible, the method of undetermined coefficients should be used, since its application is usually much easier than the current variation of parameters approach. A word of advice is “Use the Variation of Parameters method when necessary, but only when necessary!”

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 25

Example 2.3 -- Solution via Operator Factorization

Problem Description:

Solve the following variable coefficient 2nd order equation by operator factorization: xy''+(2x+3)y'+4y=e2x

Problem Solution:

1. First let’s write the original equation in operator form,

?xD2+(2x+3)D+4?y=e2x ??

2Ly=?xD+(2x+3)D+4???y=(D+2)(xD+2)y 2. Now factor the operator L(D) as follows:

Checking this (just to be sure) shows that indeed this is the correct factorization (always be careful here), or

(D+2)(xD+2)y=(D+2)(xDy+2y)

=xD2y+Dy+2Dy+2xDy+4y

=xD2+(2x+3)D+4y()

3. Now, let (xD+2)y=z. Therefore, we have

or dz+2z=e2x dx(D+2)z=e2x

But this is a linear 1st order ODE with integrating factor g(x)=e2x. Therefore,

?dz?de2x?+2z?=ze2x=e4x ?dx?dx()

and integration gives ze2x=∫e4xdx=14xe+c14orz(x)=12xe+c1e?2x 4

4. Now we must solve

or (xD+2)y=12xe+c1e?2x 4

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)

Math Methods -- Section II: Linear Differential Equations 26 dy21e2xe?2x

+y=+c1 dxx4xx

2Again this is a linear 1st order ODE with integrating factor g(x)=e∫x=e2lnx=x2

Therefore, 1?dy2?d+y?=x2?yx2=xe2x+c1xe?2x 4?dxx?dx()

Integrating both sides of this expression gives (see detailed integration by parts below): 1yx2=∫xe2xdx+∫c1xe?2xdx4 1?12x??1?1??1?2x?? =?e??x??+c1??e??x+?+c24?22?2????2??

11?11???yx2=e2x?x???c1e?2x?x+?+c2 82?22??? or

Thus, the final solution to this rather complex problem is y=1

x21?1?2x?1??12x????+excex+c1????2? ?82?22?????

-------------------------

Note: Let’s do an example of integration by parts. Consider the following integral, I=∫xeaxdx

Now let’s put this into the following form

∫udv=uv?∫vdu

where

u=x, dv=eaxdx

1du=dx, v=eax a

1ax111xe?∫eaxdx=xeax?2eax aaaaTherefore, we have

or I=11??I=eax?x?? aa??

Lecture Notes for Math Methods by Dr. John R. White, UMass-Lowell (August 2008)