WEBVTT

00:00:00.035 --> 00:00:03.622
Every function a machine
can actually compute is built out

00:00:03.622 --> 00:00:05.469
of adding and multiplying.

00:00:05.921 --> 00:00:08.081
That is what a polynomial is.

00:00:08.185 --> 00:00:09.553
Sine is not one,

00:00:09.636 --> 00:00:14.444
so when your calculator reports a sine
it is not doing trigonometry at all.

00:00:14.640 --> 00:00:18.981
It is evaluating a polynomial,
and this lecture is about which one,

00:00:19.064 --> 00:00:21.247
and how far you can trust it.

00:00:22.644 --> 00:00:24.444
So here is the question.

00:00:24.641 --> 00:00:26.357
Sine is not a polynomial.

00:00:26.440 --> 00:00:31.712
Can we build one that behaves like it near
zero, and how close can we actually get?

00:00:33.526 --> 00:00:35.672
I will tell you the destination first,

00:00:35.755 --> 00:00:39.495
because the destination
is not the hard part. This is it.

00:00:39.598 --> 00:00:44.113
Sine of x equals x, minus x
cubed over three factorial,

00:00:44.196 --> 00:00:48.562
plus x to the fifth over five
factorial, and on forever.

00:00:49.176 --> 00:00:53.102
Every hard question in this lecture
is hiding in that equals sign.

00:00:54.614 --> 00:00:56.775
So where do those numbers come from?

00:00:56.971 --> 00:01:01.730
Nowhere clever. Suppose I want a
polynomial that behaves like f near zero,

00:01:01.813 --> 00:01:05.539
and the only tool I have is that I can
force the two of them to agree at a single

00:01:05.539 --> 00:01:09.441
point: same value, same slope, same bend.

00:01:09.893 --> 00:01:13.841
So write the polynomial down
with its coefficients still unknown.

00:01:14.637 --> 00:01:19.294
a nought, plus a one x,
plus a two x squared, and so on.

00:01:19.746 --> 00:01:21.744
Now set x to zero.

00:01:21.847 --> 00:01:26.341
Every term carrying an x dies,
and all that is left is a nought.

00:01:27.254 --> 00:01:28.961
Now differentiate.

00:01:29.414 --> 00:01:31.026
The constant vanishes,

00:01:31.109 --> 00:01:35.974
a one is standing there on its own, and
everything after it still carries an x.

00:01:36.171 --> 00:01:39.561
Set x to zero again, and out falls a one.

00:01:40.358 --> 00:01:42.321
Differentiate once more.

00:01:42.517 --> 00:01:46.556
The square brings a two down
in front, so a two ends up doubled,

00:01:46.639 --> 00:01:51.818
and setting x to zero leaves a two as
the second derivative at zero, over two.

00:01:52.731 --> 00:01:54.601
And you can see the pattern.

00:01:54.797 --> 00:01:57.977
Each derivative strips
one more coefficient bare,

00:01:58.060 --> 00:02:01.181
and the number it picks up
in front is a factorial.

00:02:01.264 --> 00:02:05.558
So the k-th coefficient
is the k-th derivative of f at zero,

00:02:05.641 --> 00:02:07.743
divided by k factorial.

00:02:08.656 --> 00:02:13.103
Stack them up and that is the Taylor
polynomial of f about zero.

00:02:13.300 --> 00:02:16.537
Every coefficient is one
derivative at one point.

00:02:16.620 --> 00:02:19.825
Nothing else about
the function is used anywhere.

00:02:20.622 --> 00:02:22.294
Now aim it at sine.

00:02:22.398 --> 00:02:27.296
The derivatives of sine go round in a
circle. Differentiate and you get cosine,

00:02:27.379 --> 00:02:32.349
then minus sine, then minus cosine,
and then you are back where you started.

00:02:33.053 --> 00:02:35.608
Evaluate all of them at zero.

00:02:35.781 --> 00:02:37.799
Sine of zero is nothing.

00:02:37.882 --> 00:02:39.892
Cosine of zero is one.

00:02:40.065 --> 00:02:45.801
Minus sine of zero is nothing again,
and minus cosine of zero is minus one.

00:02:46.586 --> 00:02:48.131
Look what that does.

00:02:48.304 --> 00:02:54.145
Every even coefficient has a zero on top,
so every even power of x is wiped out.

00:02:54.342 --> 00:02:59.193
What survives is the odd
powers, one, three, five, seven,

00:02:59.276 --> 00:03:01.436
with the signs flipping each time.

00:03:02.949 --> 00:03:06.549
So here is the machine running,
against the curve itself.

00:03:06.746 --> 00:03:12.749
The crudest match uses one term, a nought,
which is sine of zero, which is nothing.

00:03:13.201 --> 00:03:19.041
That polynomial is the constant zero, and
on this picture it is the horizontal axis.

00:03:19.238 --> 00:03:23.139
It agrees with sine at exactly
one point and nowhere else.

00:03:23.936 --> 00:03:25.609
Take one more term.

00:03:26.061 --> 00:03:29.844
The next coefficient
is cosine of zero, which is one,

00:03:29.927 --> 00:03:32.667
so the first polynomial is simply x.

00:03:32.980 --> 00:03:37.602
That is the tangent line at the origin,
and close in it is genuinely good.

00:03:38.085 --> 00:03:39.395
But watch it leave.

00:03:39.478 --> 00:03:44.770
By x equals two the line is still
climbing and sine has already turned over.

00:03:44.853 --> 00:03:50.427
So add the next term, minus x cubed
over six, and look what it does.

00:03:50.739 --> 00:03:54.536
It bends the line down, exactly
where the line was going wrong.

00:03:55.240 --> 00:03:57.769
That is the whole idea in one picture.

00:03:57.852 --> 00:04:00.001
Every new term is a correction.

00:04:00.104 --> 00:04:04.839
Near zero it is negligible, because
a high power of a small number is tiny.

00:04:04.922 --> 00:04:09.172
It only speaks up once you are far enough
out for the previous curve to have failed.

00:04:10.085 --> 00:04:14.672
Add the fifth power term and the same
thing happens one hump further out.

00:04:14.985 --> 00:04:17.482
Add the seventh and it happens again.

00:04:17.795 --> 00:04:22.509
Each polynomial tracks sine a little
longer before it gives up and shoots off.

00:04:23.306 --> 00:04:24.072
Let me put a dot

00:04:24.072 --> 00:04:28.310
on sine and a dot on the seventh
degree polynomial and walk them out.

00:04:28.623 --> 00:04:31.259
Near zero you cannot tell them apart.

00:04:31.456 --> 00:04:34.452
Past three they are still
on top of each other.

00:04:34.648 --> 00:04:37.436
And then, quite suddenly, they are not.

00:04:38.488 --> 00:04:42.053
Which raises the only question
worth asking about any of this.

00:04:42.505 --> 00:04:45.278
How wrong is the polynomial at a given x,

00:04:45.361 --> 00:04:48.995
and does taking more terms
really drive that wrongness to zero?

00:04:49.192 --> 00:04:53.430
That gap has a name, and it
is the real content of Taylor's theorem.

00:04:54.530 --> 00:04:56.853
So let us look at that gap directly.

00:04:57.049 --> 00:05:00.417
Here is sine again,
and here is the cubic we built,

00:05:00.521 --> 00:05:03.064
x minus x cubed over six.

00:05:03.261 --> 00:05:04.815
Same picture as before,

00:05:04.898 --> 00:05:08.590
except that now I want to measure
the distance between the two curves.

00:05:09.503 --> 00:05:11.640
Call that distance the remainder.

00:05:11.837 --> 00:05:16.816
R three of x is sine
of x minus P three of x,

00:05:16.899 --> 00:05:20.730
and it is nothing more than the vertical
gap between the blue curve and the green

00:05:20.730 --> 00:05:23.389
one at whichever x you are standing at.

00:05:24.186 --> 00:05:28.668
Walk in toward zero and it closes
so fast you cannot see it happen.

00:05:28.865 --> 00:05:32.883
At a half the two curves differ
by about two ten-thousandths.

00:05:33.079 --> 00:05:36.041
On this picture
that is thinner than the line itself.

00:05:37.093 --> 00:05:38.510
Now walk out.

00:05:38.823 --> 00:05:41.459
At two the gap is already obvious.

00:05:41.772 --> 00:05:44.129
At three it is enormous.

00:05:44.581 --> 00:05:49.015
Sine is up near a seventh and the cubic
has dived past minus one and a half.

00:05:49.098 --> 00:05:51.455
Same polynomial, same degree.

00:05:51.652 --> 00:05:54.590
All that changed is how far we walked.

00:05:55.387 --> 00:05:58.708
Raising the degree buys
you distance, not safety.

00:05:58.905 --> 00:06:02.003
Here is the seventh degree
polynomial on the same picture.

00:06:02.086 --> 00:06:03.688
It holds on out past four,

00:06:03.688 --> 00:06:07.590
which is much better, and then
it does exactly the same thing.

00:06:07.902 --> 00:06:10.898
Every fixed polynomial eventually leaves.

00:06:11.602 --> 00:06:14.306
So here is what Taylor's
theorem actually says,

00:06:14.389 --> 00:06:17.117
and notice how little of it is the series.

00:06:17.314 --> 00:06:21.030
The function equals
the polynomial, plus a remainder.

00:06:21.227 --> 00:06:25.279
That is an exact statement
with no approximation anywhere in it.

00:06:25.383 --> 00:06:28.437
The whole question
is what the remainder is.

00:06:29.141 --> 00:06:32.857
And Lagrange gives
that remainder to us in closed form.

00:06:33.054 --> 00:06:39.089
It is the n plus first derivative of f,
taken at some point c between zero and x,

00:06:39.172 --> 00:06:44.049
times x to the n plus one,
over n plus one factorial.

00:06:45.101 --> 00:06:47.807
Hold it next to the terms we were adding.

00:06:47.911 --> 00:06:52.637
It is exactly the shape of the next term
of the series, except for one thing.

00:06:52.741 --> 00:06:57.304
The derivative is taken at c, somewhere
in the middle, rather than at zero.

00:06:57.501 --> 00:07:00.346
And the theorem never
tells you where c is.

00:07:01.859 --> 00:07:04.272
Now watch what that buys us for sine.

00:07:04.355 --> 00:07:08.568
Every derivative of sine is plus
or minus a sine or a cosine.

00:07:08.651 --> 00:07:13.119
So whatever c turns out to be,
that derivative is at most one in size,

00:07:13.202 --> 00:07:15.711
and we never need to know c at all.

00:07:16.507 --> 00:07:22.406
So the remainder is trapped below x to
the n plus one, over n plus one factorial.

00:07:22.602 --> 00:07:26.028
Pure arithmetic, with no
trigonometry left in it.

00:07:26.132 --> 00:07:29.441
And now look at what
that quantity does as n grows.

00:07:29.983 --> 00:07:33.510
Take x equal to ten,
a long way from the centre.

00:07:33.593 --> 00:07:37.518
With five terms the bound
is over eight hundred, which is useless.

00:07:37.715 --> 00:07:40.781
With ten it is worse,
nearly three thousand.

00:07:40.977 --> 00:07:43.962
The powers of ten are still
beating the factorial.

00:07:44.387 --> 00:07:46.278
But factorials win in the end.

00:07:46.361 --> 00:07:48.811
By fifteen the bound has turned over.

00:07:48.915 --> 00:07:50.715
By twenty it is forty.

00:07:50.912 --> 00:07:55.986
By thirty it is four thousandths,
and by forty it is a hundred-millionth.

00:07:56.899 --> 00:07:59.152
And ten is not special.

00:07:59.255 --> 00:08:02.237
Fix any x you like, however enormous,

00:08:02.320 --> 00:08:07.522
and x to the m over m factorial goes
to zero as m grows, because eventually

00:08:07.522 --> 00:08:12.271
the factorial is multiplying by numbers
larger than x at every single step.

00:08:12.975 --> 00:08:15.586
Which is the sentence
we were actually after.

00:08:15.669 --> 00:08:18.607
The remainder for sine dies, everywhere.

00:08:18.803 --> 00:08:22.946
So the series really does add up
to sine, at every real number.

00:08:23.029 --> 00:08:24.261
Not nearly.

00:08:24.457 --> 00:08:25.666
Exactly.

00:08:25.769 --> 00:08:29.009
And it was the remainder
that proved it, not the terms.

00:08:30.018 --> 00:08:31.956
Sine was the happy case.

00:08:32.270 --> 00:08:34.628
Here is a function that is not.

00:08:34.823 --> 00:08:38.400
g of x is one over one plus x squared.

00:08:38.597 --> 00:08:43.219
Smooth everywhere, bounded,
no corners, no blow-ups.

00:08:43.322 --> 00:08:46.388
There is nothing wrong
with it anywhere on the real line.

00:08:47.185 --> 00:08:52.038
Its Taylor series about zero is easy
to get, because you have already seen it.

00:08:52.224 --> 00:08:56.017
A geometric series sums
to one over one minus r,

00:08:56.100 --> 00:08:58.772
whenever r is smaller than one in size.

00:08:58.864 --> 00:09:02.162
Now put r equal to minus x squared.

00:09:02.854 --> 00:09:05.429
Out comes one, minus x squared,

00:09:05.512 --> 00:09:10.167
plus x to the fourth, minus
x to the sixth, and onward.

00:09:10.250 --> 00:09:13.572
Every even power,
with the signs alternating.

00:09:13.676 --> 00:09:16.904
That is the Taylor series of g about zero.

00:09:17.608 --> 00:09:20.008
Now draw two of its partial sums.

00:09:20.092 --> 00:09:22.798
Here is one minus x squared.

00:09:22.994 --> 00:09:25.862
Here is the one that runs
out to the sixth power.

00:09:25.966 --> 00:09:30.192
And here are the two walls,
at minus one and at plus one.

00:09:30.897 --> 00:09:34.215
Inside those walls the partial
sums close in on the curve,

00:09:34.298 --> 00:09:36.760
and taking more terms makes them better.

00:09:36.956 --> 00:09:39.292
Outside them, look what happens.

00:09:39.488 --> 00:09:43.946
The sixth power sum has already dived
past minus one, while the function it came

00:09:43.946 --> 00:09:46.256
from sits calmly at four tenths.

00:09:47.308 --> 00:09:51.490
And adding more terms out there
does not help. It makes things worse.

00:09:51.686 --> 00:09:53.834
Past x equals one the powers

00:09:53.834 --> 00:09:58.339
of x stop shrinking, so the series
has nothing to converge to at all.

00:09:58.536 --> 00:10:00.696
It is not a bad approximation.

00:10:00.892 --> 00:10:03.006
It is not an approximation.

00:10:03.918 --> 00:10:05.507
That number one has a name,

00:10:05.590 --> 00:10:08.876
and it is the thing
this lecture assumed you had not met.

00:10:09.190 --> 00:10:11.548
It is the radius of convergence.

00:10:11.744 --> 00:10:14.182
Inside it the series converges.

00:10:14.380 --> 00:10:16.212
Outside it the series diverges,

00:10:16.296 --> 00:10:19.362
and there is no argument
about a remainder to be had.

00:10:20.158 --> 00:10:22.050
And here is the strange part.

00:10:22.248 --> 00:10:25.717
Nothing on the real line
explains why the wall sits at one.

00:10:25.800 --> 00:10:27.911
The function is perfectly happy there.

00:10:27.994 --> 00:10:30.581
The explanation lives off
the real line entirely,

00:10:30.665 --> 00:10:32.906
and it is a story for another course.

00:10:33.702 --> 00:10:35.709
So that is failure number one.

00:10:35.792 --> 00:10:39.242
The series simply stops
converging past a certain distance.

00:10:39.346 --> 00:10:43.198
It is a nuisance, but it is honest,
because it tells you it has given up.

00:10:43.282 --> 00:10:46.858
The second failure is far worse,
because it tells you nothing at all.

00:10:47.960 --> 00:10:50.562
Here is the function that ends this story.

00:10:50.666 --> 00:10:56.864
For x away from zero, f of x is e
to the minus one over x squared,

00:10:56.947 --> 00:10:59.966
and at zero we define it to be zero.

00:11:00.070 --> 00:11:02.819
It is a perfectly ordinary looking curve.

00:11:02.902 --> 00:11:07.046
It rises from nothing on the left,
flattens right out at the origin,

00:11:07.129 --> 00:11:08.708
and rises again.

00:11:09.505 --> 00:11:10.850
And it is smooth.

00:11:10.933 --> 00:11:15.102
Infinitely differentiable,
everywhere, including at zero.

00:11:15.298 --> 00:11:18.222
That takes a little work
to prove, but it is true.

00:11:18.305 --> 00:11:22.393
So Taylor's recipe applies to it
with no complaint whatsoever.

00:11:23.097 --> 00:11:27.033
But look how hard it presses itself
against the axis near the origin.

00:11:27.137 --> 00:11:29.898
At one it is about zero point three seven.

00:11:29.981 --> 00:11:32.676
At a half it is down
to eighteen thousandths.

00:11:32.872 --> 00:11:35.576
At a fifth it is ten to the minus eleven,

00:11:35.659 --> 00:11:38.992
and at a tenth, ten
to the minus forty four.

00:11:39.788 --> 00:11:44.642
That is not merely small. That is
flatter than any polynomial can manage.

00:11:44.746 --> 00:11:46.892
x to the tenth, at a tenth,

00:11:46.975 --> 00:11:52.490
is ten to the minus ten, and f is already
thirty orders of magnitude below that.

00:11:52.687 --> 00:11:55.497
The exponential crushes every power.

00:11:56.294 --> 00:11:58.025
Now differentiate it.

00:11:58.128 --> 00:12:03.876
Away from zero the derivative is two
over x cubed, times the same exponential.

00:12:04.073 --> 00:12:07.925
The two over x cubed blows up
as x approaches the origin,

00:12:08.008 --> 00:12:12.258
but the exponential goes to zero
faster than any power can blow up.

00:12:12.455 --> 00:12:14.359
So the limit is zero.

00:12:15.063 --> 00:12:19.438
Differentiate again and you get
another rational function of one over x,

00:12:19.521 --> 00:12:23.470
times that same exponential,
and the same thing happens.

00:12:23.666 --> 00:12:26.764
Every single derivative
at zero comes out zero.

00:12:26.847 --> 00:12:28.114
Not small.

00:12:28.311 --> 00:12:29.356
Zero.

00:12:30.153 --> 00:12:32.452
So feed those into the recipe.

00:12:32.765 --> 00:12:36.910
Every coefficient is a derivative
at zero over a factorial, and every one

00:12:36.910 --> 00:12:39.000
of those derivatives is zero.

00:12:39.197 --> 00:12:41.285
So every coefficient is zero,

00:12:41.368 --> 00:12:44.956
and the Taylor series
of this function is the zero function.

00:12:45.753 --> 00:12:46.810
Draw it.

00:12:47.007 --> 00:12:51.036
There it is, in red,
lying flat along the axis.

00:12:51.233 --> 00:12:54.752
And now ask the question we
have been asking all along.

00:12:54.855 --> 00:12:56.342
How wrong is it?

00:12:56.655 --> 00:13:01.427
Put a dot on the function and a dot
on its series, and walk them out.

00:13:02.038 --> 00:13:04.210
They come apart immediately.

00:13:04.407 --> 00:13:07.993
Out at two point four the gap
is nearly the whole height of the picture.

00:13:08.076 --> 00:13:09.850
Walk back in and it shrinks,

00:13:09.933 --> 00:13:14.299
but it never actually closes until
you are standing at the origin itself.

00:13:15.096 --> 00:13:17.836
And here is the thing
that should bother you.

00:13:18.033 --> 00:13:21.830
Adding more terms does nothing
at all, because every term is zero.

00:13:22.027 --> 00:13:26.091
The remainder is the whole
function, at every degree, forever.

00:13:27.004 --> 00:13:29.083
So this series converges.

00:13:29.395 --> 00:13:33.619
It converges on the entire real
line, beautifully, instantly,

00:13:33.702 --> 00:13:36.292
with infinite radius of convergence.

00:13:36.907 --> 00:13:39.403
And it converges to the wrong thing.

00:13:39.716 --> 00:13:42.884
It agrees with the function it
came from at exactly one point,

00:13:42.967 --> 00:13:45.905
the point we built it
at, and nowhere else.

00:13:47.120 --> 00:13:50.810
Which kills the comfortable
picture of what a Taylor series is.

00:13:50.893 --> 00:13:53.178
It is not a decomposition of a function.

00:13:53.261 --> 00:13:56.256
It is a list of derivatives
at one point, and derivatives

00:13:56.256 --> 00:14:00.994
at one point can be completely blind
to what the function does anywhere else.

00:14:02.068 --> 00:14:04.634
So put the two cases next to each other.

00:14:04.831 --> 00:14:09.708
For sine we could bound the remainder,
and the bound went to zero for every x.

00:14:09.812 --> 00:14:13.922
That is precisely why we are allowed to
write an equals sign between the function

00:14:13.922 --> 00:14:15.292
and its series.

00:14:16.205 --> 00:14:20.327
For the flat function, the series
was the zero function and the remainder

00:14:20.327 --> 00:14:23.299
was the whole of f, at every degree.

00:14:23.496 --> 00:14:24.782
It never went anywhere.

00:14:24.866 --> 00:14:30.486
So there is no equals sign to be had,
except at the single point x equals zero.

00:14:31.190 --> 00:14:34.569
And notice what
did the deciding in both cases.

00:14:34.673 --> 00:14:35.947
Not the terms.

00:14:36.031 --> 00:14:38.400
Not how fast the coefficients shrink.

00:14:38.597 --> 00:14:41.291
Not even whether the series converges.

00:14:41.488 --> 00:14:43.215
It was the remainder that settled it,

00:14:43.299 --> 00:14:47.050
both times, and nothing else
in the argument mattered at all.

00:14:47.962 --> 00:14:50.622
So, three things to carry away.

00:14:50.819 --> 00:14:53.869
First, Taylor's theorem
is not an approximation.

00:14:53.953 --> 00:14:58.865
It is an equality. The function is the
polynomial plus the remainder, exactly,

00:14:58.865 --> 00:15:00.731
for every x and every n.

00:15:00.815 --> 00:15:04.472
There is nothing to be wrong about
until you throw the remainder away.

00:15:05.269 --> 00:15:10.517
Second, the series represents the function
only where the remainder tends to zero.

00:15:10.714 --> 00:15:14.163
That is a limit statement,
and it has to be proved.

00:15:14.476 --> 00:15:17.774
For sine we proved it, with the factorial.

00:15:17.970 --> 00:15:20.827
For the flat function it is plainly false.

00:15:21.624 --> 00:15:24.550
And third, the one that catches people.

00:15:25.002 --> 00:15:28.195
A series converging is not
the same thing as a series converging

00:15:28.195 --> 00:15:29.670
to the right answer.

00:15:29.867 --> 00:15:31.759
Our last example converged everywhere

00:15:31.759 --> 00:15:34.965
on the line and was wrong
everywhere except one point.

00:15:35.877 --> 00:15:38.026
So here is the statement, whole.

00:15:38.339 --> 00:15:43.862
Sine of x is the sum from k equals
zero to infinity of minus one to the k,

00:15:43.946 --> 00:15:48.916
times x to the two k plus one,
over two k plus one factorial.

00:15:49.620 --> 00:15:52.361
And that equals sign is not notation.

00:15:52.464 --> 00:15:56.528
It is a theorem, and the thing holding it
up is a bound on the remainder that goes

00:15:56.528 --> 00:15:58.534
to zero for every x.

00:15:58.618 --> 00:16:00.918
The series is the part you can see.

00:16:01.021 --> 00:16:03.762
The remainder is the part that decides.