advertisement

Differential Equations Preface Here are my online notes for my differential equations course that I teach here at Lamar University. Despite the fact that these are my “class notes”, they should be accessible to anyone wanting to learn how to solve differential equations or needing a refresher on differential equations. I’ve tried to make these notes as self contained as possible and so all the information needed to read through them is either from a Calculus or Algebra class or contained in other sections of the notes. A couple of warnings to my students who may be here to get a copy of what happened on a day that you missed. 1. Because I wanted to make this a fairly complete set of notes for anyone wanting to learn differential equations I have included some material that I do not usually have time to cover in class and because this changes from semester to semester it is not noted here. You will need to find one of your fellow class mates to see if there is something in these notes that wasn’t covered in class. 2. In general I try to work problems in class that are different from my notes. However, with Differential Equation many of the problems are difficult to make up on the spur of the moment and so in this class my class work will follow these notes fairly close as far as worked problems go. With that being said I will, on occasion, work problems off the top of my head when I can to provide more examples than just those in my notes. Also, I often don’t have time in class to work all of the problems in the notes and so you will find that some sections contain problems that weren’t worked in class due to time restrictions. 3. Sometimes questions in class will lead down paths that are not covered here. I try to anticipate as many of the questions as possible in writing these up, but the reality is that I can’t anticipate all the questions. Sometimes a very good question gets asked in class that leads to insights that I’ve not included here. You should always talk to someone who was in class on the day you missed and compare these notes to their notes and see what the differences are. 4. This is somewhat related to the previous three items, but is important enough to merit its own item. THESE NOTES ARE NOT A SUBSTITUTE FOR ATTENDING CLASS!! Using these notes as a substitute for class is liable to get you in trouble. As already noted not everything in these notes is covered in class and often material or insights not in these notes is covered in class. © 2007 Paul Dawkins 1 http://tutorial.math.lamar.edu/terms.aspx Differential Equations © 2007 Paul Dawkins ii http://tutorial.math.lamar.edu/terms.aspx Differential Equations Series Solutions to Differential Equations Before we get into finding series solutions to differential equations we need to determine when we can find series solutions to differential equations. So, let’s start with the differential equation, p ( x ) y¢¢ + q ( x ) y¢ + r ( x ) y = 0 (1) This time we really do mean nonconstant coefficients. To this point we’ve only dealt with constant coefficients. However, with series solutions we can now have nonconstant coefficient differential equations. Also, in order to make the problems a little nicer we will be dealing only with polynomial coefficients. Now, we say that x=x0 is an ordinary point if provided both q ( x) p ( x) r ( x) p ( x) and are analytic at x=x0. That is to say that these two quantities have Taylor series around x=x0. We are going to be only dealing with coefficients that are polynomials so this will be equivalent to saying that p ( x0 ) ¹ 0 for most of the problems. If a point is not an ordinary point we call it a singular point. The basic idea to finding a series solution to a differential equation is to assume that we can write the solution as a power series in the form, ¥ y ( x ) = å an ( x - x0 ) n (2) n =0 and then try to determine what the an’s need to be. We will only be able to do this if the point x=x0, is an ordinary point. We will usually say that (2) is a series solution around x=x0. Let’s start with a very basic example of this. In fact it will be so basic that we will have constant coefficients. This will allow us to check that we get the correct solution. Example 1 Determine a series solution for the following differential equation about x0 = 0 . y¢¢ + y = 0 Solution Notice that in this case p(x)=1 and so every point is an ordinary point. We will be looking for a solution in the form, ¥ y ( x ) = å an x n n =0 We will need to plug this into our differential equation so we’ll need to find a couple of derivatives. ¥ ¥ y¢ ( x ) = å nan x n -1 y¢¢ ( x ) = å n ( n - 1) an x n- 2 n =1 © 2007 Paul Dawkins n=2 3 http://tutorial.math.lamar.edu/terms.aspx Differential Equations Recall from the power series review section on power series that we can start these at n=0 if we need to, however it’s almost always best to start them where we have here. If it turns out that it would have been easier to start them at n=0 we can easily fix that up when the time comes around. So, plug these into our differential equation. Doing this gives, ¥ å n ( n - 1) a x ¥ + å an x n = 0 n-2 n n= 2 n =0 The next step is to combine everything into a single series. To do this requires that we get both series starting at the same point and that the exponent on the x be the same in both series. We will always start this by getting the exponent on the x to be the same. It is usually best to get the exponent to be an n. The second series already has the proper exponent and the first series will need to be shifted down by 2 in order to get the exponent up to an n. If you don’t recall how to do this take a quick look at the first review section where we did several of these types of problems. Shifting the first power series gives us, ¥ ¥ n =0 n =0 å ( n + 2 )( n + 1) an+2 x n + å an x n = 0 Notice that in the process of the shift we also got both series starting at the same place. This won’t always happen, but when it does we’ll take it. We can now add up the two series. This gives, ¥ å éë( n + 2 )( n + 1) a n+2 n =0 + an ùû x n = 0 Now recalling the fact from the power series review section we know that if we have a power series that is zero for all x (as this is) then all the coefficients must have been zero to start with. This gives us the following, ( n + 2 )( n + 1) an + 2 + an = 0, n = 0,1, 2,K This is called the recurrence relation and notice that we included the values of n for which it must be true. We will always want to include the values of n for which the recurrence relation is true since they won’t always start at n = 0 as it did in this case. Now let’s recall what we were after in the first place. We wanted to find a series solution to the differential equation. In order to do this we needed to determine the values of the an’s. We are almost to the point where we can do that. The recurrence relation has two different an’s in it so we can’t just solve this for an and get a formula that will work for all n. We can however, use this to determine what all but two of the an’s are. To do this we first solve the recurrence relation for the an that has the largest subscript. Doing this gives, an+ 2 = - © 2007 Paul Dawkins an ( n + 2 )( n + 1) 4 n = 0,1, 2,K http://tutorial.math.lamar.edu/terms.aspx Differential Equations Now, at this point we just need to start plugging in some value of n and see what happens, n=0 a2 = -a0 ( 2 )(1) a4 = n=2 = = a2 ( 4 )( 3) -a1 ( 3)( 2 ) n=3 = a4 ( 6 )( 5 ) n=5 = ( 2k ) ! ( 5 )( 4 ) ( 5 )( 4 )( 3)( 2 ) a5 ( 7 )( 6 ) - a1 ( 7 )( 6 )( 5)( 4 )( 3)( 2 ) k a2 k = a3 a1 a7 = - - a0 ( 6 )( 5)( 4 )( 3)( 2 )(1) M ( -1) a0 a3 = a5 = - a0 ( 4 )( 3)( 2 )(1) a6 = n=4 n=1 M ( -1) a1 k , k = 1, 2,K a2 k +1 = ( 2k + 1)! , k = 1, 2,K Notice that at each step we always plugged back in the previous answer so that when the subscript was even we could always write the an in terms of a0 and when the coefficient was odd we could always write the an in terms of a1. Also notice that, in this case, we were able to find a general formula for an’s with even coefficients and an’s with odd coefficients. This won’t always be possible to do. There’s one more thing to notice here. The formulas that we developed were only for k=1,2,… however, in this case again, they will also work for k=0. Again, this is something that won’t always work, but does here. Do not get excited about the fact that we don’t know what a0 and a1 are. As you will see, we actually need these to be in the problem to get the correct solution. Now that we’ve got formulas for the an’s let’s get a solution. The first thing that we’ll do is write out the solution with a couple of the an’s plugged in. ¥ y ( x ) = å an x n n =0 = a0 + a1 x + a2 x 2 + a3 x3 + L + a2 k x 2 k + a2 k +1 x 2 k +1 + L ( -1) a0 x 2 k + ( -1) a1 x 2 k +1 + L a a = a0 + a1 x - 0 x 2 - 1 x 3 + L + 2! 3! ( 2k ) ! ( 2k + 1)! k k +1 The next step is to collect all the terms with the same coefficient in them and then factor out that coefficient. © 2007 Paul Dawkins 5 http://tutorial.math.lamar.edu/terms.aspx Differential Equations k k +1 ìï x 2 üï ìï üï -1) x 2 k -1) ( ( x3 y ( x ) = a0 í1 - L + x 2 k +1 + Lý + Lý + a1 í x - + L + 3! ( 2k ) ! ( 2k + 1)! ïî 2! ïþ ïî ïþ ¥ -1) x 2 k -1) x 2 k +1 ( ( = a0 å + a1 å ( 2k ) ! k =0 k = 0 ( 2k + 1) ! ¥ k k In the last step we also used the fact that we knew what the general formula was to write both portions as a power series. This is also our solution. We are done. Before working another problem let’s take a look at the solution to the previous example. First, we started out by saying that we wanted a series solution of the form, ¥ y ( x ) = å an x n n =0 and we didn’t get that. We got a solution that contained two different power series. Also, each of the solutions had an unknown constant in them. This is not a problem. In fact, it’s what we want to have happen. From our work with second order constant coefficient differential equations we know that the solution to the differential equation in the last example is, y ( x ) = c1 cos ( x ) + c2 sin ( x ) Solutions to second order differential equations consist of two separate functions each with an unknown constant in front of them that are found by applying any initial conditions. So, the form of our solution in the last example is exactly what we want to get. Also recall that the following Taylor series, -1) x 2 n ( cos ( x ) = å ( 2n ) ! n =0 ¥ -1) x 2 n +1 ( sin ( x ) = å n = 0 ( 2n + 1) ! n n ¥ Recalling these we very quickly see that what we got from the series solution method was exactly the solution we got from first principles, with the exception that the functions were the Taylor series for the actual functions instead of the actual functions themselves. Now let’s work an example with nonconstant coefficients since that is where series solutions are most useful. Example 2 Find a series solution around x0 = 0 for the following differential equation. y¢¢ - xy = 0 Solution As with the first example p(x)=1 and so again for this differential equation every point is an ordinary point. Now we’ll start this one out just as we did the first example. Let’s write down the form of the solution and get its derivatives. ¥ y ( x ) = å an x n n =0 ¥ y¢ ( x ) = å nan x n -1 n =1 ¥ y¢¢ ( x ) = å n ( n - 1) an x n - 2 n=2 Plugging into the differential equation gives, © 2007 Paul Dawkins 6 http://tutorial.math.lamar.edu/terms.aspx Differential Equations ¥ å n ( n - 1) a x n-2 n n= 2 ¥ - x å an x n = 0 n=0 Unlike the first example we first need to get all the coefficients moved into the series. ¥ ¥ n= 2 n=0 å n ( n - 1) an x n-2 - å an x n+1 = 0 Now we will need to shift the first series down by 2 and the second series up by 1 to get both of the series in terms of xn. ¥ ¥ n =0 n =1 å ( n + 2 )( n + 1) an+2 x n - å an-1 x n = 0 Next we need to get the two series starting at the same value of n. The only way to do that for this problem is to strip out the n=0 term. ¥ ¥ n =1 n =1 ( 2 )(1) a2 x0 + å ( n + 2 )( n + 1) an + 2 x n - å an -1 x n = 0 ¥ 2a2 + å éë( n + 2 )( n + 1) an + 2 - an -1 ùû x n = 0 n =1 We now need to set all the coefficients equal to zero. We will need to be careful with this however. The n=0 coefficient is in front of the series and the n=1,2,3… are all in the series. So, setting coefficient equal to zero gives, n = 0: n = 1, 2,3,K 2a2 = 0 ( n + 2 )( n + 1) an+ 2 - an -1 = 0 Solving the first as well as the recurrence relation gives, n = 0: a2 = 0 n = 1, 2,3,K an+ 2 = an-1 ( n + 2 )( n + 1) Now we need to start plugging in values of n. a3 = a6 = = a0 a4 = ( 3)( 2 ) a3 a7 = ( 6 )( 5 ) a0 ( 6 )( 5 )( 3)( 2 ) = M © 2007 Paul Dawkins a1 a5 = ( 4 )( 3) a4 ( 7 )( 6 ) a8 = a1 =0 a5 =0 ( 5 )( 4 ) ( 8 )( 7 ) ( 7 )( 6 )( 4 )( 3) M 7 a2 M http://tutorial.math.lamar.edu/terms.aspx Differential Equations a0 a1 a3k +1 = ( 2 )( 3)( 5 )( 6 )L ( 3k - 1)( 3k ) ( 3)( 4 )( 6 )( 7 )L ( 3k )( 3k + 1) a3k +2 = 0 k = 0,1, 2,L k = 1, 2,3,L k = 1, 2,3,L a3k = There are a couple of things to note about these coefficients. First, every third coefficient is zero. Next, the formulas here are somewhat unpleasant and not all that easy to see the first time around. Finally, these formulas will not work for k=0 unlike the first example. Now, get the solution, y ( x ) = a0 + a1 x + a2 x 2 + a3 x3 + a4 x 4 + L + a3k x3k + a3k +1 x3k +1 + L a0 3 a1 4 a0 x 3k = a0 + a1 x + x + x L + + 6 12 ( 2 )( 3)( 5)( 6 )L ( 3k - 1)( 3k ) a1 x 3k +1 +L ( 3)( 4 )( 6 )( 7 )L ( 3k )( 3k + 1) Again, collect up the terms that contain the same coefficient, factor the coefficient out and write the results as a new series, ¥ ¥ ìï üï ìï üï x3k x 3k +1 y ( x ) = a0 í1 + å + a x + ý 1í å ý k =1 ( 3 )( 4 )( 6 )( 7 ) L ( 3k )( 3k + 1) ï ïî k =1 ( 2 )( 3)( 5 )( 6 )L ( 3k - 1)( 3k ) ïþ ïî þ We couldn’t start our series at k=0 this time since the general term doesn’t hold for k=0. Now, we need to work an example in which we use a point other that x=0. In fact, let’s just take the previous example and rework it for a different value of x0. We’re also going to need to change up the instructions a little for this example. Example 3 Find the first four terms in each portion of the series solution around x0 = -2 for the following differential equation. y¢¢ - xy = 0 Solution Unfortunately for us there is nothing from the first example that can be reused here. Changing to x0 = -2 completely changes the problem. In this case our solution will be, ¥ y ( x ) = å an ( x + 2 ) n n =0 The derivatives of the solution are, ¥ y¢ ( x ) = å nan ( x + 2 ) ¥ y¢¢ ( x ) = å n ( n - 1) an ( x + 2 ) n -1 n =1 n-2 n=2 Plug these into the differential equation. © 2007 Paul Dawkins 8 http://tutorial.math.lamar.edu/terms.aspx Differential Equations ¥ å n ( n - 1) a ( x + 2 ) n-2 n n= 2 ¥ - x å an ( x + 2 ) = 0 n n =0 We now run into our first real difference between this example and the previous example. In this case we can’t just multiply the x into the second series since in order to combine with the series it must be x+2. Therefore we will first need to modify the coefficient of the second series before multiplying it into the series. ¥ å n ( n - 1) an ( x + 2 ) n-2 n=2 ¥ å n ( n - 1) a ( x + 2 ) n-2 n n= 2 ¥ å n ( n - 1) a ( x + 2 ) n n=0 ¥ ¥ - ( x + 2 ) å an ( x + 2 ) + 2å an ( x + 2 ) = 0 n n =0 n-2 n n=2 ¥ - ( x + 2 - 2 ) å an ( x + 2 ) = 0 n n =0 ¥ - å an ( x + 2 ) n=0 n +1 ¥ + å 2 an ( x + 2 ) = 0 n n =0 We now have three series to work with. This will often occur in these kinds of problems. Now we will need to shift the first series down by 2 and the second series up by 1 the get common exponents in all the series. ¥ ¥ ¥ å ( n + 2 )( n + 1) a ( x + 2 ) - å a ( x + 2 ) + å 2a ( x + 2 ) n n+2 n =0 n n -1 n =1 n=0 n n =0 In order to combine the series we will need to strip out the n=0 terms from both the first and third series. ¥ ¥ ¥ 2a2 + 2a0 + å ( n + 2 )( n + 1) an + 2 ( x + 2 ) - å an -1 ( x + 2 ) + å 2an ( x + 2 ) = 0 n n =1 n n =1 n n =1 ¥ 2a2 + 2a0 + å éë( n + 2 )( n + 1) an + 2 - an -1 + 2an ùû ( x + 2 ) = 0 n n =1 Setting coefficients equal to zero gives, n=0 2a2 + 2a0 = 0 n = 1, 2,3,K ( n + 2 )( n + 1) an + 2 - an -1 + 2an = 0 We now need to solve both of these. In the first case there are two options, we can solve for a2 or we can solve for a0. Out of habit I’ll solve for a0. In the recurrence relation we’ll solve for the term with the largest subscript as in previous examples. n=0 a2 = - a0 n = 1, 2,3,K an + 2 = an -1 - 2an ( n + 2 )( n + 1) Notice that in this example we won’t be having every third term drop out as we did in the previous example. At this point we’ll also acknowledge that the instructions for this problem are different as well. We aren’t going to get a general formula for the an’s this time so we’ll have to be satisfied with just getting the first couple of terms for each portion of the solution. This is often the case for © 2007 Paul Dawkins 9 http://tutorial.math.lamar.edu/terms.aspx Differential Equations series solutions. Getting general formulas for the an’s is the exception rather than the rule in these kinds of problems. To get the first four terms we’ll just start plugging in terms until we’ve got the required number of terms. Note that we will already be starting with an a0 and an a1 from the first two terms of the solution so all we will need are three more terms with an a0 in them and three more terms with an a1 in them. n=0 a2 = - a0 We’ve got two a0’s and one a1. n =1 a3 = a0 - 2a1 a0 a1 = ( 3)( 2 ) 6 3 We’ve got three a0’s and two a1’s. n=2 a4 = a1 - 2a2 a1 - 2 ( - a0 ) a0 a1 = = + 6 12 ( 4 )( 3) ( 4 )( 3) We’ve got four a0’s and three a1’s. We’ve got all the a0’s that we need, but we still need one more a1’. So, we’ll need to do one more term it looks like. n=3 a5 = a2 - 2a3 a a a 1 æa a ö =- 0 - ç 0 - 1÷=- 0 + 1 20 10 è 6 3 ø 15 30 ( 5 )( 4 ) We’ve got five a0’s and four a1’s. We’ve got all the terms that we need. Now, all that we need to do is plug into our solution. ¥ y ( x ) = å an ( x + 2 ) n n =0 = a0 + a1 ( x + 2 ) + a2 ( x + 2 ) + a3 ( x + 2 ) + a4 ( x + 2 ) + a5 ( x + 2 ) + L 2 3 4 5 2 3 æa a ö = a0 + a1 ( x + 2 ) - a0 ( x + 2 ) + ç 0 - 1 ÷ ( x + 2 ) + è 6 3ø 4 5 æ a0 a1 ö æ a0 a1 ö ç 6 + 12 ÷ ( x + 2 ) + ç - 15 + 30 ÷ ( x + 2 ) + L è ø è ø Finally collect all the terms up with the same coefficient and factor out the coefficient to get, 1 1 1 2 3 4 5 ì ü y ( x ) = a0 í1 - ( x + 2 ) + ( x + 2 ) + ( x + 2 ) - ( x + 2 ) + Lý + 6 6 15 î þ 1 1 1 3 4 5 ì ü a1 í( x + 2 ) - ( x + 2 ) + ( x + 2 ) + ( x + 2 ) + Lý 3 12 30 î þ That’s the solution for this problem as far as we’re concerned. Notice that this solution looks nothing like the solution to the previous example. It’s the same differential equation, but changing x0 completely changed the solution. Let’s work one final problem. © 2007 Paul Dawkins 10 http://tutorial.math.lamar.edu/terms.aspx Differential Equations Example 4 Find the first four terms in each portion of the series solution around x0 = 0 for the following differential equation. (x 2 + 1) y¢¢ - 4 xy¢ + 6 y = 0 Solution We finally have a differential equation that doesn’t have a constant coefficient for the second derivative. p ( x ) = x2 + 1 p ( 0) = 1 ¹ 0 So x0 = 0 is an ordinary point for this differential equation. We first need the solution and its derivatives, ¥ ¥ y ( x ) = å an x n ¥ y¢ ( x ) = å nan x n -1 n =0 y¢¢ ( x ) = å n ( n - 1) an x n - 2 n =1 n=2 Plug these into the differential equation. (x 2 ¥ ¥ ¥ n=2 n =1 n =0 + 1) å n ( n - 1) an x n - 2 - 4 x å nan x n -1 + 6å an x n = 0 Now, break up the first term into two so we can multiply the coefficient into the series and multiply the coefficients of the second and third series in as well. ¥ ¥ ¥ ¥ n= 2 n=2 n =1 n =0 å n ( n - 1) an x n + å n ( n - 1) an x n-2 - å 4nan x n + å 6an x n = 0 We will only need to shift the second series down by two to get all the exponents the same in all the series. ¥ ¥ ¥ ¥ n= 2 n=0 n =1 n =0 å n ( n - 1) an x n + å ( n + 2 )( n + 1) an+2 x n - å 4nan x n + å 6an x n = 0 At this point we could strip out some terms to get all the series starting at n=2, but that’s actually more work than is needed. Let’s instead note that we could start the third series at n=0 if we wanted to because that term is just zero. Likewise the terms in the first series are zero for both n=1 and n=0 and so we could start that series at n=0. If we do this all the series will now start at n=0 and we can add them up without stripping terms out of any series. ¥ å éë n ( n - 1) a + ( n + 2 )( n + 1) a n+2 n n =0 ¥ å éë( n n=0 2 - 4nan + 6an ùû x n = 0 - 5n + 6 ) an + ( n + 2 )( n + 1) an+ 2 ùû x n = 0 ¥ å éë( n - 2 )( n - 3) a + ( n + 2 )( n + 1) a n=0 n Now set coefficients equal to zero. ( n - 2 )( n - 3) an + ( n + 2 )( n + 1) an + 2 = 0, © 2007 Paul Dawkins 11 n+ 2 ùû x n = 0 n = 0,1, 2,K http://tutorial.math.lamar.edu/terms.aspx Differential Equations Solving this gives, an + 2 = - ( n - 2 )( n - 3) an , ( n + 2 )( n + 1) n = 0,1, 2,K Now, we plug in values of n. n = 0: a2 = -3a0 1 a3 = - a1 3 0 a4 = - a2 = 0 12 0 a5 = - a3 = 0 20 n = 1: n = 2: n = 3: Now, from this point on all the coefficients are zero. In this case both of the series in the solution will terminate. This won’t always happen, and often only one of them will terminate. The solution in this case is, ì 1 ü y ( x ) = a0 {1 - 3 x 2 } + a1 í x - x3 ý î 3 þ © 2007 Paul Dawkins 12 http://tutorial.math.lamar.edu/terms.aspx