WEBVTT mathematics/calculus-ii/murray
00:00:00.000 --> 00:00:07.000
This is educator.com and we are here to talk about applications of Taylor Polynomials.
00:00:07.000 --> 00:00:20.000
The idea here is that we are going to write down some Taylor Polynomials, and plug in some values of x and we will see how close we get to the original function values.
00:00:20.000 --> 00:00:28.000
That will probably make some more sense after we study some examples, but I want to give you a couple of tests that we are going to be using to check how accurate we are.
00:00:28.000 --> 00:00:33.000
The first one is one that we have seen before, if you look back at the lecture on alternating series.
00:00:33.000 --> 00:00:37.000
We learned the alternating series error bound.
00:00:37.000 --> 00:00:59.000
What that said is that if you have a series that satisfies the conditions for the alternating series test, then if we just take a partial sum, as an estimate of the total sum, then our error can be positive or negative, but it is bounded by aN+1.
00:00:59.000 --> 00:01:08.000
In other words, the first term that we do not take, the first term that we cut off.
00:01:08.000 --> 00:01:14.000
So, if you are a little rusty on that, you might want to go back and look at the lecture on alternating series.
00:01:14.000 --> 00:01:18.000
That is where we did some practice with error bounds for alternating series.
00:01:18.000 --> 00:01:22.000
The second series we are going to use is a new one.
00:01:22.000 --> 00:01:23.000
It is called Taylor's Remainder Theorem.
00:01:23.000 --> 00:01:33.000
It says suppose you use the Taylor Polynomial t < font size="-6" > k < /font > (x) to estimate a function at a value of x near a.
00:01:33.000 --> 00:01:40.000
Then, it gives you this formula for the error but we have to break that down piece by piece because it is a little bit complicated.
00:01:40.000 --> 00:01:45.000
The first thing to look at is what is the m in this formula.
00:01:45.000 --> 00:01:50.000
What you do is you find the k+1 derivative of f.
00:01:50.000 --> 00:02:01.000
That is the k+1 derivative, and look at the interval between a and x, and you ask yourself, how big can that derivative get on that interval.
00:02:01.000 --> 00:02:06.000
In other words, how big can that derivative get.
00:02:06.000 --> 00:02:15.000
You find the maximum value, or at least an upper bound.
00:02:15.000 --> 00:02:17.000
You call that upper bound m.
00:02:17.000 --> 00:02:20.000
That is what the m is in this formula.
00:02:20.000 --> 00:02:28.000
Then the rest of the formula looks a lot like the original Taylor Formula.
00:02:28.000 --> 00:02:31.000
You have a k+1 factorial in the denominator.
00:02:31.000 --> 00:02:38.000
Remember, that k comes from the degree of the Taylor Polynomial that you are looking at.
00:02:38.000 --> 00:02:42.000
Then x-a^k+1.
00:02:42.000 --> 00:02:47.000
Again, the k is the degree of the Taylor Polynomial.
00:02:47.000 --> 00:02:54.000
The a is the coming from the center of the series, so that is that a right there.
00:02:54.000 --> 00:03:00.000
The x is the value that you are plugging in to use the Taylor Polynomial to guess the value of the function.
00:03:00.000 --> 00:03:03.000
So that comes from that x right there.
00:03:03.000 --> 00:03:08.000
That is all a little complicated, but it will probably be easier after we work out some examples.
00:03:08.000 --> 00:03:10.000
Let us move straight to some examples.
00:03:10.000 --> 00:03:18.000
The first one, we are going to use the Taylor Polynomial t₂(x) to estimate cos(1/2).
00:03:18.000 --> 00:03:24.000
The idea here is we are trying to work out cos(1/2) without a calculator or in fact...
00:03:24.000 --> 00:03:32.000
If you are a programmer, if you are writing the programs for calculators, you would be using Taylor Polynomials to work these values out.
00:03:32.000 --> 00:03:35.000
We are going to try to estimate the value of cos(1/2).
00:03:35.000 --> 00:03:42.000
Then we are going to give an error bound to say how accurate we are.
00:03:42.000 --> 00:03:50.000
We start out by remembering the Taylor Series for cos(x), which is one of those common ones we memorized.
00:03:50.000 --> 00:04:06.000
cos(x) = 1 - x²/2! + x⁴/4! - x⁶/6! ...
00:04:06.000 --> 00:04:17.000
So, t₂(x), that means we cut off the Taylor series at the degree 2 term.
00:04:17.000 --> 00:04:30.000
Because that is the degree 2 term, t₂(x) says we just look at 1 - x²/2!.
00:04:30.000 --> 00:04:37.000
So we cut off the series at the degree 2 term and that is the Taylor Polynomial.
00:04:37.000 --> 00:04:44.000
We are going to estimate cos(1/2) using the Taylor Polynomial, that is t₂(1/2).
00:04:44.000 --> 00:05:05.000
That is 1 - 1/2²/2, which is 1 - 1/4-2, which is 1 - 1/8. Which is 7/8. Which is 0.875.
00:05:05.000 --> 00:05:09.000
That is our estimate of cos(1/2).
00:05:09.000 --> 00:05:20.000
We think that cos(1/2) is approximately equal to 0.875.
00:05:20.000 --> 00:05:24.000
How do we know if that is an accurate estimate.
00:05:24.000 --> 00:05:31.000
Of course we could cheat and look at cos(1/2) on the calculator, but the whole point of this is to know how accurate we are without cheating.
00:05:31.000 --> 00:05:37.000
Because if we know what cos(1/2) was, we would not need the Taylor Polynomial in the first place.
00:05:37.000 --> 00:05:40.000
We want to give an error bound for the estimate.
00:05:40.000 --> 00:05:55.000
What we are going to do is look at this series and notice that it is an alternating series, because these terms alternate from positive to negative.
00:05:55.000 --> 00:06:05.000
So, we will use the alternating series error bound.
00:06:05.000 --> 00:06:15.000
Which says that the error is < or = the first term that we cut off.
00:06:15.000 --> 00:06:24.000
In this case that is x₄/4!, and we plug in 1/2 there.
00:06:24.000 --> 00:06:35.000
1/2₄/4!, so that is the cutoff term there, that is aN+1.
00:06:35.000 --> 00:06:52.000
That in turn, that is 4!, so this is 1/2₄ is 1/16, 1/16 × 24.
00:06:52.000 --> 00:06:55.000
Then we can just multiply that together.
00:06:55.000 --> 00:07:07.000
If you want a quick off the cuff estimate of that, I know that is certainly, 16 × 24 is way bigger than 100.
00:07:07.000 --> 00:07:26.000
So this is less than 1/100, considerably. 1/100 is 0.01, so our error is less than 0.01.
00:07:26.000 --> 00:07:42.000
Our estimate is accurate at the very least, to 2 decimal places.
00:07:42.000 --> 00:08:00.000
So, without checking on our calculator, I know that the cos(1/2) is approximately 0.875 and I know that my error there is definitely less than 0.01.
00:08:00.000 --> 00:08:08.000
In fact I can say that it is even less, but I know for sure that I am certainly accurate to 2 decimal places.
00:08:08.000 --> 00:08:20.000
In fact, if you check on a calculator, cos(1/2) = 0.87758.
00:08:20.000 --> 00:08:27.000
So, in fact we did get the first 2 decimal places right there in our estimation there.
00:08:27.000 --> 00:08:31.000
And that was without using a calculator at all, we knew that we were going to be right.
00:08:31.000 --> 00:08:38.000
So, to recap there, what we did there was we took the Taylor Series for cos(x),
00:08:38.000 --> 00:08:45.000
We cut it off at the degree 2 term to get the Taylor Polynomial for cos(x).
00:08:45.000 --> 00:08:50.000
We plugged in 1/2, we got a value for cos(1/2) or at least an approximate value.
00:08:50.000 --> 00:08:57.000
Then we noticed that the Taylor Series was an alternating series, so we could use the alternating series error bound.
00:08:57.000 --> 00:09:03.000
That says you look at the cutoff term, work that out to be less than 0.01.
00:09:03.000 --> 00:09:10.000
That tells us our error < 0.01.
00:09:10.000 --> 00:09:12.000
Let us try another application of Taylor Polynomials.
00:09:12.000 --> 00:09:21.000
Which is to do some integrals that would be very very difficult or even impossible without Taylor Polynomials.
00:09:21.000 --> 00:09:30.000
Here is an integral of essentially 1/ I will write it as 1+x⁵.
00:09:30.000 --> 00:09:35.000
That would be a really nasty integral to try to do without the use of Taylor Polynomials.
00:09:35.000 --> 00:09:45.000
If you look at some of the integration techniques we learned, they would not do you very well for 1/1+x⁵.
00:09:45.000 --> 00:09:53.000
Instead, we are going to notice that this is the same as 1/1-(-x⁵).
00:09:53.000 --> 00:09:56.000
That is the sum of the geometric series.
00:09:56.000 --> 00:10:10.000
We can write that as the sum from n=0 to infinity of (-x⁵)^n.
00:10:10.000 --> 00:10:18.000
Of course that is only for values of x within the radius of convergence.
00:10:18.000 --> 00:10:25.000
The radius of convergence of that geometric series is 1.
00:10:25.000 --> 00:10:35.000
So, we can write that as 1, now + -x⁵, so -x⁵.
00:10:35.000 --> 00:10:45.000
+ (-x⁵)², so + x^10 - x^15 and so on.
00:10:45.000 --> 00:10:50.000
That was just the function 1/1+x⁵.
00:10:50.000 --> 00:10:55.000
What we really want is the integral of all that.
00:10:55.000 --> 00:11:12.000
The integral of 1/1+x⁵ dx is the integral of 1-x⁵ + x^10 - x^15 and so on dx.
00:11:12.000 --> 00:11:30.000
I can integrate that just term by term so I get x - x⁶/6 + x^11/11 - x^16/16.
00:11:30.000 --> 00:11:37.000
By the way, I do not need to put the arbitrary constant on here because this is a definite integral.
00:11:37.000 --> 00:11:44.000
I am going to be plugging in the values of x here, so if I put an arbitrary constant on there,
00:11:44.000 --> 00:11:47.000
The values of the constant would just cancel each other off.
00:11:47.000 --> 00:11:59.000
What I am going to do, is evaluate this integral from 0 to 1/2 of 1/1+x⁵.
00:11:59.000 --> 00:12:13.000
That is 1/2 - (1/2)⁶/6 + 1/2^11/11 and so on.
00:12:13.000 --> 00:12:20.000
Now, I want to estimate what that series adds up to.
00:12:20.000 --> 00:12:28.000
I have already been told that I want to make sure it is accurate to three decimal places.
00:12:28.000 --> 00:12:30.000
I have got to make sure this thing is accurate to 3 decimal places.
00:12:30.000 --> 00:12:45.000
What I notice here is that this is an alternating series, so we are going to use the alternating series error estimation.
00:12:45.000 --> 00:13:05.000
We want, remember the alternating series says that the error is at most, whatever term we cut off, and we want that to be less than 0.001 because that was given to us in the problem.
00:13:05.000 --> 00:13:15.000
Let us just look at these terms and see if we can figure out which one will be less than 0.001.
00:13:15.000 --> 00:13:19.000
Obviously 1/2 is not less than 0.001.
00:13:19.000 --> 00:13:34.000
Next possible term is 1/2^11/6, which is the same as 1/ 2⁶ is 64 × 6.
00:13:34.000 --> 00:13:54.000
Now remember 0.001 is 1/1000, if we ask ourselves whether that is less than 1/1000 and 64 × 6 is not bigger than 1000, so this fails.
00:13:54.000 --> 00:14:02.000
Let us try the next term, 1/2^11/11.
00:14:02.000 --> 00:14:10.000
Now, that is 1 over 2^11 × 11.
00:14:10.000 --> 00:14:16.000
I know that 2^10 is about 1000, if you multiply out 2^10 it actually turns out to be 1024.
00:14:16.000 --> 00:14:27.000
So 2 ^11 × 11 is certainly bigger than 1000, so this is certainly less than 1/1000.
00:14:27.000 --> 00:14:34.000
So we have found the term that is less than 1/1000.
00:14:34.000 --> 00:14:41.000
That means that you can use this as the cutoff term.
00:14:41.000 --> 00:14:47.000
And just keep the rest of the series.
00:14:47.000 --> 00:14:50.000
Let us look at the rest of the series.
00:14:50.000 --> 00:15:08.000
1/2 - 1/2⁶/6 is, if we simplify that it is 1/2 - 1/64 × 6, as we figured out before.
00:15:08.000 --> 00:15:16.000
1/2 - 1/64 ×6 is 384.
00:15:16.000 --> 00:15:28.000
We can write 1/2 as 192/384 - 1/384.
00:15:28.000 --> 00:15:37.000
That simplifies down to 191/384.
00:15:37.000 --> 00:15:42.000
So, that is our estimate for the value of this integral.
00:15:42.000 --> 00:15:50.000
I know without even checking anywhere else that that answer is accurate to 3 decimal places.
00:15:50.000 --> 00:16:04.000
In fact if you put 191/384 into a calculator, it turns out to be 0.497396.
00:16:04.000 --> 00:16:22.000
And, if you put this integral into sophisticated integration software, you get the true answer approximates to 0.497439.
00:16:22.000 --> 00:16:28.000
So, if you look at those, in fact they do match up to the first three decimal places.
00:16:28.000 --> 00:16:36.000
They are not so far apart even in the next decimal place, so our answer really was accurate to within 0.001.
00:16:36.000 --> 00:16:43.000
Just to recap that example, we are trying to solve this integral but it is a really nasty integral.
00:16:43.000 --> 00:16:55.000
Instead what we did was we looked at the function, we managed to write it as a geometric series, then expand that into the terms of a Taylor Series.
00:16:55.000 --> 00:16:58.000
Then you can integrate those terms term by term.
00:16:58.000 --> 00:17:04.000
We get an answer and we plug in our values of x=1/2 and x=0.
00:17:04.000 --> 00:17:18.000
Then we get what turns out to be an alternating series, and so we try to find out what term could we cut off that would be less than our desired error of 1/1000.
00:17:18.000 --> 00:17:25.000
Turns out that this term is small enough, the previous term was not small enough, so this term is small enough.
00:17:25.000 --> 00:17:30.000
Then we can work out the rest of the series, the stuff before that, and get our answer.
00:17:30.000 --> 00:17:37.000
We know that is accurate to within 0.001.
00:17:37.000 --> 00:17:40.000
Let us try another example here.
00:17:40.000 --> 00:17:43.000
We want to find the Taylor Series for sqrt(x) around a=4.
00:17:43.000 --> 00:17:50.000
We are going to use that to estimate the sqrt(3.8) again to within 0.001.
00:17:50.000 --> 00:17:55.000
We want 3 decimal places of accuracy here.
00:17:55.000 --> 00:17:59.000
I am going to find my Taylor Series, I am just going to use the generic formula for Taylor Series.
00:17:59.000 --> 00:18:04.000
Make a little chart here, nth derivative of x,
00:18:04.000 --> 00:18:10.000
The nth derivative, now I am going to plug in the value a=4,
00:18:10.000 --> 00:18:21.000
The whole coefficient is obtained by taking that nth derivative and dividing by n!.
00:18:21.000 --> 00:18:25.000
So I am going to do this for several values of n.
00:18:25.000 --> 00:18:30.000
I am going to take it down to n=3 and we will see if that is enough.
00:18:30.000 --> 00:18:36.000
The 0th derivative just means you take the original function, sqrt(x).
00:18:36.000 --> 00:18:43.000
First derivative, if you think of that as x^1/2 we will write the derivative as 1/2 x^-1/2.
00:18:43.000 --> 00:18:50.000
Second derivative is 1/2 × -1/2 so that is -1/4 x^-3/2.
00:18:50.000 --> 00:19:04.000
The third derivative is -1/4 × -3/2, that is 3/8 x^-5/2.
00:19:04.000 --> 00:19:07.000
Now we plug in 4 to each one of those.
00:19:07.000 --> 00:19:13.000
Well sqrt(4) is just 2.
00:19:13.000 --> 00:19:25.000
Here we have 4^-1/2, so that is 1/sqrt(4) that is 1/2 × 1/2, so this is 1/4.
00:19:25.000 --> 00:19:37.000
x^-3/2, that is 4^3/2, that is 1/8 × -1/4 that is -1/32.
00:19:37.000 --> 00:19:41.000
x^-5/2, that is 4^5/2, sqrt(4) is 2, 2⁵ is 32, so we get 3/8 × 32,
00:19:41.000 --> 00:19:59.000
Which is 2⁵ × 2³, 2⁸ is 256.
00:19:59.000 --> 00:20:04.000
Then to get the full coefficients, we divide those numbers by the factorials.
00:20:04.000 --> 00:20:08.000
So, 2/0! is just 2.
00:20:08.000 --> 00:20:11.000
1/4/1! is just 1/4.
00:20:11.000 --> 00:20:20.000
-1/32/2!, 2! is just 2, so that is -1/64.
00:20:20.000 --> 00:20:45.000
3/256/3!, so that is divided by 6, the 3 and the 6 cancel, so you get 1/512.
00:20:45.000 --> 00:20:51.000
Those are our Taylor coefficients.
00:20:51.000 --> 00:21:01.000
We want to use the Taylor Remainder Theorem to estimate the error of this series.
00:21:01.000 --> 00:21:05.000
Let me remind you how the Taylor Remainder Theorem works.
00:21:05.000 --> 00:21:22.000
That said that the error is bounded by m/k+1! × x-a^k+1.
00:21:22.000 --> 00:21:26.000
There are a lot of things that we need to talk about here.
00:21:26.000 --> 00:21:32.000
Let us first of all, first of all we need to figure out what k we might want to use.
00:21:32.000 --> 00:21:42.000
This is just a guess at this point, so let us try, we are going to try k = 2.
00:21:42.000 --> 00:21:51.000
We will see if that makes the error small enough, so we will plug k=2 into this error formula and see what we get.
00:21:51.000 --> 00:22:02.000
Now, m, m comes from, remember, m comes from the maximum of that derivative.
00:22:02.000 --> 00:22:12.000
We look at the k+1 derivative, so that is f the third derivative because k=2 we are going to look at the third derivative of f.
00:22:12.000 --> 00:22:18.000
So the third derivative of f is, I am reading that here,
00:22:18.000 --> 00:22:30.000
That is 3/8/x^5/2.
00:22:30.000 --> 00:22:39.000
Now to get m, you have to look at that derivative and you have to look at it on the interval between x and a.
00:22:39.000 --> 00:22:47.000
Here, our x that we are interested in is 3.8. And a=4.
00:22:47.000 --> 00:22:55.000
We are looking at the interval between 3.8 and 4.
00:22:55.000 --> 00:23:02.000
We want to ask what is the maximum possible value of that derivative between 3.8 and 4.
00:23:02.000 --> 00:23:08.000
Well, we have got an x in the denominator here.
00:23:08.000 --> 00:23:15.000
So, that is going to be maximized when x is as small as possible.
00:23:15.000 --> 00:23:17.000
Let me write that down.
00:23:17.000 --> 00:23:25.000
This is maximized when x is as small as possible.
00:23:25.000 --> 00:23:41.000
In the interval 3.8 to 4, the value you want to plug in there is the smallest possible value, so that is 3.8.
00:23:41.000 --> 00:23:50.000
That is 3/8/3.8^5/2.
00:23:50.000 --> 00:23:59.000
OK, so I can write that as 3/8, now I do not want to work out 3.8^5/2.
00:23:59.000 --> 00:24:05.000
What I can tell you for sure though, is I am just going to give a very rough estimation.
00:24:05.000 --> 00:24:13.000
I know that 3.8 is way bigger than 1.
00:24:13.000 --> 00:24:27.000
I know that 3.8 in the denominator will be much smaller than 1^5/2, that is not 1 and 5/2, that is 1^5/2.
00:24:27.000 --> 00:24:37.000
This is because 3.8 is way bigger than 1, so in the denominator, 3.8^5/2 will be less than 1^5/2.
00:24:37.000 --> 00:24:46.000
So this is equal to, just simplifies down to 3/8.
00:24:46.000 --> 00:24:53.000
We are going to take m=3/8.
00:24:53.000 --> 00:25:08.000
Our error using this formula now, is less than or equal to 3/8, that is from m.
00:25:08.000 --> 00:25:14.000
k+1!, remember we said we were going to try k=2.
00:25:14.000 --> 00:25:25.000
So 2+1! is 3!, that is 3!. x-1, these are the values of x and a.
00:25:25.000 --> 00:25:37.000
So 3.8-4^k+1, so that is 3, because k=2.
00:25:37.000 --> 00:25:47.000
This simplifies down a bit to 3/8 × 6, because 3! is 6.
00:25:47.000 --> 00:26:00.000
Now 3.8-4 is -0.2, and the absolute value of that is just 0.2³.
00:26:00.000 --> 00:26:12.000
0.2³ is 0.008, over, the 3 and the 6 cancel, so we get 16.
00:26:12.000 --> 00:26:22.000
This gives us 0.008/16, which is 0.0005.
00:26:22.000 --> 00:26:32.000
The important thing here is 0.0005 is less than 0.001.
00:26:32.000 --> 00:26:38.000
OK, so let us keep going with this on the next page.
00:26:38.000 --> 00:26:44.000
What we did was we tried k=2.
00:26:44.000 --> 00:26:51.000
Then we looked at the error and we did a bunch of simplifications,
00:26:51.000 --> 00:26:55.000
But what we got was that it was less than 0.001.
00:26:55.000 --> 00:27:00.000
That worked OK, that was acceptable for the error tolerance that we were given.
00:27:00.000 --> 00:27:12.000
If that had not worked, I kind of pulled out k=2 seemingly randomly and that was actually because I worked out this problem ahead of time, of course.
00:27:12.000 --> 00:27:25.000
If that had not worked, if it does not work, You just try a bigger value of k.
00:27:25.000 --> 00:27:33.000
You just try k=3 or 4, just keep trying values of k until you get a value that works.
00:27:33.000 --> 00:27:35.000
In this case k=2 works.
00:27:35.000 --> 00:27:41.000
That means we have to find the Taylor Polynomial of degree 2.
00:27:41.000 --> 00:27:47.000
What I am going to do is remind you of those coefficients from the table on the previous page.
00:27:47.000 --> 00:27:56.000
That was 2, this was the c < font size="-6" > n < /font > , 2 and then 1/4, and then -1/64.
00:27:56.000 --> 00:28:01.000
1/5/12, that was the last part of the table from the previous page.
00:28:01.000 --> 00:28:10.000
t₂(x) means we read off these coefficients and we attach each one to a power of x.
00:28:10.000 --> 00:28:14.000
So, 2 × x⁰ is just 1.
00:28:14.000 --> 00:28:24.000
+ 1/4 ×, sorry not a power of x, but x-a, so that is x-4¹.
00:28:24.000 --> 00:28:39.000
We go up to the 2 term, so that is -1/64 × x-4², and then we cut if off there, because we are using k=2.
00:28:39.000 --> 00:28:49.000
Finally we want to estimate the sqrt(3.8), so we are going to plug 3.8 into t2(x).
00:28:49.000 --> 00:29:03.000
3.8 gives us 2+1/4, 3.8 - 4 = -0.2.
00:29:03.000 --> 00:29:12.000
-1/64 × -0.2².
00:29:12.000 --> 00:29:32.000
We can simplify that a little bit, this is 2 - 0.2/4, 0.2² is, sorry 0.04/64,
00:29:32.000 --> 00:29:45.000
At this point it is probably worthwhile to just put these numbers into a calculator. We get the estimate of 1.94937.
00:29:45.000 --> 00:29:55.000
That is our estimate for f(3/8), in other words sqrt(3.8).
00:29:55.000 --> 00:29:59.000
That was a lot of work for one problem, let me recap what we did there.
00:29:59.000 --> 00:30:04.000
First of all we wrote down the terms for the Taylor Series.
00:30:04.000 --> 00:30:20.000
Then we had to use Taylor's Remainder Formula, the error formula, to try to find where should we cut this series off, so that our error is less than 0.001.
00:30:20.000 --> 00:30:28.000
We kind of arbitrarily tried k=2, it turned out to work, but if it did not work we would try a different value of k,
00:30:28.000 --> 00:30:30.000
We worked out Taylor's Error formula.
00:30:30.000 --> 00:30:42.000
That involved finding the m term, the maximum value of the derivative, plugging in all the other terms to the error formula, and we get that it was less than 0.001.
00:30:42.000 --> 00:30:52.000
That tells us that we can use the Taylor Polynomial of degree 2, so we fill that in using these coefficients that we worked out.
00:30:52.000 --> 00:31:03.000
Then we used that Taylor Polynomial and we plug in our value of 3.8, and we work it down and find our answer for our estimate of 3.8.
00:31:03.000 --> 00:50:50.000
We will try some more examples of that later.