 Welcome back. We just had a long weekend, Easter weekend, and let's use the first few minutes of class today. This is lecture 52. I think we can finish 8.7 today, but it's going to be quite a task to finish it because we haven't looked at the error estimates for Taylor polynomials. But let's start with this, since we've had a few days away from this stuff. So we have generated, this is usually the first one, one of the easier ones to generate a Taylor series, or in this case a Maclaurin series because it's centered at x equals 0. It does converge for all values of x, which makes it nice. So we want e to the first, we put in 1 for x and do what it says to do there on the right side. If we were to write this out, other than the kind of the closed form, the sigma notation form and expanded form, what's the first term of e to the x? One. If you put in 0, it'd be x to the 0 over 0 factorial, so it's 1. Put Kelly on the spot, he just walked into class. Kelly, when n is equal to 1, what is the next term? X over 2. I like the x. How about just x? Does that work? Oh, that's mean and unfair. Just uncaring, right? Sorry. But I didn't call him homeboy, and homeboy just walked in. Let's ask him a question. That would have been uncaring. What's the next term? 2 factorial, which is just 2. We could come back and do that if we wanted to. Then we've kind of got the pattern going for the expanded form. So for any value of x, this is supposed to converge for all values of x. We haven't done this though, which is why I kind of wanted to start class with this today. Isn't the derivative of e to the x itself e to the x? So if this is true, this expanded form, which goes on forever, we ought to be able to take the derivative of the left side, which we think is e to the x, and we better get the same thing on the right side. When we take the derivative of this thing, we better get the same thing. It's kind of an odd function for that to take place anyway. But the question is, is the derivative of 1 plus x, is that still e to the x? Check it out. It better be. This function, however, we write it out. Expanded version, closed version, we better be able to get the derivative as itself. What's the derivative of 1? Derivative of x. It's starting out okay, isn't it? Derivative of x squared over 2 factorial. Well, we can bring the 1 over 2 factorial out in front, right? And the derivative of x squared is 2x? How we doing? Still okay? Bring the 1 over 3 factorial out in front. What's the derivative of x cubed? 3x squared. Let's get one more. 1 over 4 factorial. Derivative of x to the fourth. So we've got 1. 2 factorial is just 2, so they reduce. What about 3 over 3 factorial? 2 factorial in the denominator. And we've got x squared in the numerator. What about 4 over 4 factorial? 3 factorial. And we have an x cubed. It works, right? It is its own derivative. And you could take the derivative of this. Obviously, higher order derivatives, they're all going to be the same thing. So we can prove this by the definition of derivative with limits in x and h and all that stuff. But here's another way of validating that the derivative of e to the x is, in fact, itself. That pretty much does away with the question mark it is. Can we take the derivative in its closed form, the sigma notation version? So what should that be? We should have 1 over n factorial. That's all numerical, right? Derivative of x to the n is? n x to the n minus 1. What are we going to start in at? Could start it at 0, I think, and get away with it. But I think we've done kind of this process the whole way through. We know we're going to lose a term in the derivative. So we can get away with starting in at 1. And how about n over n factorial? So it's going to be n over n times n minus 1 times n minus 2 all the way back to 1. So the n's knock out, and what do we have in the denominator? And you may not like the form, but is that equivalent to what we started with? If we want to back it up, how do we kind of back it up and make it exactly equal to this particular version? Well, if we want to start it at 0, then when n is 1 here, we get what? 0 factorial. So if we're starting it at 0, we want this to just be n factorial, right? And if n is 1, this is x to the 1 minus 1, which is x to the 0. Now we're starting n at 0. We want this to be x to the n, which is exactly that, right? So you don't have to change it to make it equivalent. But if you want to show that it is exactly like what we started with, you can kind of back it up by 1 and write it in its original form. OK, we did the derivative of sine, right? Kind of the long way. Or we did, sorry, the Taylor series with higher order derivatives of sine. And we decided that sine of x was what? Well, let's generate it. OK, it's been a few days. Sine of x, is that an even or an odd function? Sine of x is an odd function. So we want odd powers of x and odd factorials. So x to the 1, that's an odd power and an odd factorial. We actually stopped there and we've got a fairly good approximation for the sine of pi over 6. If you want it kind of a visual of, we know that sine looks like this, roughly. So if we stopped there, we would have our T1, y equals x. Four values of x near 0 is this line, y equals x, x over 1 factorial. Is that pretty darn close to the curve itself? Four values near 0, these two are pretty close to each other. Obviously, they're very different from one another. We've got this oscillating function very, very different from this linear function. But for values near 0, let's say in this area, the curve, sine of x and the straight line, y equals x, are pretty close to each other. How can we make it better? We can make it better by generating more terms to the Taylor or McLaurin series. So what's the next term? So we've got our odd powers and odd factorials. Now, keep in mind that we really kind of have an old-fashioned alternating series, right? That we've got a positive, a negative, a positive. Keep that in mind when we examine the error associated with Taylor polynomials. So if we stop it at some point in time, we're going to have an error. Because the only way it's equal to the sine is to let it go on indefinitely. So I think we did that. I think we very quickly also took the derivative of this. Derivative of the left side is cosine. Derivative of the right side should then be this power series, this Taylor series for cosine. I think we did that. We decided that cosine was an even function. When you take derivatives of these terms, you get even powers of x and even factorials, right? I don't think we did this. So today is really kind of more of a fill in the gaps of things in 8.7 that we haven't done yet. So how do we describe this? Well, we just kind of decided that it's alternating. So let's get an alternating term in there. Negative one to differing powers based on n. I'm starting with n. I don't know that that's what I want to finish with. I can adjust it up or down one depending on whether I want to start with a positive or negative. But let's start with that. How about our powers? When we want to, let's go ahead and decide that we're going to put in n equals 0 for our first term. We're trying to generate x to the 1, but also keep in mind that for the next one, we want to generate n equals 3 and for the 1 after that, n equals, or the exponent is 5. Then it's 7. How do you make something jump up by 2? 2n, if you double something, you kind of force them to, but we don't want to just double them. We want to either go up one or down one. I think in this case if we go up one, so that generates the n equals 0 term. Twice 0 is 0 plus 1 is 1. That gives us that one for the first term. Then we get that increasing of 2 by doubling in and adding 1. So now if you put in n equals 1, you get 2 1's, which is 2, plus 1, which is 3, which is what we want, right? For the next term, for n equals 2, 2 2's is 4, plus 1 is 5, so that seems to get us the power. Very fortunately in this case, the power and the factorial are the same. So if the power is 2n plus 1, what's the factorial? 2n plus 1. 2n plus 1. And do we get the right signs, s-i-g-n signs, the way we have this negative 1 to the n? First term is positive, next second term is negative, so it does proceed like we want it to proceed. So let's leave that alone. If it didn't, we could adjust it up one or down one too. So does that seem to be kind of a closed form, a sigma notation form for the sine of x? Yes. Okay, I still think it's worth our time to do cosine. Now, I know we developed cosine by taking the derivative of this side and the derivative of this side. And we kind of said that looks like an even function. It seemed like it was doing what it was supposed to do. But let's take the time just so we get another one from start to finish. Let's say that our function is, this time, the cosine of x. And we want to use a Taylor, or in this case, McLauren series. The guy should spend a few days. I can't even remember how that goes. How does kind of a generic McLauren series go? What's in the numerator? All you homeboys and girls. What's in the numerator? No. For every, okay, the nth derivative of the original function evaluated at A. A, or in this case, A is zero. So we're going to use a McLauren series, okay? X minus A, or in this case, X minus zero, which is just X to the N in factorial. And if we wanted to center this, and we probably should do one of these today, this is going to be a catch all kind of day today. We should look at what a sine or cosine looks like that's not centered at zero. So we're going to need some derivatives. So we'll start with the so-called zero derivative, meaning we haven't taken the derivative at all. It's the original function. First derivative, derivative of cosine is derivative of negative sine. And derivative of negative cosine. Sine? In several of you put your pens or pencils down, because you know that what's going to happen beyond this point. It's going to repeat. So it repeats in these blocks of four. Derivative of sine is cosine. And we've got the same thing all over again. So when N is zero, we want the zero derivative, the original function at zero, X to the zero over zero factorial. When N is one, we want the first derivative at zero, X to the one over one factorial. We'll simplify these in a minute. When N is two, we want the second derivative at zero, X to the two over two factorial. When N is three, third derivative, X to the three over three factorial. We already know that we're going to lose the odd powers and the odd factorials, because we know cosine is an even function. We've already seen what it looks like, but I still think it's worth this process here of generating it ourselves. So the first term is what? What's cosine zero X to the zero over zero factorial? That's one. Negative sine of zero. I don't think we need to go any further with that one. What's negative sine of zero? It's zero. So we lose that term. When N is two, what's negative cosine of zero X squared over two factorial? And it's negative. Is that right? And if this works like the sine worked, we're going to lose every other term. The sine of zero is zero, and we would continue. So we should get this cyclical, at least set of coefficients. One, zero, negative one, zero, and that process should continue. We know we're going to have higher powers and higher factorials. So the first term is one. Now we know on the right side we've got to let this thing go forever for it to be an equation. So we know what the cosine looks like. Something like this. And we're really, at this point in time, only concerned as we work our way out to the right. What is the cosine like near X equals zero? Well, supposedly, the cosine of X is pretty close to the line Y equals one. For Y. They look like they are. Somewhere between here and here. Y equals one, which is not a very complicated function, just like the other one was Y equals X. That simple linear equation for values of X near zero is pretty close. Let's try it. So cosine of pi over 12. That's pretty small. It's near zero. Somebody use your calculator. Well, let's just see if we can walk through it without a calculator. So pi over 12 is half of pi over 6. Pi over 6 is the equivalent of 30 degrees. So pi over 12 is the equivalent of 15 degrees. Not a very common value. We should be fairly well-versed with 30s, 45s, and 60s, all those incremental values all the way around. But this is not one of them. So you might want to enter in 15 degrees on your calculator. What is the... According to this, it should be pretty close to one, right? 0.9659, am I remembering the right value? That's pretty close to one. So it didn't do a bad job as long as we're fairly close to X equals zero. But it's not one. We know that that's too much for those values, except this one value at X equals zero. So what do we have? We have minus. And hopefully we can see from the pattern that we established in the repetitive coefficients in blocks of four. And again, the thing that's handy to remember is that cosine is an even function. The first term might throw you off just a tad, but we've got even powers and even factorials. We could back up and say this is X to the zero over zero factorial, because zero is an even number as well, Nicole. Why wouldn't X to the four over four factorial? Why wouldn't that be negative two? Because we said that when n is three, then that's plus zero. So wouldn't the next one be negative? All right, let's analyze the coefficients. So the first coefficient when n was zero was one. Then we had a zero. Then we had a negative one. And then we had another zero. So there's our cycle. So when we get to the next one, we should be starting all over again, so we should have a positive one. Then to zero, then to negative one, then to zero. So even though we're losing every other term, and it's kind of hard to tell from this list, because we have a positive then to negatives, one of those is going to fall out. So we really are going to have a positive and then a negative. This one's going to fall out. It's going to alternate in that fashion. So if we wanted to approximate a cosine graph and stop at n equals two, so we're going to use a Taylor, or in this case a Maclaurin series, but we're going to stop it at n equals two. So we would be generating the n equals zero, the n equals one, and the n equals two terms, possibly three terms. So that's not necessarily the number of terms. We could potentially have three. But what are the first three terms? Well, the first term was one. The second term was zero. And the next term was... So there's T2. There's the Taylor or Maclaurin series having been truncated at n equals two. And in this case we only have two terms, but we could have potentially three. We lost one because its coefficient was zero. What's that? Our first approximation was kind of almost inane, that we could approximate this oscillatory curve with a straight horizontal line. It did okay for a while. What's this? Parabola that opens down. Right? Where does it open down from? Two. From one, right? So we go up to one, and then we've got this parabola that opens down. I don't know if you can visualize it. Probably not on my graph. But if we stop with T2, it looks something like that. Did it do a better job of approximating the cosine curve for a longer period of time? Yes, it did. And if you wanted to pick up the next couple of terms and get, well, I don't... I suppose we said T3. Is that any different? We stopped at n equals three. We're really going to miss the next term as well, so we'd have to go to T4, right? And if you want to see a nice way using animation in Maple in a time permitting this week I'll do this, is set this up and bring it in, look at a curve, sine or cosine would be as good as any, and look at the different Taylor polynomials and work your way out to the right and animate this to the point where it gets closer and closer and closer for a longer period of time, and you'll see the Taylor polynomials gradually getting closer and closer to the exact cosine or sine curve, which is itself a Taylor series. So I think we can see a little bit of that with these two. y equals one, okay, but not for very long. Here we've got this parabola that opens down, one unit up, it stays with the cosine curve a little bit longer. Did we do interval of convergence with sine or cosine? I know we did interval of convergence with e to the x. Did not do sine or cosine. Let's finish up this cosine and we'll just pick one and do an interval of convergence. So let's write it using the sigma notation. It was alternating. We want even powers and even factorials, it doesn't matter which we start with, we'll just, let's say, get the power and we'll use the same thing in the denominator. x to the 2n, that gives us what we want. When n is zero, it gives us zero, which is really, in a sense, doesn't appear. When n is one, we want the next term to actually reflect that it's even and we're going from x equal, excuse me, the power of zero to a power of two, so that seems to work and if that works, then that's going to be 2n factorial. We did derivatives to check. Let's do an integral here. We integrate this side with respect to x and integrate that side. What is the integral of the cosine of x? What has cosine for its derivative, sine of x? So how do we integrate this thing? Well, if it's negative, it's still negative and if it's positive, it's still positive when we integrate it, so we want that to stay the same. I had a question about that at the end of last class and I kind of had to rush out of here. Is that okay that nothing happens to that exponent because we want the sine to stay the same? If we integrate a negative, we want it to still be negative, differentiate a negative, you still want it to be negative. How's this work? We're integrating, so we want to add one to the power, right? How's that looking, by the way? Is that looking like we want it to look? I think that's looking like we want it to look and we would divide by, up the power by one, don't we divide by that and then we still have two-in factorial from the original denominator. So here's our integration. We add one to the power of x, we divide it by that new power. That's how we've integrated to this point in time in this class. Not about to change those things. We like the x to the two-in plus one. Can we rewrite the denominator? Isn't that two-in plus one factorial? This, if we wrote that out, would be two-in. What would be the next number in this product? And then two-in minus two and we'd go all the way back to one. And then we're multiplying that by two-in plus one. Is that really two-in plus one factorial? It is because we're going up one to get to the value to the left. We're going down one as we work our way to the right. So this is really two-in plus one and that's what we want it to be, right? Isn't that the sine power series or Taylor series or Maclaurin series that we generated earlier? I think it is. Too many ideas are flying through my mind this morning so I can get us to the point where I think we've hit everything we need to hit. I suppose we had this and then we'll do another example that is a little bit similar to this. So we know what the sine looks like as it kind of marches off to the right. Here's what it looks like. Now all we have to do is multiply each term by x squared. How easy can that be? Well, instead of the power each time being two-in plus one if we multiply every term as we march off to the right by x squared now they're no longer two-in plus one, they're two-in plus three and we're done. But we didn't do anything to the fact that it was positive or negative. We didn't do anything to the fact that we have two-in plus one factorial. All we did was multiply every term by x squared. So you can do that within the sigma notation or we can do kind of any arithmetic operations. Let's suppose, any questions about that because I'm going to take that one away to avoid a little clutter here. Let's suppose we had this problem. e to the x, we have a power series, Taylor-McLauren series for that. We want to subtract some things from that and then as we did in the previous example we multiplied everything by x squared. This time we want to divide everything by x squared. We want to see what happens to this as x approaches zero. If we let x be zero in the numerator, what do we get? Zero. We get zero and if x is zero in the denominator, what do we get? Zero. We get zero. So it is an indeterminate form, one of the kind of the standard indeterminate forms. It's zero over zero. We have a way of getting an answer to this. We could use L'Hopital's rule. In fact, let's do that but let's also back it up with kind of the new stuff in chapter eight. If we used L'Hopital's rule, derivative of e to the x, derivative of minus one and derivative of negative x. One. Negative one, derivative of x squared down here. Two. We're still in the same predicament. Still zero over zero. Derivative of the top, derivative of the bottom. Two. Now if we continued to use L'Hopital's rule we cannot expect to get the right answer. It only works for indeterminate forms. So I think we do have an answer now. Apparently the limit of this particular rational function as x approaches zero is one half. Now let's validate this another way, this time using series. So we have a series for e to the x. What does that look like? X to the n of r. Okay, and let's generate a few of those so we can basically knock out a couple of terms. What's the first term of kind of the expanded version of e to the x? e to the x is one. One. Here's what it is. Isn't it x to the n over n factorial? Is that right? From n equals zero to infinity. So x to the zero over zero factorial, there is that. X to the one over one factorial, which is just x. Okay, that's probably enough. What are we going to do from e to the x or our expanded version, our kind of a Taylor series version of e to the x? We're going to subtract one. Then we're going to subtract x. And then we're going to divide everything by x squared. Helping the numerator, what do you see that we can do? Well, we've got a one and then we've got a minus one. Let's just knock them out. We've got a minus x and a plus x. And then is it possible to take everything that remains in the numerator and divide it by x squared? What's x squared over two factorial divided by x squared? One over two factorial. So we're kind of losing two from the power, right? As we go, so the power in the numerator is two behind the factorial in the denominator. And as x approaches zero, well, the terms that have zero in them disappear and the terms that don't have zero in them remain. So what's the result? One half. So another way of getting the same answer without using this indeterminate forms, we never had any indeterminate forms here. We just subtracted those two terms, divided everything else by x squared. All the terms that have x in them go to zero. And we're left with one over two factorial, which is one half. I mean, handy on that. I don't know if this is enough time, but this is probably about the only thing that we haven't addressed. Oh, one more thing before we get to that. Let's suppose that we wanted to take a sine function. Not that you're going to have a lot of choice in that. Let's take a sine function, whether you want to or not. And let's do, instead of a Maclaurin series, which is centered at x equals zero, let's see what this would look like if we did a kind of a generic Taylor series centered at, I don't know, pi over three. So it's going to be a little odd because we've had this, although you have the repetition thing going on, we had some terms actually dropping out, right? Every other term was dropping out. I don't think we're going to find that to be the case because we're going to evaluate the derivatives instead of at zero. We're going to evaluate them at a, which in this case is pi over three. Instead of just x to the n, it's going to be x minus a to the n, considerably uglier but certainly possible. And what do we have down here? So we do need the derivatives. Derivative of sine is cosine. Derivative of cosine is negative sine. Derivative of negative sine is negative cosine, and we should be back to the start where we have sine. So with n equals zero, we get the original function at pi over three. Excuse me. Yes, n equals zero. Sorry, I thought I said that the a value of zero we're evaluating at pi over three. If we were evaluating at zero, we would lose this term, right? Because this would be sine of zero, which would not appear when we're done, x minus pi over three to the zero over zero factorial. First derivative at pi over three, x minus pi over three to the one over one factorial. Second derivative, third derivative. So we're not going to lose any terms here. So it is actually going to be equivalent to the simpler version had we centered it at zero. That's not necessarily a problem that you want to undertake, is showing that they are equivalent. But let's see what this looks like when we center it around another value other than zero. So sine of pi over three. Don't give me that trig look either. It's not valid on a Monday. What's the sine of pi over three? X minus pi over three to the zero. That doesn't appear zero factorial. There's our first term. Kind of different, right? Okay, what's the next term? Cosine of pi over three, one half. Gosh, no hesitation at all. I like that. X minus pi over three to the first over one. N equals two negative sine of pi over three. Negative cosine of pi over three. It's over three factorial. And we could continue clearly a very different look from having centered this at a equals zero. But it is equivalent to that function. Now how would you do this? You would distribute the one half to the two pieces here. You would square this. Multiply it by its coefficient. You can actually verify that they are in fact the same series. But it's just centered at a different value. Will centering it at a different value matter? I don't think we have done this yet. So let's set this up. We haven't done an interval of convergence yet, right? How do we do that? Ratio test. And let's not use this version. Let's use the simpler version. So for sine, sine is an odd function. So we want x to the two n plus one, right? That's guaranteed to be an odd number. If you double something and add one, it's going to be odd. So we want the limit. What do we put in the numerator of the ratio test? We're getting all kinds of things reviewed that we've... the n plus first term. So we can leave off the negative one, right? Because we're taking the absolute value. I'm just going to leave that off. So this would be... It's probably pretty good that we at least got this started today. What's the n plus first term? Instead of doubling in and adding one, we need to double n plus one and add one. Is that correct? Don't we always put... unless it's this type of term? I probably shouldn't say always. But negative one to the end, that's just the sine. Really mess with that because this is absolute value. But here, whatever we have done to n, we now want to do to n plus one. So what is x to the two times the quantity n plus one plus one? n plus three. Two n plus three. Does that seem right? That's how it should go when we get to the next term. We shouldn't go from two n plus one to two n plus two because two n plus two would be what? That'd be even. So we want to go to the next term, but we want it to be an odd term. So a way of getting from two n plus one to the next odd term would be go to skip two n plus two and go on to two n plus three. So that seems to be right. And what about the denominator? All right, let's just set up the denominator and we're going to be out of time and we'll just pick this up. As well as the error term, I thought for sure we'd get to that today, been running my mouth. Any guesses? Or interval of convergence? Converge is that a certain value only or converges for all values? All values? Okay, we'll see. We'll pick this up tomorrow at this point.