Maclaurin and Taylor Series Intuition Approximating a function at 0 using a polynomial
Maclaurin and Taylor Series Intuition
⇐ Use this menu to view and help create subtitles for this video in many different languages. You'll probably want to hide YouTube's captions if using these subtitles.
- I've drawn an arbitrary function here and what we're going to do is try to approximate this arbitrary
- function, we don't know what it is. Using a polynomial will keep on adding terms to that polynomial.
- But to do this we're going to assume that we can evaluate the function at zero that it gives us some
- value and that we can keep taking the derivative of the function and evaluating the first, the second,
- the third derivatives, so on and so forth at zero as well. So we're assuming that we know what F(0) is,
- we're assuming we know what F'(0) is, we're assuming that the second derivative of it is zero, we're
- assuming that we know the third derivative at zero. I'll write the third derivative as f prime prime at zero
- so forth and so on. So let's think of how we can approximate this using polynomials of ever increasing
- length. So we could have a polynomial of just one term. And it would just be a constant term. So this
- would be a polynomial of degree zero. And if we have a constant term, we at least want to might make that
- polynomial, it's just really a constant function, equal the function at F(0). So, at first maybe we just
- want P(0) where P is the polynomial that we want to construct. We want P(0) to be equal F(0).
- If we want to do that we can just set P(x) is equal to F(0).
- So if I were to graph it it will look like this. It will be just a horizontal line at F(0).
- And you can say Sal, that is a horrible approximation it only approximate at the function at this point
- Looks like we got lucky at a couple of other points but its really bad everywhere else
- And I will try to tell you try to do any better using a horizontal line
- at least we got it right at F(0) and this is just as good as we can do with just a constant.
- And even though this might not look like a constant we are assuming that given the function
- we can evaluate it at zero and that will just give us the number. So whatever number that was
- we would put right over here. And we would say P(x) is equal to that number. It will just be a horizontal
- line right there at F(0). But that is obviously not so great so lets add some more constraints.
- Beyond the fact that we want p(0) to be equal to f(0) lets say that we want also want p'(0) = f'(0)
- Let me do this in a new color. So we also want, in the new color, we also want, thats not a new color.
- We also want p', we want the first derivative of our polynomial while evaluated at zero to be the same
- thing as the first derivative of the function when evaluated at zero. And we don't wanna lose this right
- over here. So what if, what if we set p(x) as being equal to f(0), so we are taking our p(x) so we are
- going to add another term so the derivatives match up. Plus f'(0) times x. So lets think about this a
- little bit, so if we use this as our new polynomial what happens? p(0) what is p(0)? p(0) is going to
- be equal to, you're going to have f(0) + whatever this f prime (0) times zero. If you put a zero in for
- x this term is going just to be zero. So you're going to be left with p(0) = f(0). That's cool ;)
- That's just as good as our first version. Now what's the derivative over here?
- So the derivative is p'(x) =, take the derivative of this, and this is just a constant so its
- derivative is zero. And the derivative of a coefficient times x is going to be the coefficient.
- So its going to be f'(0). So if you evaluate it at zero so p' of zero or the derivative
- of our polynomial evaluated at zero. I know its a little weird because we are not using
- you know, we're doing, oh, p'(x), f'(0), but just remember, what's the variable
- what's the constant, and hopefully it'll make sense. So this is, obviously, going to be f'(0). Its derivative
- is a constant value. This is a constant value right here. We're assuming we can take the derivative
- of our function and evaluate that thing at 0 to give a constant value. So, if p'(x) is equal
- to this constant value then, obviously, p'(x) evaluated at 0 is going to be that value.
- But what's cool about this right here, this polynomial that has a zero-degree term
- and a first-degree term, is now, this polynomial is equal to our function at x = 0
- and it also has the same first derivative. It also has the same slope at x = 0 !
- So this thing will look, this new polynomial with two terms is getting a little bit better.
- It will look something like that. It will
- essentially have, it'll look like a tangent line at f(0), at x = 0. So, we're doing better,
- but still, not a super good approximation. It kind of is going in the same general direction
- as our function around 0, but maybe we can do better by making sure they have
- the same second derivative. And to try to have the same second derivative while
- still having the same first derivate and the same value at 0, let's try to do something interesting.
- Let's define p(x), let's make it clear, this was our first try.
- This is our second try, right over here, and I'm about to embark on our third try.
- So, in our third try, my goal is that the value of my polynomial is the same
- as the value of the function at 0, they have the same derivative at 0,
- and they also have the same second derivative at 0. So let's define my polynomial
- to be equal to, so I'm going to do the first two terms of these guys right over here.
- So it's going to be, f(0) plus f'(0) times x.
- So, exactly what we did here, but now let me add another term.
- I'll do the other term in another color. Plus, I'm going to be a one-half out here,
- and hopefully it might make sense why I'm about to do this.
- Plus one-half times f the second derivative of our function evaluated at 0 x squared.
- And when we evaluate the derivative of this, I think you'll see why this one-half is there.
- Because now, let's evaluate this and its derivatives at 0. So, if we evalute p(0),
- p(0) is going to be equal to what? Well, you have this constant term,
- if you evaluate it at 0, this x and this x^2 are both going to be 0, so
- those terms are going to go away. So p(0) is still equal to f(0).
- If you take the derivative of p(x), so let me take the derivative right here, I'll do it in yellow.
- So the derivative of my new p(x) is going to be equal to, so this term's going to go away,
- it's a constant term, it's going to be equal to f'(0), that's the coefficient on this,
- plus, this is the power rule right here, two times one-half
- is just one, plus f''(0) times x. Take the two, multiply it by one-half, and decrement that two right
- there. And I think you now have a sense of why we put the one-half there.
- it's making it so that we don't end up with a two coefficient out front.
- Now, what is p'(0)? p'(0) is what?
- Well, this term right here is going to be 0, so you're left with this constant value right here.
- So it's going to be f'(0). So, so far our third generation polynomial has all the properties
- of the first two. And let's see how it does on its third derivative.
- So, let's see, I should say, the second derivative. p''(x) is equal to,
- this is a constant, so it's derivative is 0, so then you just take the coefficient
- on this second term, is equal to f''(0). So what's the second derivative of p
- evaluated at 0? Well, it's just going to be this constant value, f''(0).
- So notice, by adding this term, not only is the polynomial value the same thing as our
- function value at 0, its derivative at 0 is the same thing as the derivative of our function at 0,
- and its second derivative at 0 is the same thing as the second derivative of the function at 0.
- And you might guess there's a pattern here – every term we add it'll allow us
- to set up the situation so that the nth derivative of our approximation at 0 will be the same thing
- as the nth derivative of our function at 0. So, in general, if we wanted to keep doing this,
- if we wanted to keep adding terms to our polynomial, we could, let me do this in a new color,
- we could make our polynomial approximation, so the first term will just be f(0),
- and the next term will be f'(0) times x. Then the next term will be f''() times one-half times x^2.
- Then the next term, if we want to make their third derivatives the same at 0, would be
- f'''(0), the third derivative of the function at 0, times one-half times one-third times x^3.
- And we can keep going, maybe you'll start to see a pattern here.
- Plus, if we want to make their fourth derivatives at 0 coincide, it would be
- the fourth derivative of the function, it's the fourth derivative at 0 times
- one over four times three times two, times x^4. And you can verify for yourself,
- If we had this only, and if you were to take the fourth derivative of this at 0,
- it would be the same thing as the fourth derivative of the function at 0.
- And in general, you can keep adding terms, where the nth term will look this:
- The nth derivative of your function evaluated at 0, times x^n over n factorial.
- Notice, this is the same thing as four factorial - four factorial is 4*3*2*1.
- This, right here, is three factorial, 3*2*1, this right here is two factorial, 2*1.
- This is the same thing as one factorial, the same thing as one.
- And you could divide this by zero factorial, which also happens to be one,
- but this general series, that I've kind of set up right here, is called the Maclaurin series.
- And you can approximate a polynomial and we'll see some pretty powerful results later on.
- But, what happens, and I don't have the computing power in my brain to draw the graph properly,
- when only the function is equal, you get that horizontal line. When you make the functions
- and, when you make the function equal at 0, and their first derivatives equal at 0, then you have
- something that looks like the tangent line. When you add another degree, it might approximate
- the polynomial something like this. When you add another degree, it might look something like that.
- And, as you keep adding more and more terms, it gets closer and closer around, especially
- as you get close to x = 0, but in theory, if you add an infinite number of terms,
- I haven't proven this to you, so that's why I'm saying it's in theory, but if you add an infinite
- number of terms, it should be, all of the derivatives should be the same, and then
- the functions should pretty much look like each other.
- In the next video, I'll do this with some actual functions, just so it makes a little more sense.
- And, just so you know, the Maclaurin series is a special case of the Taylor series, since we're
- centering it at 0. And when you're doing a Taylor series, you can pick any center point,
Be specific, and indicate a time in the video:
At 5:31, how is the moon large enough to block the sun? Isn't the sun way larger?
Have something that's not a question about this content?
This discussion area is not meant for answering homework questions.
Share a tip
When naming a variable, it is okay to use most letters, but some are reserved, like 'e', which represents the value 2.7831...
Have something that's not a tip or feedback about this content?
This discussion area is not meant for answering homework questions.
Discuss the site
For general discussions about Khan Academy, visit our Reddit discussion page.
Flag inappropriate posts
Here are posts to avoid making. If you do encounter them, flag them for attention from our Guardians.
- disrespectful or offensive
- an advertisement
- low quality
- not about the video topic
- soliciting votes or seeking badges
- a homework question
- a duplicate answer
- repeatedly making the same post
- a tip or feedback in Questions
- a question in Tips & Feedback
- an answer that should be its own question
about the site