yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Worked example: estimating e_ using Lagrange error bound | AP Calculus BC | Khan Academy


5m read
·Nov 11, 2024

Estimating e to the 1.45 using a Taylor polynomial about x equal 2, what is the least degree of the polynomial that assures an error smaller than 0.001?

In general, if you see a situation like this where we're talking about approximating a function with a Taylor polynomial centered about some value and we want to know, well, how many terms do we need? What degree do we need to bound the error? That's a pretty good clue that we're going to be using the Lagrange error bound or Taylor's remainder theorem.

And just as a reminder of that, this is a review of Taylor's remainder theorem. It tells us that the absolute value of the remainder for the nth degree Taylor polynomial is going to be less than this business right over here. Now, n is the degree of our polynomial that we're in question, so that's the n. The x is the x value at which we are calculating that error; in this case, it's going to be this 1.45. And c is where our Taylor polynomial is centered.

But what about our M? Well, M is an upper bound on the absolute value of the (n + 1)th derivative of our function. That might seem like a mouthful, but when we actually work through the details of this example, it'll make it a little bit more concrete.

So for this particular thing we're trying to estimate, we're trying to estimate e to the x. So I could write f of x—let me write this this way—so f(x) is equal to e to the x, and we're trying to estimate f of 1.45.

And let's just, to get the bound here to figure out what M is, let's just remind ourselves that, well, the first derivative of this is going to be e to the x. The second derivative is going to be e to the x. The nth derivative is going to be e to the x. The (n + 1)th derivative is going to be e to the x. So the (n + 1)th derivative of f is going to be e to the x, which is convenient.

These types of problems are very, very hard if it's difficult to bound the (n + 1)th derivative. Well, this we know—we know that e to the x, and I could even say the absolute value of this, but this is going to be positive, is going to be less than or equal to, let's say, this is going to be less than or equal to e^2 for 0 < x ≤ 2. e to the x isn't bounded over the entire domain. For x going to infinity, e to the x will also go to infinity. But here I set up an interval. I've set up an interval that contains the x we care about.

Remember, the x we care about is 1.45, and it also contains where our function is centered. Our function is centered at 2, so we know we're bounded by e^2. So we can say we can use e^2 as our M. We can use e^2 as our M; we were able to establish this bound.

And so, doing that, we can now go straight to the Lagrange error bound. We can say that the remainder of our nth degree Taylor polynomial—we want to solve for n; we want to figure out what n gives us the appropriate bound evaluated at 1.45—when x is 1.45, is going to be less than or equal to the absolute value of our M, which is e^2 over (n + 1)! times (1.45 - 2) raised to the (n + 1) power.

Now, 1.45 - 2, that is -0.55, so let me just write that. So this is 0.55 to the (n + 1) power. And we want to figure out for what n is all of this business going to be less than 0.001? Let's do a little bit of algebraic manipulation here.

This term is positive; this is going to be positive; this right over here, or this part of it, not, it's not an independent term, but this e^2 is going to be positive, and (n + 1)! is going to be positive. The negative (0.55) to some power is going to flip between being positive or negative, but since we're taking the absolute value, we could write it this way.

We could write e^2 since we're taking the absolute value times (0.55) to the (n + 1) over (n + 1)! has to be less than 0.001. Or, since we want to solve for n, let's divide both sides by e^2, so we could write—let's find the n where (0.55)^(n + 1) over (n + 1)! is less than 0.001 over e^2.

Now, to play with this, we're going to have to use a calculator. Remember, we're from this point going to try larger and larger n's until we get an n that makes this true, and we want to find the smallest possible n that makes this true. But let's get out our calculator so that we can actually do this.

So first, I'm just going to figure out what is 0.001 divided by e^2. So make sure it's cleared out. So let's take e^2; I'm going to take its reciprocal and then I'm going to multiply that times 0.001.

So times 0.001 is equal to—so it's about, so I'll say, so it's three zeros, and this is a 10,000th and then 35, so it's three zeros, so I'll say 0.000136. So this needs to be less than 0.000123, and I'll say 0.000136; if I can find an n that is less than this, then I am in good shape.

Actually, let me say it's less than 0.000135. I want to be less than that value, then I can be, then I will be in good shape. This is a little bit more than 0.000135, but if I can find an n where that is less than this, then I'm in good shape.

So let me write this: (0.55)^(n + 1) over (n + 1)! So let's try out some n's, and I'm going to have to get my calculator out. So let's see, did I do that right? Yeah, 0.000135. If we get something below this, then we're in good shape, because this is even less than that.

All right, so let's do it. Let's see what this is equal to when—I don't know—when n is equal to 2. I could start at n equals 1, n equals 2, n equals 3, but the more n the further. If n equals 2 is good enough, then I might try n equal 1, but if n equals 2 isn't good enough, then I'm going to go to n equal 3 or n equal 4.

So let's start with—actually, let's just start with n equals 3. So if n equals 3, it's going to be (0.55)^4 divided by 4!. Let's see that. Let's do that. So (0.55)^4 is equal to—and then divided by 4! So divided by 4! is 24, so that's nowhere near low enough.

So let's try n equal 4. If n equals 4, then it's going to be this to the 5th power divided by 5!. So (0.55)^5 is equal to—and then divided by 5! is 120. Divided by 120 is equal to—that we're almost there with n equals 4. I'm guessing that n equals 5 will do the trick.

So for n equals 5, so let's clear this out. So for n equals 5, we're going to raise to the 6th power and divide by 6!. And so let's just remind ourselves what 6! is—720. I could have actually done that in my head, but anyway.

All right, so let's see—(0.55) to the—remember our n is 5, so we're going to raise to the 6th power—then we're going to divide by 720. Divided by 720 is equal to—and this number for sure is less than this number right over here. We got four zeros before this, three after the decimal; here we only have three.

So when n equals 5, it got us sufficiently low enough. This remainder is going to be sufficiently low; it's going to be less than this value right over here.

So what is the least degree of the polynomial that assures an error smaller than 0.001? The answer is 5. If n is 5, we're definitely going to be under this.

More Articles

View All
8 Key Principles To OVERCOME Self-Doubt & Negative Thoughts | Stoicism Insights
Every single one of us at some point in our lives faces that sneaky, undermining whisper of self-doubt. It’s like a shadow that lingers just out of sight, waiting to cloud our decisions and dampen our spirits. But here’s the catch. The real battle isn’t a…
Rebellion | Vocabulary | Khan Academy
Sound the drums of war, wordsmiths, because today I teach you about rebellion. Man, I’m a great influence! It’s a noun; it means war or pushback against a government or an authority, right? The American Revolutionary War began as a rebellion against the …
The Upcoming 2021 Real Estate Collapse Explained
What’s up you guys, it’s Graham here. So today we’re literally going to be talking about my favorite topic in the entire world. And I know you think this might be a setup for me to say, “And that topic is asking you to smash that like button for the YouTu…
1 in 5 vegetative patients is conscious. This neuroscientist finds them. | Big Think x Freethink
DR. ADRIAN OWEN: Imagine this scenario. You’ve unfortunately had a terrible accident. You’re lying in a hospital bed and you’re aware—you’re aware but you’re unable to respond, but the doctors and your relatives don’t know that. You have to lie there, lis…
Which Jobs Will Machines Take Over? Movie Critics, Doctors, Truckers... | Big Think
So machine intelligence includes two main areas. One is high-performance computing; all the chips you need to do the complex math required, and then artificial intelligence. Within artificial intelligence, all the breakthroughs are happening in the area o…
Do less, become happier, says Yale cognitive scientist | Laurie Santos
As someone who focuses on happiness a lot, I often hear from people who really wanna push themselves: “How can I be as happy as possible?” Or “How can I like, you know, perfect all the things that you talk about?” And this is true not just in the domain …