[MUSIC] In the next two lectures, I want to show you another technique for solving linear differential equations, and it's called the method of series solutions. We're going to start with a very simple differential equation, that hopefully, most of you by now can solve it by inspection. We're looking at y double prime plus y equals 0. Here I'm going to view y as a function of x. So if after taking a calculus course, if you were given this equation to solve, you should be able to realize that, which function when you take its derivative twice you get back the negative of itself? You only know two functions of that type, cosine x and sine x. So the general solution of this equation should be a constant times cosine x, plus another constant times sine x. Okay, a very simple equation. [COUGH] We're going to use this as a model just to show you the method of series solutions, since we know what the answer is supposed to be. And then in the next video, we'll tackle a non-constant coefficient equation. Up to this point, we only know how to solve the constant coefficient equations. So we'll learn how to solve a non-constant coefficient equation by the method of series solution. Okay, so how do you solve a differential equation using a series solution? Well, you try an ansatz which is a series solution. So here is our ansatz. We try y(x) equals a sum from n=0 to infinity of a sub n times x to the n. If you're not familiar with the summation notation, this means a0 plus a1 times x plus a2 times x squared plus a3 times x cubed, etc. This is a power series. You can view this either as a power series, or as a Taylor series of the solution. It's the same thing. So we need to substitute that into the differential equation, which means we need to take a second derivative of the series. You can do that term by term. So if you substitute n, you get the summation. And taking the derivative, you get n times n-1 times a sub n times x to the n-2. The n=0 and then the n=1 term is 0 here. So we can take from n=2 to infinity plus y, which will be the sum from n=0 to infinity a sub n x to the n. And that's supposed to be equal to 0. Okay, how do you proceed then, once you substitute the series into the differential equation? The main idea is that you want to write this left-hand side as one power series. So you want to write this left-hand side as some coefficient b0 plus b1 times x plus b2 times x squared plus dot, dot, dot, and have that equal to 0. Then you're able to say that b0 equals 0, b1 equals 0, b2 equals 0, every coefficient is 0. The theorem there is that if you have a power series equal to 0, then the coefficients of every power of x must be 0. Many students prove that in a calculus course. The simplest way to prove that is you set x equal to 0. And then you take the first derivative and set x equal to 0, the second derivative and set x equal to 0. And you get that all the coefficients are 0. So how do we write this as a single power series? Now, the difficulty here is we have an x to the n-2, and an x to the n. So we would like to raise up this exponent to x to the n. So with this first term, we would like to write it as x to the n. How do we do that? Well, here at n=2, it starts at x0. So then here it should start at x0, so it should be n=0 to infinity. And then when n=2, we have a sub 2 here. So when n=0, we're supposed to have a sub 2. So we need to raise up n by 2. And everywhere there's an n, we have to add 2 to it. So we have n plus 2 minus 1, is n plus 1. And then n becomes n+2, okay? So we need to, this is called shifting the index of the power series. So n=2 to infinity becomes n=0 to infinity. And anywhere there's an n, we go n+2. And that, plus the sum from n=0 to infinity a sub n x of n, and that's 0. Now every term in theses series match, right? The n=0 term is the constant. The n=1 term is the linear term. So we can combine these series into one series. And we can write this then as the sum from n=0 to infinity. And then we have (n + 2) (n + 1) a sub n+2 plus a sub n. And they're all multiplying x of n equals to 0. That's our single power series. This is our b, right? So we have b0 plus b1 x plus b2 x squared. Since that power series is equal to 0, all those b's are 0. Therefore, this is 0. That's considered the, we can write this coefficient as 0. I will write it in a very special way. I can write that as a sub n+2 equals to -a sub n divided by (n + 2)(n + 1). This is called a recursion relation, so this is the recursion relation. Right, so we get from this term here, we get the recursion, Relation. Okay, that tells us what a sub n+2 is, once we know what a sub n is. We need to start somehow. So remember that the second order linear differential equation has to have two initial values. We need to know y of 0, and we need to know y prime of 0. So any solution we get here must have two free constants, right, two free constants to satisfy the two initial conditions. Here, we need to start this recursion relation somewhere. So we can start with n=0, so then a0 becomes the free constant. And this recursion relation will give us a2, a4, a6, etc. Or we can start with a1, n=1. And this recursion relation will give us a3, a5, and so on. So let's see what those values are. So let's start with a0, so we'll start with a0. And then put n=0, so we get a1, a2. Sorry, put n=0, so the right-hand will be 0 plus 2, will be a sub 2. That will be equal to minus a0 over 2 times 1, right? And then we put in n=2, that will give us a sub 4. 2 plus 2 is 4. That will be -a sub 2 over 4 times 3. And then we use our a sub 2 is -a0 over 2 times 1. So that will become a0 over 4 times 3 times 2 times 1, is 4 factorial. And then the a6, we can do one more. That will be -a4, n equals 4, over 6 times 5. We use a4 here, so it will be +a0, right? -a4, sorry. a6 is -a4 over 6 times 5. So that will be minus, a0 divided by 6 times 5 times 4 factorial, which is 6 factorial. Okay, so this is the first sequence we get from the recursion relation, a0, a2, a4, and a6. The next sequence will be the odd ones. So we start with n=1, that will be a1. Then we'll get a3. So a3 is equal to -a1 over 3 times 2. Then we get a5, for n equals 3 will give us a5. So we have a5 is equal to -n equals 3, a3 over 5 times 4. Which will be minus. Minus will be +a1 over 5 factorial, and so on. We can go up to a7, if we like. Here a7 will simply be -a1 over 7 factorial. Okay, putting the whole thing together, what have we got? Our ansatz, remember, is y(x) equals the sum from n=0 to infinity a sub n x to the n. This power series splits up into two power series, the one for even powers of n and the one for odd powers of n. So if we write that, we have y(x). The power series for even powers of n, all the terms have an a0. The first term would be a 1, which is the constant term. The second term is +a2 times x squared, which is -a0 times -x squared over 2. But we can write that as 2 factorial. The next term is +a4 times x to the 4th, which will be +x to the 4th over 4 factorial. And then -x to the 6th over 6 factorial plus, okay? The odd series, sorry, to that we add the odd terms. This is the even terms. So to the even terms, we add the odd terms. Starts with a1, so +a1. That's a1 times x, right? The n=1 term is a1 times x. And then a3 is -a1 over 3 times 2, is 3 factorial. So that's the a3 x cubed, so -x cubed over 3 factorial. a5, +a1 over 5 factorial, x to the 5th over 5 factorial minus x to the 7th over 7 factorial. Okay, so we have these two independent power series. But you should know what this is. 1 minus x squared over 2 factorial plus x to the 4th over 4 factorial, that's cosine x. And x minus x cubed over 3 factorial plus x to the 5th over 5 factorial, that's sine x. Okay, our two Taylor series, one for cosine x and one for sine x. So let me summarize what I'm doing here. We start with a very almost trivial differential equation, y double prime plus y equals 0. You should know from calculus that there are two solutions, a constant times cosine x and a constant times sine x. We're trying to find those solutions by a power series ansatz. y(x) equals n=0 to infinity a sub n times x to the n. The a's are the unknown coefficients. We take the derivative term by term, and substitute into the differential equation. The idea is to write that as a single power series, so that we can set the coefficients equal to 0. When we do that, we should get a recursion relation. This is the recursion relation, and then we should get two sequences of coefficients. So we need to have two unknown coefficients, two free parameters in order to satisfy two initial conditions. So in this case and in most cases, the two free parameters will be a0 and a1. And then we can get the other coefficients in terms of those two free parameters. For this simple example I showed you, we got the Taylor series for cosine and the Taylor series for sine. In the next video, we'll tackle a non-constant coefficient equation called the Aries equation, one that you cannot guess the solution. I'm Jeff Chasnov. Thanks for watching, and I'll see you in the next video.