If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Taylor & Maclaurin polynomials intro (part 1)

AP.CALC:
LIM‑8 (EU)
,
LIM‑8.A (LO)
,
LIM‑8.A.1 (EK)
,
LIM‑8.A.2 (EK)
,
LIM‑8.B (LO)
,
LIM‑8.B.1 (EK)
A Taylor series is a clever way to approximate any function as a polynomial with an infinite number of terms. Each term of the Taylor polynomial comes from the function's derivatives at a single point. Created by Sal Khan.

Want to join the conversation?

  • piceratops ultimate style avatar for user thiasJA
    How could we apply this to a real world case?
    (134 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Nicolas Soria
      Have you ever wondered how a calculator is able to give you a value for sine at any value, while you're stuck memorizing just the important ones? You can use this concept to do things like approximate trig functions like sine or cosine for any value. Computers can find the sum for a polynomial series with, say, 1000 terms in a snap and give an accurate approximation of that function. I find Taylor series to be very clever.
      (478 votes)
  • blobby green style avatar for user crisfusco
    Why is it that we use the factorial? I thought we would divide on the number of the grade so it would cancel later with the derivative :/
    Thank you!
    (48 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user Vu
      To answer your question succinctly, I'll rephrase your question:
      "Why is it that we use the factorial? I thought we would divide on the numberS of the gradeS so it would cancel later with the derivativeS :/ "
      We aren't taking one derivative, we're taking the Nth derivative of the highest-degree monomial, each time, the exponent would "come down" to the coefficient and cancel with whatever's down your denominator.

      For example, to get the third derivative of p(x), we need to take the derivative 3 times, each time the so-called "grade" comes down and becomes the coefficient of the derivative.
      p(x) = x^3
      p'''(x) = 3*2*1 = 6, not 3.
      Say we know f'''(x) = 1, how do we model p(x) so that p'''(x) = f'''(x) = 1?
      Exactly, we let p(x) = (1/6) * x^3, or generally, p(x) = (1/3!)*x^3
      (88 votes)
  • blobby green style avatar for user Gisela Cepeda
    this series have to be evaluated only in p(0) or can be calculated in any point of the graphic?
    (31 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user RichTry
    Why start taylor series by talking about maclauren series, it seems to add another condition ( centered around) which seem to complicate things when trying to understand the concept behind taylor series?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user jonthawk
      The video is entitled "Maclauren and Taylor Series INTUITION." I would argue that the purpose of the video isn't to give a rigorous introduction to Taylor series but rather to introduce a related but simpler concept. Thus the "Intuition." Starting with Maclauren gives people a conceptual foundation from which they can generalize.

      As to the contention that this is like teaching 1+0=1 to a first grader, the fact is that these videos are aimed at people with some degree of math background. Once you have the basic pattern it is easy for people familiar with graphs to perform a simple transformation on the Maclauren Series to get the Taylor Series.

      What is better to teach first: X^2 is a parabola or (x-a)^2+b is a parabola shifted a units horizontally and b units vertically? I would say the former.
      (96 votes)
  • blobby green style avatar for user melcor3
    what dose a 3rd derivative represent? the first derivative is the slope of the tangent line. the second derivative is the degree that the tangent line of one point differs from the tangent line of a point next to it. so is there any basis for having a third derivative other then using it in a Maclauren series?
    (11 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user RagnarG
      The way I think of it is;
      1st derivative: rate of change of the function. (which is equal to the slope in any given point on the graph)
      2nd derivative: rate of change of the 1st derivative. (which, when focused on a specific point, is equal to the changing rate of the slope in that point which is what you said)
      3rd derivative: rate of change of the 2nd derivative (I guess this would be the acceleration of the slope change in a point)
      4th derivative: rate of change of the 3rd derivative (and here I just give up trying to relate the derivatives to the original function)
      5th derivative: you guessed it - rate of change of the 4th derivative.

      And so on... To me it's just one of those things you simply have to accept that you can't rely on your visualisation skills to understand it. Like a 5-dimensional space, try imagining what that looks like. Still, it's not difficult to calculate the distance between two points in it for example, by just accepting the space as "a space where a point requires 5 coordinates to specify it's location".
      (30 votes)
  • blobby green style avatar for user dingo6541
    Why at do we use n! in the denominator instead of just the n. I understood up to the second derivative why we introduce 1/2 but then on the third it I do not understand why we have 1/3! as this is 1/6 and not 1/3 which means that it will not cancel out. I hope you understand my questions.
    Thank you very much for your help :)
    (11 votes)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user Sid
      For the second derivative, it's not 1 / 2 it's really 1 / 2!
      It's just that 2! happens to be equal to 2.

      The factorial works well for repeated differentiation:
      d/dx x^5 / 5! = x^4 / 4!
      d/dx x^4 / 4! = x^3 / 3!
      d/dx x^3 / 3! = x^2 / 2!
      d/dx x^2 / 2! = x / 1!
      d/dx x / 1! = 1 / 0!
      d/dx 1 / 0! = 0
      (9 votes)
  • blobby green style avatar for user Joshua Martin
    at about , Sal adds an "x" after f '(0). Why?
    (8 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user owahid2
      It's so p'(0) still equals f'(0) after he takes the derivative of his expression f(0)+f'(0)x. If the x wasn't there, then the f'(0) would end up equaling zero when he took the derivative, just as the f(0) did. Reviewing power rule may be helpful in clarifying this.
      (14 votes)
  • leaf green style avatar for user Kayalvizhi
    what is the difference between a polynomial and a function ? dont we write the function of x as a polynomial?
    (6 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user thesergcan
      If it is a polynomial, then it is a function. This is not true the other way around (If its a function, then it is a polynomial). However, the distinction Sal is trying to make in this video is that we can approximate a function using a talyor series which looks like a polynomial. The key here is that we can approximate functions such as sin(x) or cos(x), or ln(x). Clearly, these functions are not polynomials, but they can be written as a talyor series which when you "expand it" looks like a polynomial with x raised to some power, thus functions can be approximated to look like polynomial.

      I hope this distinction makes a little more sense.
      (9 votes)
  • blobby green style avatar for user Jenna
    At why is it (1/2) multiplied by (1/3)? According to Sal's logic from before, shouldn't it just have been (1/3)? I know there was an answer to this question later on, but I didn't understand at all from that... ><
    (4 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user ArDeeJ
      We want p´´´(c) to be equal to f´´´(c).
      Let's look at that one term.
      p(c) = terms + f´´´(c) * 1/(2*3) * x^3
      Let's look at its first derivative.
      p´(c) = terms + f´´´(c) * 1/(2*3) * 3 * x^2
      p´(c) = terms + f´´´(c) * 1/2 * x^2
      Let's take the second derivative.
      p´´(c) = term + f´´´(c) * 1/2 * 2 * x^1
      p´´(c) = term + f´´´(c) * x
      Then let's take the third derivative.
      p´´´(c) = f´´´(c) * 1 * x^0
      p´´´(c) = f´´´(c)

      You have to have both 1/2 and 1/3 so that the coefficients eventually cancel each other out.
      (7 votes)
  • winston default style avatar for user John Shahki
    Why are Taylor series so important and how can they help with representing series?
    (4 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user Just Keith
      Amongst other things, they are very good at modeling functions that are exceedingly difficult to work with or calculate. Suppose you were an engineer and you had to add 50 functions that were rather complicated. If it were the case that they all met the conditions for Maclaurin or Taylor, then you might elect to use Maclaurin or Taylor to be able to add them more practically.
      (6 votes)

Video transcript

I've draw an arbitrary function here. And what we're going to try to do is approximate this arbitrary function-- we don't know what it is-- using a polynomial. We'll keep adding terms to that polynomial. But to do this, we're going to assume that we can evaluate the function at 0, that it gives us some value, and that we can keep taking the derivative of the function and evaluating the first, the second, and the third derivative, so on and so forth, at 0 as well. So we're assuming that we know what f of 0 is. We're assuming that we know what f prime of 0 is. We're assuming that we know the second derivative at 0. We're assuming that we know the third derivative at 0. So maybe I'll write it-- third derivative. I'll just write f prime prime at 0, and so forth and so on. So let's think about 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 0. And if we have a constant term, we at least might want to make that constant polynomial-- it really is just a constant function-- equal the function at f of 0. So at first, maybe we just want p of 0, where p is the polynomial that we're going to construct, we want p of 0 to be equal to f of 0. So if we want to do that using a polynomial of only one term, of only one constant term, we can just set p of x is equal to f of 0. So if I were to graph it, it would look like this. It would just be a horizontal line at f of 0. And you could say, Sal, that's a horrible approximation. It only approximates the function at this point. Looks like we got lucky at a couple of other points, but it's really bad everywhere else. And now I would tell you, well, try to do any better using a horizontal line. At least we got it right at f of 0. So this is about as good as we can do with just a constant. And even though-- I just want to remind you-- this might not look like a constant, but we're assuming that given the function, we could evaluate it at 0 and that will just give us a number. So whatever number that was, we would put it right over here. We'd say p of x is equal to that number. It would just be a horizontal line right there at f of 0. But that obviously is not so great. So let's add some more constraints. Beyond the fact that we want p of 0 to be equal to f of 0, let's say that we also want p prime at 0 to be the same thing as f prime at 0. Let me do this in a new color. So we also want, in the new color, we also want-- that's not a new color. We also want p prime. We want the first derivative of our polynomial, when evaluated at 0, to be the same thing as the first derivative of the function when evaluated at 0. And we don't want to lose this right over here. So what if we set p of x as being equal to f of 0? So we're taking our old p of x, but now we're going to add another term so that the derivatives match up. Plus f prime of times x. So let's think about this a little bit. If we use this as our new polynomial, what happens? What is p is 0? p of 0 is going to be equal to-- you're going to have f of 0 plus whatever this f prime of 0 is times 0. If you put a 0 in for x, this term is just going to be 0. So you're going to be left with p of 0 is equal to f of 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 prime of x is equal to-- you take the derivative of this. This is just a constant, so its derivative is 0. The derivative of a coefficient times x is just going to be the coefficient. So it's going to be f prime of 0. So if you evaluate it at 0-- so p prime of 0. Or the derivative of our polynomial evaluated at 0-- I know it's a little weird because we're not using-- we're doing a p prime of x of f of 0 and all of this. But just remember, what's the variable, what's the constant, and hopefully, it'll make sense. So this is just obviously going to be f prime of 0. Its derivative is a constant value. This is a constant value right here. We're assuming that we can take the derivative of our function and evaluate that thing at 0 to give a constant value. So if p prime of x is equal to this constant value, obviously, p prime of x evaluated at 0 is going to be that value. But what's cool about this right here, this polynomial that has a 0 degree term and a first degree term, is now this polynomial is equal to our function at x is equal to 0. And it also has the same first derivative. It also has the same slope at x is equal to 0. So this thing will look, this new polynomial with two terms-- getting a little bit better-- it will look something like that. It will essentially have-- it'll look like a tangent line at f of 0, at x is equal to 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 that they have the same second derivative. And to try to have the same second derivative while still having the same first derivative and the same value at 0, let's try to do something interesting. Let's define p of x. So 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 of 0 plus f prime of 0 times x, so exactly what we did here. But now let me add another term. I'll do the other term in a new color. And I'm going to put a 1/2 out here. And hopefully it might make sense why I'm about to do this. Plus 1/2 times 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 1/2 is there. Because now let's evaluate this and its derivatives at 0. So if we evaluate p of 0, p of 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 squared are both going to be 0. So those terms are going to go away. So p of 0 is still equal to f of 0. If you take the derivative of p of x-- so let me take the derivative right here. I'll do it in yellow. So the derivative of my new p of x is going to be equal to-- so this term is going to go away. It's a constant term. It's going to be equal to f prime of 0. That's the coefficient on this. Plus-- this is the power rule right here-- 2 times 1/2 is just 1, plus f prime prime of 0 times x. Take the 2, multiply it times 1/2, and decrement that 2 right there. I think you now have a sense of why we put the 1/2 there. It's making it so that we don't end up with the 2 coefficient out front. Now what is p prime of 0? So let me write it right here. p prime of 0 is what? Well, this term right here is just going to be 0, so you're left with this constant value right over here. So it's going to be f prime of 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, or I should say the second derivative. So p prime prime of x is equal to-- this is a constant, so its derivative is 0. So you just take the coefficient on the second term is equal to f prime prime of 0. So what's the second derivative of p evaluated at 0? Well, it's just going to be this constant value. It's going to be f prime prime of 0. So notice, by adding this term, now, not only is our polynomial value the same thing as our function value at 0, its derivative at 0 is the same thing as the derivative of the function at 0. And its second derivative at 0 is the same thing as the second derivative of the function at 0. So we're getting pretty good at this. And you might guess that there's a pattern here. Every term we add, it'll allow us to set up the situation so that the n-th derivative of our approximation at 0 will be the same thing as the n-th derivative of our function at 0. So in general, if we wanted to keep doing this, if we had a lot of time on our hands and we wanted to just keep adding terms to our polynomial, we could-- and let me do this in a new color. Maybe I'll do it in a color I already used. We could make our polynomial approximation. So the first term, the constant term, will just be f of 0. Then the next term will be f prime of 0 times x. Then the next term will be f prime prime of 0 times 1/2 times x squared. I just rewrote that in a slightly different order. Then the next term, if we want to make their third derivative the same at 0, would be f prime prime prime of 0. The third derivative of the function at 0, times 1/2 times 1/3, so 1 over 2 times 3 times x to the third. And we can keep going. Maybe you 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. I could put a 4 up there, but this is really emphasizing-- it's the fourth derivative at 0 times 1 over-- and I'll change the order. Instead of writing it in increasing order, I'll write it as 4 times 3 times 2 times x to the fourth. And you can verify it for yourself. If we just had this only, and if you were to take the fourth derivative of this, evaluate it at 0, it'll be the same thing as the fourth derivative of the function evaluated at 0. And in general, you can keep adding terms where the n-th term will look like this. The n-th derivative of your function evaluated at 0 times x to the n over n factorial. Notice this is the same thing as 4 factorial. 4 factorial is equal to 4 times 3 times 2 times 1. You don't have to write the 1 there, but you could put it there. This right here is the same thing as 3 factorial-- 3 times 2 times 1. I didn't put the 1 there. This right here is the same thing as 2 factorial, 2 times 1. This is the same thing. We didn't write anything, but you could divide this by 1 factorial, which is the same thing as 1. And you can divide this by 0 factorial, which also happens to be 1. We won't have to study it too much over here. 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 it leads to 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-- is that when only the functions equal, you get that horizontal line. When you make the function equal 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 degrees, when you keep adding more and more terms, it gets closer and closer around, especially as you get close to x is equal to 0. But in theory, if you add an infinite number of terms, you shouldn't be able to do-- I haven't proven this to you, so that's why I'm saying that. I haven't proved it yet to you. But if you add an infinite number of terms, all of the derivatives should be the same. And then the function 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 bit more sense. And just so you know, the Maclaurin series is a special case of the Taylor series because we're centering it at 0. And when you're doing a Taylor series, you can pick any center point. We'll focus on the Maclaurin right now.