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
Rival and excludable goods
In this video, we’re going to do a bit of a deep dive in classifying different types of goods. Before we even get into the thick of things, I’m going to make some definitions. So the first definition is that of a rival good. Now, a rival good—one way to …
Dilution | Intermolecular forces and properties | AP Chemistry | Khan Academy
In this video, we’re going to talk about a concept in chemistry that’s quite important, known as dilutions. So let’s do an example. Let’s say we have a large vat, as much as we need. It’s a one molar solution of sodium sulfate, and it’s an aqueous soluti…
Homeroom with Sal & David Sinclair, PhD - Tuesday, July 14
Hi everyone! Welcome to our homeroom livestream. Very excited about the conversation we’re about to have. But I will start with my standard announcements, reminding everyone that we at Khan Academy we’re a 501c3. We’re a not-for-profit; we can only exist …
Wines for a Dragon Kevin O'Leary's Interview with Renowned Wine Expert Natalie MacLean
Kevin O is best known as the prickly Merchant of Truth on CBC’s Dragon Den as well as on ABC’s Shark Tank. He’s also built a software company that was acquired for more than $4 billion and now runs OIR Funds, an investment firm with assets of more than $1…
Graphing hundredths from 0 to 0.1 | Math | 4th grade | Khan Academy
Graph 0.04 on the number line. So here we have this number line that goes from 0 to 0.1, or 1⁄10. Between 0 and 1⁄10, we have 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 equal spaces. Each of these spaces represents 1⁄10 of the distance. It’s 1 out of 10 equal spaces,…
We fund smart founders, irrespective of what they want to work on.
What’s the percentage of companies you’ve backed right now that have large language models? I think for Summer ‘23 it was close to 50% of the batch. And it’s pretty interesting! Like, I think a lot of people see that number and they think, “Oh, YC must h…