Current time:0:00Total duration:8:01

# Worked example: power series from cos(x)

## Video transcript

- [Voiceover] Let's see if we can find the Maclaurin series
representation of f of x, where f of x is equal to x to the third times cosine of x squared. I encourage you to pause the
video and now try to do it. Remember, the Maclaurin series is just the Taylor series centered at zero. Let's say our goal here is
the first five non-zero terms of the Maclaurin series representation, or Maclaurin series approximation of this. I'm assuming you had paused the video and you had attempted to do this. There's a good chance
that you might have gotten quite frustrated when you did this, because in order to find a
Taylor series, Maclaurin series, we need to find the
derivatives of this function, and as soon as you start to do that, it starts to get painful. F prime of x is going to be, let's see, product rule, so it's three x squared
times cosine of x squared plus x to the third times the derivative of this thing, which is going to be two x
times negative sine of x, negative sine of x squared. Just that was be pretty painful. But it's only going to
get more and more painful as we take the second and
third and fourth derivative. We might have to take more, because some of these terms
might end up being zeros. We want the first five non-zero terms. The second derivative, this
is going to be painful. This is going to be painful. Then the third and fourth derivatives are going to be even more painful. So what do we do here? You could just do this. Let's evaluate them each at zero, and then use those for our coefficients, but you're probably guessing correctly that there's an easier way to do this. I will give you a hint. We know what the Maclaurin
series for cosine of x is. We've done that in the previous video. If you want to see that
again, there's another video. Look up "cosine Taylor series
at zero" on Khan Academy, and you'll find that. But we already know from that, and this is one of the most
famous Maclaurin series, we know that this is a g of x. We say g of x is equal to cosine of x. Well, we know how this, what this is like. There are the Maclaurin
series approximation of that is going to be one minus x squared over two factorial, plus x to the fourth over four factorial, minus x to the sixth over six factorial, plus, and I could keep
going on and on and on. You kind of see where this is going. Plus x to the eighth over eight factorial, and it just keeps going, minus, plus, on and on and on and on. But we wanted first five
terms, so this is a start. I know we wanted the first
five terms of this thing, but bear with me. We'll see how this thing right over here is going to be useful. Now that I've given you a
little bit of a reminder on the Maclaurin series
representation of cosine of x, my hint to you is, can we use this to find the Maclaurin series
representation of this, right up here? Remember, all this is, this
is x to the third times ... And I'm just rereading it for you, this is x to the third
times g of x squared. That's a sizable hint. I encourage you to pause the video again and see if you can work through this. Let me rewrite. I'm assuming you had a go at it. Let me rewrite what I just wrote. I just told you that g of x ... or f of x. F of x ... If I wanted to write it as, I guess you could say as a function, or if I want to construct it using g of x, I could rewrite it as x
to the third times ... instead of cosine of x squared, that's the same thing as g of x squared. So x to the third times g, g of x squared. G of x squared. G of x is just cosine. G of x squared is going
to be cosine of x squared. Then you're going to multiply
that times x to the third. Well, can't we just apply this
insight to the approximation? You might be asking that question. My answer to you is,
"Yes, you absolutely can." Notice, when you substitute
your xes for x squared, you'll just get another polynomial. And if you multiply
that by x to the third, you're just going to
get another polynomial. That actually will be the
Maclaurin series representation of what we started off with. We actually will get the
Maclaurin series representation of this thing right over here. So we could say that f of x is approximately equal to x to the third times x to the third times ... Let me get myself some
space right over here. G of x squared. Over here, this is
approximation for g of x, and if we kept going on and on forever, it would be a representation of g of x. So every place where we see an x, let's replace it with an x squared. This is going to be one minus ... So x squared squared is x to the fourth, x to the fourth over two factorial, which is really just two, but I like to put the factorial there because you see the pattern. Plus, if our x is now x squared, x squared to the fourth
power is x to the eighth, x to the eighth power over four factorial, minus x squared to the sixth power is x to the 12th over six factorial, and then plus x squared to the eighth is x to the 16th power
over eight factorial, and of course, we can keep
going on and on and on. Minus, plus. But we just care
about the first five terms, the non-zero terms, and we're just saying this is an approximation, anyway. So we can say that this is going to be approximately equal to, we distribute the x to the third, and I'm going to do it
in magenta just for fun, so distribute the x to the third, we get x to the third, minus x to the seventh over two factorial, plus x to the 11th over four factorial, minus x to the 15th over six factorial, plus x to the 19th ... x to the 19th over eight factorial. That's the first five non-zero terms, and we are done. When you actually see what we got, you realize it would have
taken you forever to do this by, I guess you could say, by brute force, because you would have had
to find the 19th derivative of all of this madness. But when you realize that, "Hey, gee, "if I can just re-express this function "as, essentially, "x to a power times "something that I know
the Maclaurin series of, "especially ..." Well, if you view it this way: if I can write, if I can rewrite ... Let me say it in a less confusing way. If I can rewrite my function so it is equal to some ... Actually, I can even
throw a coefficient here. If it's equal to some A x to the n power, times some function ... Let me just use a new color. Times, purple. Times g of B, B x to some other power, where I can fairly easily, without too much computation, maybe I already know, if I know the Maclaurin series
representation of g of x, if I know what g of x is going to be, then I can do exactly what
I did just in this video. I find the Maclaurin series
representation for g, every place where I saw an x, I replaced it with what I have over here, the B x to the m power,
where m is some exponent. That will give me another polynomial, another power series, and then I multiply it time A x to the n, and that's going to, once again, give me another power series, and that will be the power
series for my original function. Very exciting.