WEBVTT mathematics/calculus-ii/murray
00:00:00.000 --> 00:00:08.000
Hi, this is educator.com and we are here to look at Taylor Series and Maclaurin Series.
00:00:08.000 --> 00:00:12.000
So, a couple definitions to get us started here.
00:00:12.000 --> 00:00:18.000
You start with a function f(x), and a value a, the center value.
00:00:18.000 --> 00:00:23.000
Then you form this power series that we call the Taylor series of x.
00:00:23.000 --> 00:00:30.000
You take the nth derivative, so that is the nth derivative there.
00:00:30.000 --> 00:00:41.000
Of the function, you plug in a, you divide it by n!, and then you multiply by x-a^n.
00:00:41.000 --> 00:00:47.000
You kind of want to think about this entire term here as being a coefficient.
00:00:47.000 --> 00:00:52.000
We will call that c < font size="-6" > n < /font > , that is the nth coefficient of the Taylor Series.
00:00:52.000 --> 00:01:00.000
Then the x-a^n part is the power part of the Taylor series.
00:01:00.000 --> 00:01:08.000
You will also hear about McLauren series, that is the exact same thing as the Taylor Series.
00:01:08.000 --> 00:01:10.000
That just means that you take the special case where a=0.
00:01:10.000 --> 00:01:13.000
So McLauren Series is just a special case of the Taylor Series.
00:01:13.000 --> 00:01:20.000
You just plug in a=0, and so you get something slightly simpler there.
00:01:20.000 --> 00:01:27.000
We are also going to talk about Taylor Polynomials.
00:01:27.000 --> 00:01:32.000
The formula for the Taylor Polynomial looks exactly the same for the Taylor series,
00:01:32.000 --> 00:01:41.000
Except what you do is instead of running it to infinity, you cut the thing off at the degree k term.
00:01:41.000 --> 00:01:57.000
So, you call this t < font size="-6" > k < /font > (x), and what that means is, essentially that you get this thing that only runs up to x^k power.
00:01:57.000 --> 00:02:10.000
You have these coefficients that give you a polynomial of degree.
00:02:10.000 --> 00:02:18.000
Well, usually it will be degree K, but if that last term, if the coefficient happens to be 0, it could be lower degrees.
00:02:18.000 --> 00:02:20.000
So I will see degree less than or equal to k.
00:02:20.000 --> 00:02:29.000
So the Taylor Polynomial is a polynomial of degree k, but what it represents is you just take the first few terms of the Taylor Series,
00:02:29.000 --> 00:02:33.000
And you run it up until you see an x^k term.
00:02:33.000 --> 00:02:38.000
Let us try some examples there.
00:02:38.000 --> 00:02:43.000
The first example is to find the Maclaurin series for f(x) = cos(x).
00:02:43.000 --> 00:02:51.000
That means, remember, the formula there is the nth derivative of f at a.
00:02:51.000 --> 00:02:54.000
Well a=0 here, because it is a Maclaurin Series.
00:02:54.000 --> 00:03:04.000
fN(0)/n! × normally x-a^n, but since a=0 it is just x^n.
00:03:04.000 --> 00:03:08.000
I want to figure out what these coefficients are, the c < font size="-6" > n < /font > 's.
00:03:08.000 --> 00:03:11.000
I will make a little chart here.
00:03:11.000 --> 00:03:18.000
n and the nth derivative of x, then I will plug in the nth derivative of 0.
00:03:18.000 --> 00:03:20.000
Then I will figure out what the coefficient n is.
00:03:20.000 --> 00:03:28.000
That is the same as f < font size="-6" > n < /font > (0) divided by n factorial.
00:03:28.000 --> 00:03:35.000
When n=0, we have the 0 derivative of f, which just means the original function.
00:03:35.000 --> 00:03:38.000
The 0 derivative is just cos(x).
00:03:38.000 --> 00:03:51.000
cos(0)=1, and 1/0!, remember 0! is just 1. So 1/0!=1.
00:03:51.000 --> 00:03:56.000
When n=1, we take the first derivative, that is -sin(x).
00:03:56.000 --> 00:04:01.000
If you plug in 0 to that, it is 0, so the coefficient is just 0.
00:04:01.000 --> 00:04:07.000
When n=2, derivative of -sin is -cos(x).
00:04:07.000 --> 00:04:15.000
Plug in 0 you get -1. So -1/2! is -1/2.
00:04:15.000 --> 00:04:24.000
When n=3, we get the derivative of -cos is just sin(x).
00:04:24.000 --> 00:04:30.000
Plug in 0 to that and you get 0. 0/3!=0.
00:04:30.000 --> 00:04:39.000
When n=4, we get cos(x) and so that derivative when you plug in 0 is 1.
00:04:39.000 --> 00:04:50.000
1/4! is 1/4!, if you want you can write that as 1/24.
00:04:50.000 --> 00:05:02.000
cos(x) is, we take these coefficients, and you attach on the relevant powers of x.
00:05:02.000 --> 00:05:07.000
That is 1 × x⁰ + 0 × x¹.
00:05:07.000 --> 00:05:25.000
So I will leave that out, - 1/2, 1/2! × x², + 0 x³, + 1/4! × x⁴.
00:05:25.000 --> 00:05:33.000
Then you can start to see the pattern here, of course the derivatives of sin and cos are going to repeat themselves.
00:05:33.000 --> 00:05:41.000
The next term will be 0 x⁵ - 1/6! × x⁶,
00:05:41.000 --> 00:05:45.000
0 x⁷ + and so on.
00:05:45.000 --> 00:05:52.000
So, as a series there, we can write this as the sum from 0 to infinity.
00:05:52.000 --> 00:05:58.000
I just want to catch the even powers, because all of the odd ones are 0.
00:05:58.000 --> 00:06:06.000
So I can write x^2n/2n!.
00:06:06.000 --> 00:06:14.000
I am going to write -1^n because that makes it alternative positive and negative there.
00:06:14.000 --> 00:06:24.000
That is our Maclaurin series for cos(x).
00:06:24.000 --> 00:06:35.000
Now, there are several common Maclaurin series that it is probably worth memorizing for at least as long as you are a Calculus student.
00:06:35.000 --> 00:06:37.000
This is one of them, cos(x) is one you should really memorize.
00:06:37.000 --> 00:06:43.000
You should not have to work out this whole chart every time.
00:06:43.000 --> 00:06:49.000
You should probably know the answer because it will almost certainly come up in your Calculus class.
00:06:49.000 --> 00:06:53.000
Let us try another one. f(x) = sin(x).
00:06:53.000 --> 00:06:57.000
Again we want to find the McLauren series.
00:06:57.000 --> 00:07:01.000
One way to do that is to write a whole chart, like we did in the previous example,
00:07:01.000 --> 00:07:10.000
Where you write the derivatives, you plug in 0 every time, then you divide by the factorials, you string them together and you make a series.
00:07:10.000 --> 00:07:15.000
That is a lot of work; instead, we are going to find something easier,
00:07:15.000 --> 00:07:26.000
Which is to notice that sin(x)=derivative of cos(x).
00:07:26.000 --> 00:07:32.000
Except for one negative sign that I have to include there.
00:07:32.000 --> 00:07:41.000
The point there is that I remember a series for cos(x) because we just did it in the last problem.
00:07:41.000 --> 00:07:48.000
We memorized that series. Let me write down the series that I just memorized for cos(x).
00:07:48.000 --> 00:08:02.000
1 - x²/2! + x⁴/4! - x⁶/6! and so on.
00:08:02.000 --> 00:08:05.000
So we get -, now I am just going to take the derivative of that.
00:08:05.000 --> 00:08:08.000
Derivative of 1 is just 0.
00:08:08.000 --> 00:08:23.000
Derivative of x²/2! is just x. Sorry 2x/2!
00:08:23.000 --> 00:08:31.000
+ now the derivative of x⁴ + 4x³/4!.
00:08:31.000 --> 00:08:40.000
- derivative of x⁶ is - x⁵/6! and so on.
00:08:40.000 --> 00:08:49.000
So you want to go ahead and distribute the - sign so we get +, now 2x/2!,
00:08:49.000 --> 00:09:00.000
2! is just 2 so this is just x-, because of the - sign on the outside, 4x³/4!.
00:09:00.000 --> 00:09:08.000
Well, 4/4!, 4! is 4 × 3 × 2 × 1.
00:09:08.000 --> 00:09:15.000
That 4 in the numerator just cancels away that first 4 and leaves us with 3!.
00:09:15.000 --> 00:09:22.000
Now we have got x⁵, 6 in the numerator and 6! in the denominator.
00:09:22.000 --> 00:09:29.000
Well the 6 in the numerator just cancels the 6 out of the factorial, and we get 5!
00:09:29.000 --> 00:09:30.000
You can see the pattern here.
00:09:30.000 --> 00:09:37.000
The next one is going to be, sorry this x⁵/5! should have been positive,
00:09:37.000 --> 00:09:41.000
Because it was negative before but we had a negative on the outside so those two negatives cancel.
00:09:41.000 --> 00:09:46.000
You can see that the next term following the same pattern is going to be,
00:09:46.000 --> 00:09:51.000
x⁷/7!, and so on.
00:09:51.000 --> 00:09:58.000
If you want to write that in a nice closed summation form.
00:09:58.000 --> 00:10:01.000
We have to find a way of capturing the odd numbers.
00:10:01.000 --> 00:10:13.000
But, that is x^2n+1/(2n+1)!.
00:10:13.000 --> 00:10:21.000
And, -1^n will make it alternate positive and negative.
00:10:21.000 --> 00:10:26.000
That is our Maclaurin series for sin(x).
00:10:26.000 --> 00:10:28.000
Again, this is such a common one.
00:10:28.000 --> 00:10:36.000
Sin(x) is such a common function that this one is worth memorizing as well.
00:10:36.000 --> 00:10:45.000
The point of asking you to memorize these things is that later on, we could get more difficult Taylor Series, and Maclaurin series.
00:10:45.000 --> 00:10:56.000
It helps if you kind of have a stock of pre-fabricated examples and then you can use those examples to build up more complicated ones
00:10:56.000 --> 00:11:02.000
By taking derivatives, making substitutions, doing other algebraic tricks,
00:11:02.000 --> 00:11:07.000
And you will not have to work everything out from first principles,
00:11:07.000 --> 00:11:09.000
Taking lots of derivatives and so on.
00:11:09.000 --> 00:11:20.000
In particular, in this case, we figured out sin(x) by using the fact that we had already worked out the cos(x) before.
00:11:20.000 --> 00:11:23.000
This is really exploiting the work we did before.
00:11:23.000 --> 00:11:28.000
We remember the answer to that.
00:11:28.000 --> 00:11:38.000
Then we can just take its derivative and figure out a Taylor Series for sin(x).
00:11:38.000 --> 00:11:45.000
So, example 3 is to find the Taylor Polynomial t₄(x) for sin(x).
00:11:45.000 --> 00:11:51.000
This time we are not centering it around 0, we are centering it around a = π/3.
00:11:51.000 --> 00:11:56.000
It is not a McLaurin Series, it is a full-blown Taylor Series.
00:11:56.000 --> 00:11:58.000
This time I am going to start with my chart.
00:11:58.000 --> 00:12:10.000
n f < font size="-6" > n < /font > (x), the nth derivative, f < font size="-6" > n < /font > (π/3).
00:12:10.000 --> 00:12:22.000
Then the full coefficient c < font size="-6" > n < /font > , which is f < font size="-6" > n < /font > (π/3)/n!.
00:12:22.000 --> 00:12:35.000
The reason I am setting that up is I am remembering the master formula for Taylor Series, which remember is the nth derivative x, of a, you plug in x=a,
00:12:35.000 --> 00:12:40.000
Divided by n! multiplied by the power part x-a^n.
00:12:40.000 --> 00:12:54.000
That is the master formula for Taylor Series and to get the Taylor Polynomial you just cut that off at the k term.
00:12:54.000 --> 00:13:05.000
Let us work out what these values are for the coefficients, for the first few values of n.
00:13:05.000 --> 00:13:09.000
I will work this out for n=0, 1, 2, 3, & 4.
00:13:09.000 --> 00:13:16.000
That is because we only have to go up to the k=4 term, or n=4.
00:13:16.000 --> 00:13:23.000
So sin(x), my derivatives of sin(x), well the 0 derivative is just sin(x) itself.
00:13:23.000 --> 00:13:25.000
You have not taken any derivatives.
00:13:25.000 --> 00:13:37.000
First derivative is cos(x). Second derivative is derivative of cosine, which is -sin(x). Derivative of that is -cos(x).
00:13:37.000 --> 00:13:50.000
Then it starts to repeat at sin(x), if you plug in π/3 to each of these, the sin(π/3) is sqrt(3/2).
00:13:50.000 --> 00:13:53.000
Cos(π/3) = 1/2.
00:13:53.000 --> 00:13:56.000
-sin = -sqrt(3/2),
00:13:56.000 --> 00:14:00.000
-cos is -1/2.
00:14:00.000 --> 00:14:04.000
Then sine is sqrt(3/2) again.
00:14:04.000 --> 00:14:15.000
Now the coefficients c < font size="-6" > n < /font > says you take those derivative values and you divide them by n!. Well 0! is just 1.
00:14:15.000 --> 00:14:24.000
So, we get sqrt(3/2), we are not dividing by anything except 1, and 1! is just 1 so we get 1/2 here.
00:14:24.000 --> 00:14:37.000
But now 2! is 2. We get -sqrt(3/2)/2!, so that is -sqrt(3)/4.
00:14:37.000 --> 00:14:44.000
3!=6, so we get -1/2/6, that is -1/12.
00:14:44.000 --> 00:14:58.000
4! is 24, so we get sqrt(3)/2/24, so sqrt(3)/48.
00:14:58.000 --> 00:15:06.000
I am going to take those coefficients and plug them into my formula for the Taylor Polynomial.
00:15:06.000 --> 00:15:17.000
I will have an n=0 term, an n=1 term, n=2, n=3, and n=4 term.
00:15:17.000 --> 00:15:24.000
The n=0 says that you take sqrt(3)/2 and I am getting that from here.
00:15:24.000 --> 00:15:31.000
Then you multiply by x-a⁰ which is just 0.
00:15:31.000 --> 00:15:42.000
n=1 says we take the 1/2 × x-a is π/3, so π/3¹.
00:15:42.000 --> 00:16:02.000
n=2 gives us -sqrt(3)/2 × x - π/3. To the 2 power. That is an x-π/3.
00:16:02.000 --> 00:16:07.000
n=3 gives us -1/12.
00:16:07.000 --> 00:16:25.000
x-π/3₃ + sqrt(3)/48 × x-π/3⁴.
00:16:25.000 --> 00:16:38.000
That, all of that together, is t4(x). All of that together is our solution.
00:16:38.000 --> 00:16:50.000
To recap, what we did was we invoked this formula for the Taylor Polynomials, which again is just the formula for Taylor Series.
00:16:50.000 --> 00:16:59.000
We cut it off. Instead of going to infinity, we cut it off at the k term, because this is a=π/3, it is not a Maclaurin series.
00:16:59.000 --> 00:17:02.000
It is not something where we can use something that we have memorized.
00:17:02.000 --> 00:17:08.000
We just kind of go through and work out these coefficients one by one using the derivative formula.
00:17:08.000 --> 00:17:15.000
Then we plug everything back into the formula where we attach the powers of x-a^n,
00:17:15.000 --> 00:17:17.000
And we get our Taylor Polynomial.
00:17:17.000 --> 00:17:25.000
We will see how we can use these later on in the next lecture on applications of Taylor Polynomials.
00:17:25.000 --> 00:17:30.000
We will try some more examples later on.
00:17:30.000 --> 00:17:36.000
OK, we are here working on examples of Taylor and Maclaurin series.
00:17:36.000 --> 00:17:45.000
The example we are given here is the Maclaurin Series for f(x) = sec(x).
00:17:45.000 --> 00:17:54.000
The way you want to think about that is you could remember the generic formula for Taylor Series,
00:17:54.000 --> 00:18:04.000
Where you take the nth derivative of f at x over n! × x-a^n.
00:18:04.000 --> 00:18:12.000
That is the generic formula for Taylor Series.
00:18:12.000 --> 00:18:15.000
The problem with that is if you start taking lots of derivative of sec(x) it is going to be really messy because those derivatives do not repeat.
00:18:15.000 --> 00:18:17.000
They get uglier and uglier.
00:18:17.000 --> 00:18:34.000
All we are asked to do here is find 3 non-zero terms, so what I am going to do is exploit the fact that sec(x) is 1/cos(x).
00:18:34.000 --> 00:18:45.000
I remember a Maclauran series for cos(x) because we have worked it out earlier and I memorized the answer.
00:18:45.000 --> 00:19:00.000
That is 1-x²/2+x⁴/4! is 24.
00:19:00.000 --> 00:19:09.000
So, I am filling that in because we already worked out the series for cos(x) and we memorized it.
00:19:09.000 --> 00:19:17.000
It is good if you memorize the series for some of these common ones like sin(x) and cos(x) and e^x because they come up so often.
00:19:17.000 --> 00:19:20.000
This is an example of exploiting one we have used before.
00:19:20.000 --> 00:19:22.000
Our sec(x) is 1/c0s(x).
00:19:22.000 --> 00:19:28.000
We are going to do a little long division of polynomials just like you did in high school.
00:19:28.000 --> 00:19:42.000
We do 1-x²/2 + x⁴/24. That gets divided into 1.
00:19:42.000 --> 00:19:45.000
I am just going to fill in, think of 1 as a big polynomial,
00:19:45.000 --> 00:19:54.000
So I am going to fill in, 1 + 0x² + 0x⁴, I am only filling in even terms,
00:19:54.000 --> 00:20:00.000
Because I only have even terms in the cos(x), so we are not going to need to use any odd terms here.
00:20:00.000 --> 00:20:10.000
Now we just do long division of polynomials which you might have learned in high school but you might be a little bit rusty.
00:20:10.000 --> 00:20:14.000
We look at these terms, 1 and 1, so we get 1 there.
00:20:14.000 --> 00:20:25.000
Now we multiply 1 by the whole thing, so 1 - x²/2 + x⁴/24,
00:20:25.000 --> 00:20:28.000
And then we subtract just like we do long division of numbers,
00:20:28.000 --> 00:20:37.000
So that is + x²/2, then we multiply across there, x²/2.
00:20:37.000 --> 00:20:58.000
x²/2 × -x²/2 is -x⁴/4 + x⁶/48.
00:20:58.000 --> 00:21:03.000
We subtract again and the x²/2's cancel.
00:21:03.000 --> 00:21:09.000
x⁴/4, I can write that as 6/24.
00:21:09.000 --> 00:21:25.000
So, we have 6/24 - 1/24, that gives us 5/24 × x⁴ - x⁶/48
00:21:25.000 --> 00:21:29.000
I was only asked to find three non-zero terms,
00:21:29.000 --> 00:21:32.000
So I just need to find one more.
00:21:32.000 --> 00:21:42.000
That would be then, if we look at the leading term 5/24 x⁴.
00:21:42.000 --> 00:21:45.000
So, that is our answer.
00:21:45.000 --> 00:22:00.000
sec(x) = 1+x²/2 + 5x⁴/24.
00:22:00.000 --> 00:22:03.000
That is really just the first few terms of the Taylor Series.
00:22:03.000 --> 00:22:08.000
To indicate that there is more to come there, I will put a ...
00:22:08.000 --> 00:22:16.000
The question just asked us to find the first 3 non-zero terms. That is what they are.
00:22:16.000 --> 00:22:25.000
This is an example of a problem where it would be quite difficult to find a general pattern, and to write it out in sigma form,
00:22:25.000 --> 00:22:29.000
That is probably why the question only asked us to find the first few terms.
00:22:29.000 --> 00:22:41.000
So, we just found the first few terms by manipulating these polynomials, using the fact that we already knew what the Taylor Series for cos(x) was.
00:22:41.000 --> 00:30:18.000
Then we manipulated the polynomials, and we got the first few terms of a Taylor Series for sec(x).