Taylor & Maclaurin polynomials intro (part 2)

WEBVTT
Kind: captions
Language: en

00:00:00.550 --> 00:00:02.960
In the last several
videos, we learned

00:00:02.960 --> 00:00:05.550
how we can approximate
an arbitrary function,

00:00:05.550 --> 00:00:08.070
but a function that is
differentiable and twice and

00:00:08.070 --> 00:00:09.940
thrice differentiable
and all of the rest.

00:00:09.940 --> 00:00:14.360
How we can approximate a
function around x is equal to 0

00:00:14.360 --> 00:00:17.000
using a polynomial.

00:00:17.000 --> 00:00:21.320
If we just have a
zero-degree polynomial, which

00:00:21.320 --> 00:00:23.410
is just a constant,
you can approximate it

00:00:23.410 --> 00:00:26.240
with a horizontal line that
just goes through that point.

00:00:26.240 --> 00:00:27.860
Not a great approximation.

00:00:27.860 --> 00:00:29.840
If you have a
first-degree polynomial,

00:00:29.840 --> 00:00:32.250
you can at least get the
slope right at that point.

00:00:32.250 --> 00:00:34.350
If you get to a
second-degree polynomial,

00:00:34.350 --> 00:00:37.260
you can get something that
hugs the function a little bit

00:00:37.260 --> 00:00:38.000
longer.

00:00:38.000 --> 00:00:39.790
If you go to a
third-degree polynomial,

00:00:39.790 --> 00:00:42.620
maybe something that hugs
the function even a little

00:00:42.620 --> 00:00:44.150
bit longer than that.

00:00:44.150 --> 00:00:48.270
But all of that was
focused on approximating

00:00:48.270 --> 00:00:51.880
the function around
x is equal to 0.

00:00:51.880 --> 00:00:55.150
And that's why we call it the
Maclaurin series or the Taylor

00:00:55.150 --> 00:00:56.950
series at x is equal to 0.

00:00:56.950 --> 00:00:59.170
What I want to do now is
expand it a little bit,

00:00:59.170 --> 00:01:02.430
generalize it a little bit, and
focus on the Taylor expansion

00:01:02.430 --> 00:01:04.680
at x equals anything.

00:01:04.680 --> 00:01:06.960
So let's say we
want to approximate

00:01:06.960 --> 00:01:09.420
this function when x--
so this is our x-axis--

00:01:09.420 --> 00:01:12.230
when x is equal to c.

00:01:12.230 --> 00:01:14.290
So we can do the
exact same thing.

00:01:14.290 --> 00:01:17.300
We could say, look,
our first approximation

00:01:17.300 --> 00:01:25.707
is that our polynomial
at c should be equal to--

00:01:25.707 --> 00:01:28.290
or actually, even let me better
it-- our polynomial could just

00:01:28.290 --> 00:01:31.990
be-- if it's just
going to be a constant,

00:01:31.990 --> 00:01:34.080
it should at least
equal to function

00:01:34.080 --> 00:01:35.700
whatever the
function equals at c.

00:01:35.700 --> 00:01:40.660
So it should just equal f
of c. f of c is a constant.

00:01:40.660 --> 00:01:42.560
It's that value
right over there.

00:01:42.560 --> 00:01:44.540
We're assuming that c is given.

00:01:44.540 --> 00:01:47.240
And then you would
have-- this would just

00:01:47.240 --> 00:01:50.560
be a horizontal line
that goes through f of c.

00:01:50.560 --> 00:01:53.610
That's p of x is
equal to f of c.

00:01:53.610 --> 00:01:55.480
Not a great
approximation, but then we

00:01:55.480 --> 00:01:59.170
could try to go for having
this constraint matched,

00:01:59.170 --> 00:02:02.177
plus having the
derivative matched.

00:02:02.177 --> 00:02:03.760
So what this constraint
gave us-- just

00:02:03.760 --> 00:02:07.059
as a reminder-- this gave
us the fact that at least p

00:02:07.059 --> 00:02:11.340
of c, the approximation at c,
our polynomial at c, at least

00:02:11.340 --> 00:02:13.410
is going to be equal
to f of c, right?

00:02:13.410 --> 00:02:14.902
If you put c over
here, it doesn't

00:02:14.902 --> 00:02:16.443
change what's on
the right-hand side,

00:02:16.443 --> 00:02:19.110
because this is just
going to be a constant.

00:02:19.110 --> 00:02:21.720
Now, let's get the
constraint one more step.

00:02:21.720 --> 00:02:27.050
What if we want a situation
where this is true,

00:02:27.050 --> 00:02:31.160
and we want the derivative
of our polynomial

00:02:31.160 --> 00:02:34.570
to be the same thing as the
derivative of our function

00:02:34.570 --> 00:02:37.410
when either of them are at c.

00:02:37.410 --> 00:02:41.030
So for this situation, what
if we set up our polynomial--

00:02:41.030 --> 00:02:43.280
and you'll see a
complete parallel to what

00:02:43.280 --> 00:02:44.540
we did in earlier videos.

00:02:44.540 --> 00:02:46.790
We're just going to shift
it a little bit for the fact

00:02:46.790 --> 00:02:48.280
that we're not at 0.

00:02:48.280 --> 00:02:56.590
So now, let's define p of x
to be equal to f of c plus f

00:02:56.590 --> 00:03:00.130
prime of c.

00:03:00.130 --> 00:03:04.100
So whatever the slope is at this
point of the function, whatever

00:03:04.100 --> 00:03:07.362
the function slope
is, times-- and you're

00:03:07.362 --> 00:03:09.570
going to see something
slightly different over here--

00:03:09.570 --> 00:03:12.150
x minus c.

00:03:12.150 --> 00:03:18.140
Now, let's think about
what this minus c is doing.

00:03:18.140 --> 00:03:20.320
So let's test, first of
all, that we didn't mess up

00:03:20.320 --> 00:03:22.180
our previous constraint.

00:03:22.180 --> 00:03:25.150
So let's evaluate this at c.

00:03:25.150 --> 00:03:27.540
So now, we know that
p of c-- and I'm

00:03:27.540 --> 00:03:30.790
using this exact
example-- so p of c--

00:03:30.790 --> 00:03:32.390
let me do this in a new color.

00:03:32.390 --> 00:03:33.250
Let me try it out.

00:03:33.250 --> 00:03:36.020
So p-- that's not a new color.

00:03:36.020 --> 00:03:44.290
p of c is going to be equal
to f of c plus f prime

00:03:44.290 --> 00:03:47.730
of c times c minus c.

00:03:47.730 --> 00:03:51.470
Wherever you see an x, you
put a c in there. c minus c.

00:03:51.470 --> 00:03:54.180
Well, this term right over
here is going to be 0.

00:03:54.180 --> 00:03:57.770
And so this whole term right
over here is going to be 0.

00:03:57.770 --> 00:04:03.030
And so you're just left with
p of c is equal to f of c.

00:04:03.030 --> 00:04:06.270
You're just left with that
constraint right over there.

00:04:06.270 --> 00:04:08.530
And the only reason why
we were able to blank out

00:04:08.530 --> 00:04:13.350
this second term right over here
is because we had f prime of c

00:04:13.350 --> 00:04:15.630
times x minus c.

00:04:15.630 --> 00:04:20.160
The x minus c makes all of the
terms after this irrelevant.

00:04:20.160 --> 00:04:23.430
We can go now verify
that this is now true.

00:04:23.430 --> 00:04:31.120
So let's try-- p
prime of x is going

00:04:31.120 --> 00:04:34.510
to be the derivative of this,
which is just 0, because this

00:04:34.510 --> 00:04:37.590
is going to be a constant,
plus the derivative

00:04:37.590 --> 00:04:39.644
of this right over here.

00:04:39.644 --> 00:04:40.810
And what's that going to be?

00:04:40.810 --> 00:04:43.150
Well, that's going to be--
you can expand this out

00:04:43.150 --> 00:04:46.500
to be f prime of c
times x minus f prime

00:04:46.500 --> 00:04:48.859
of c times c, which
would just be constant.

00:04:48.859 --> 00:04:51.150
So if you take the derivative
of this thing right here,

00:04:51.150 --> 00:04:55.920
you're just going to be
left with an f prime of c.

00:04:55.920 --> 00:04:58.390
So the derivative of our
polynomial is now constant.

00:04:58.390 --> 00:05:01.050
So obviously, if you
were to evaluate this

00:05:01.050 --> 00:05:06.930
at c, p prime at c, you're
going to get f prime of c.

00:05:06.930 --> 00:05:10.900
So once again, it meets
the second constraint.

00:05:10.900 --> 00:05:12.690
And now when you have
both of these terms,

00:05:12.690 --> 00:05:16.080
maybe our approximation will
look something like this.

00:05:16.080 --> 00:05:20.900
It will at least have the
right slope as f of x.

00:05:20.900 --> 00:05:23.380
Our approximation is
getting a little bit better.

00:05:23.380 --> 00:05:24.960
And if we keep doing
this-- and we're

00:05:24.960 --> 00:05:28.110
using the exact same logic
that we used when we did it

00:05:28.110 --> 00:05:31.420
around 0, when we did
the Maclaurin expansion--

00:05:31.420 --> 00:05:39.090
you get the general Taylor
expansion for the approximation

00:05:39.090 --> 00:05:44.010
of f of x around c
to be the polynomial.

00:05:44.010 --> 00:05:46.910
So the polynomial p of x
is going to be equal to--

00:05:46.910 --> 00:05:48.670
and I'll just expand it out.

00:05:48.670 --> 00:05:50.970
And this is very similar
to what we saw before.

00:05:50.970 --> 00:05:57.519
f of c plus f prime
of c times x minus c.

00:05:57.519 --> 00:06:00.060
You might even guess what the
next few terms are going to be.

00:06:00.060 --> 00:06:01.311
It's the exact same logic.

00:06:01.311 --> 00:06:02.810
Watch the videos
on Maclaurin series

00:06:02.810 --> 00:06:04.634
where I go for a few
more terms into it.

00:06:04.634 --> 00:06:06.300
It becomes a little
bit more complicated

00:06:06.300 --> 00:06:08.240
taking the second and
third derivatives,

00:06:08.240 --> 00:06:10.030
and all of the rest
just because you

00:06:10.030 --> 00:06:12.110
have to expand out
these binomials,

00:06:12.110 --> 00:06:14.740
but it's the exact same logic.

00:06:14.740 --> 00:06:19.780
So then you have plus
your second-degree term,

00:06:19.780 --> 00:06:24.189
f prime prime of c,
divided by 2 factorial.

00:06:24.189 --> 00:06:26.730
And this is just like what we
saw in the Maclaurin expansion.

00:06:26.730 --> 00:06:28.480
And just to be
clear, you could say

00:06:28.480 --> 00:06:30.100
that there's a 1
factorial down here.

00:06:30.100 --> 00:06:31.110
I didn't take the
trouble to write it

00:06:31.110 --> 00:06:32.690
because it doesn't
change the value.

00:06:32.690 --> 00:06:36.500
And then that times
x minus c squared

00:06:36.500 --> 00:06:39.590
plus the third derivative
of the function

00:06:39.590 --> 00:06:45.450
evaluated at c over
3 factorial times

00:06:45.450 --> 00:06:49.079
x minus c to the third power.

00:06:49.079 --> 00:06:50.620
And I think you get
the general idea.

00:06:50.620 --> 00:06:54.580
You can keep adding more and
more and more terms like this.

00:06:54.580 --> 00:06:57.110
Unfortunately, it makes
it a little bit harder,

00:06:57.110 --> 00:06:59.800
especially if you're
willing to do the work.

00:06:59.800 --> 00:07:04.356
It's not so bad, but instead of
having just x here and instead

00:07:04.356 --> 00:07:05.730
of just having an
x squared here,

00:07:05.730 --> 00:07:07.910
and having an (x-c) squared having

00:07:07.910 --> 00:07:10.900
an (x-c) to the third,
this makes the analytical math

00:07:10.900 --> 00:07:13.600
a little bit hairier, a
little bit more difficult.

00:07:13.600 --> 00:07:15.660
But this will
approximate your function

00:07:15.660 --> 00:07:17.430
better as you add
more and more terms

00:07:17.430 --> 00:07:21.010
or on an arbitrary value
as opposed to just around x

00:07:21.010 --> 00:07:22.400
is equal to 0.

00:07:22.400 --> 00:07:26.830
And I'll show you that using
WolframAlpha in the next video.


Visualizing Taylor series approximations

WEBVTT
Kind: captions
Language: en

00:00:00.520 --> 00:00:02.800
I've talked a lot
about using polynomials

00:00:02.800 --> 00:00:05.525
to approximate functions, but
what I want to do in this video

00:00:05.525 --> 00:00:08.080
is actually show you that
the approximation is actually

00:00:08.080 --> 00:00:09.000
happening.

00:00:09.000 --> 00:00:11.690
So right over here-- and I'm
using WolframAlpha for this.

00:00:11.690 --> 00:00:12.750
It's a very cool website.

00:00:12.750 --> 00:00:15.250
You can do all sorts of crazy
mathematical things on it.

00:00:15.250 --> 00:00:21.020
So WolframAlpha.com-- I got this
copied and pasted from them.

00:00:21.020 --> 00:00:23.610
I met Steven Wolfram at a
conference not too long ago.

00:00:23.610 --> 00:00:24.360
He said yes, you
should definitely

00:00:24.360 --> 00:00:25.660
use WolframAlpha in your videos.

00:00:25.660 --> 00:00:26.410
And I said, great.

00:00:26.410 --> 00:00:26.914
I will.

00:00:26.914 --> 00:00:28.580
And so that's what
I'm doing right here.

00:00:28.580 --> 00:00:30.371
And it's super useful,
because what it does

00:00:30.371 --> 00:00:31.786
is-- and we could
have calculated

00:00:31.786 --> 00:00:33.160
a lot of this on
our own, or even

00:00:33.160 --> 00:00:34.493
done it on a graphic calculator.

00:00:34.493 --> 00:00:37.410
But you usually can do it just
with one step on WolframAlpha--

00:00:37.410 --> 00:00:44.092
is see how well we can
approximate sine of x using--

00:00:44.092 --> 00:00:46.400
you could call it a
Maclaurin series expansion,

00:00:46.400 --> 00:00:48.570
or you could call it a
Taylor series expansion--

00:00:48.570 --> 00:00:52.030
at x is equal to 0 using
more and more terms.

00:00:52.030 --> 00:00:54.320
And having a good
feel for the fact

00:00:54.320 --> 00:00:58.610
that the more terms we add, the
better it hugs the sine curve.

00:00:58.610 --> 00:01:03.110
So this over here in
orange is sine of x.

00:01:03.110 --> 00:01:06.640
That should hopefully look
fairly familiar to you.

00:01:06.640 --> 00:01:08.450
And in previous
videos, we figured out

00:01:08.450 --> 00:01:11.860
what that Maclaurin
expansion for sine of x is.

00:01:11.860 --> 00:01:15.260
And WolframAlpha does
it for us as well.

00:01:15.260 --> 00:01:17.210
They actually calculate
the factorials.

00:01:17.210 --> 00:01:21.884
3 factorial is 6, 5 factorial
is 120, so on and so forth.

00:01:21.884 --> 00:01:23.300
But what's interesting
here is you

00:01:23.300 --> 00:01:25.560
can pick how many of
the approximations

00:01:25.560 --> 00:01:26.970
you want to graph.

00:01:26.970 --> 00:01:29.820
And so what they did
is if you want just one

00:01:29.820 --> 00:01:31.562
term of the
approximation-- so if we

00:01:31.562 --> 00:01:32.770
didn't have this whole thing.

00:01:32.770 --> 00:01:36.610
If we just said that our
polynomial is equal to x,

00:01:36.610 --> 00:01:37.914
what does that look like?

00:01:37.914 --> 00:01:40.080
Well, that's going to be
this graph right over here.

00:01:40.080 --> 00:01:41.947
They tell us which
term-- how many terms we

00:01:41.947 --> 00:01:44.530
used by how many dots there are
right over here, which I think

00:01:44.530 --> 00:01:46.630
is pretty clever.

00:01:46.630 --> 00:01:52.790
So this right here, that is the
function p of x is equal to x.

00:01:52.790 --> 00:01:54.441
And so it's a very
rough approximation,

00:01:54.441 --> 00:01:56.440
although for sine of x,
it doesn't do a bad job.

00:01:56.440 --> 00:01:59.830
It hugs the sine curve
right over there.

00:01:59.830 --> 00:02:03.580
And then it starts to veer
away from the sine curve again.

00:02:03.580 --> 00:02:05.430
You add another term.

00:02:05.430 --> 00:02:08.940
So if you have the x minus
x to the third over 6.

00:02:08.940 --> 00:02:12.850
So now you have two
terms in the expansion.

00:02:12.850 --> 00:02:17.067
Or I guess we should say we
were up to the third-order term,

00:02:17.067 --> 00:02:18.900
because that's how their
numbering the dots.

00:02:18.900 --> 00:02:21.151
Because they're not talking
about the number of terms.

00:02:21.151 --> 00:02:23.025
They're talking about
the order of the terms.

00:02:23.025 --> 00:02:24.760
So they have one
dot here, because we

00:02:24.760 --> 00:02:27.540
have only one first-degree term.

00:02:27.540 --> 00:02:30.360
When we have two
terms here, since we--

00:02:30.360 --> 00:02:32.479
when you do the
expansion for sine of x,

00:02:32.479 --> 00:02:34.020
it doesn't have a
second-degree term.

00:02:34.020 --> 00:02:39.670
We now have a third-degree
polynomial approximation.

00:02:39.670 --> 00:02:41.270
And so let's look
at the third-degree.

00:02:41.270 --> 00:02:42.730
We should look for three dots.

00:02:42.730 --> 00:02:44.190
That's this curve
right over here.

00:02:44.190 --> 00:02:46.690
So if you just have
that first term,

00:02:46.690 --> 00:02:48.320
you just get that straight line.

00:02:48.320 --> 00:02:52.490
You add the negative x to
the third over 6 to that x.

00:02:52.490 --> 00:02:57.020
You now get a curve
that looks like this.

00:02:57.020 --> 00:03:00.730
And notice it starts hugging
sine a little bit earlier.

00:03:00.730 --> 00:03:03.270
And it keeps hugging
it a little bit later.

00:03:03.270 --> 00:03:05.360
So once again, just
adding that second term

00:03:05.360 --> 00:03:06.710
does a pretty good job.

00:03:06.710 --> 00:03:08.720
It hugs the sine
curve pretty well,

00:03:08.720 --> 00:03:11.180
especially around
smaller numbers.

00:03:11.180 --> 00:03:12.890
You add another term.

00:03:12.890 --> 00:03:17.750
And now we're at an order five
polynomial, right over here.

00:03:17.750 --> 00:03:22.620
So x minus x to the third over
6 plus x to the fifth over 120.

00:03:22.620 --> 00:03:24.580
So let's look for the five dots.

00:03:24.580 --> 00:03:27.300
So that's this one right over
here-- one, two, three, four,

00:03:27.300 --> 00:03:28.190
five.

00:03:28.190 --> 00:03:30.080
So that's this curve
right over here.

00:03:30.080 --> 00:03:33.580
And notice it begins hugging
the line a little bit earlier

00:03:33.580 --> 00:03:36.200
than the magenta
version, and it keeps

00:03:36.200 --> 00:03:37.820
hugging it a little bit longer.

00:03:43.530 --> 00:03:45.760
Then it flips back up like this.

00:03:45.760 --> 00:03:47.330
So it hugged it a
little bit longer.

00:03:47.330 --> 00:03:49.770
And you can see I'll keep going.

00:03:49.770 --> 00:03:52.330
If you have all these
first four terms,

00:03:52.330 --> 00:03:55.640
it gives us a seventh
degree polynomial.

00:03:55.640 --> 00:03:57.750
So let's look for the
seven dots over here.

00:03:57.750 --> 00:03:59.170
So they come in just like this.

00:04:02.170 --> 00:04:05.770
And then once again, it hugs the
curve sooner than when we just

00:04:05.770 --> 00:04:07.310
had the first three terms.

00:04:07.310 --> 00:04:12.750
And it keeps hugging the
curve all the way until here.

00:04:12.750 --> 00:04:13.890
And then the last one.

00:04:13.890 --> 00:04:16.355
If you have all of these
terms up to x to the ninth,

00:04:16.355 --> 00:04:17.230
it does it even more.

00:04:17.230 --> 00:04:18.162
You start here.

00:04:18.162 --> 00:04:19.870
It hugs the curve
longer than the others.

00:04:19.870 --> 00:04:20.550
And goes out.

00:04:20.550 --> 00:04:22.300
And if you think about
it, it makes sense,

00:04:22.300 --> 00:04:25.830
because what's happening here is
each successive term that we're

00:04:25.830 --> 00:04:29.200
adding to the expansion,
they have a higher degree

00:04:29.200 --> 00:04:34.970
of x over a much, much,
much, much larger number.

00:04:34.970 --> 00:04:37.610
So for small x
value-- so when you're

00:04:37.610 --> 00:04:41.420
close to the origin
for small x values,

00:04:41.420 --> 00:04:43.820
this denominator is
going to overpower

00:04:43.820 --> 00:04:46.020
the numerator, especially
when you're below 1.

00:04:46.020 --> 00:04:47.690
Because when you
take something that

00:04:47.690 --> 00:04:50.280
has absolute value
less than 1 to a power,

00:04:50.280 --> 00:04:51.890
you're actually
shrinking it down.

00:04:51.890 --> 00:04:53.770
So when you're
close to the origin,

00:04:53.770 --> 00:04:56.270
these latter terms
don't matter much.

00:04:56.270 --> 00:04:58.760
So you're kind of
not losing some

00:04:58.760 --> 00:05:01.010
of the precision of some
of the earlier terms.

00:05:01.010 --> 00:05:03.400
When these tweaking
terms come in,

00:05:03.400 --> 00:05:06.180
these come in when
the numerator can

00:05:06.180 --> 00:05:08.980
start to overpower
the denominator.

00:05:08.980 --> 00:05:15.070
So this last term, it starts
to become relevant out here,

00:05:15.070 --> 00:05:20.080
where all of a sudden x to the
ninth can overpower 362,880.

00:05:20.080 --> 00:05:22.220
And the same thing
on the negative side.

00:05:22.220 --> 00:05:23.720
So hopefully this
gives you a sense.

00:05:23.720 --> 00:05:26.930
We only have one, two,
three, four, five terms here.

00:05:26.930 --> 00:05:28.500
Imagine what would
happen if we had

00:05:28.500 --> 00:05:30.642
an infinite number of terms.

00:05:30.642 --> 00:05:32.100
I think you get a
pretty good sense

00:05:32.100 --> 00:05:36.624
that it would kind of hug the
sine curve out to infinity.

00:05:36.624 --> 00:05:39.290
So hopefully that makes you feel
a little bit better about this.

00:05:39.290 --> 00:05:41.650
And for fun, you
might want to go type

00:05:41.650 --> 00:05:44.240
in-- you can type in
Taylor expansion at 0

00:05:44.240 --> 00:05:46.830
and sine of x, or Maclaurin
expansion or Maclaurin

00:05:46.830 --> 00:05:49.940
series for sine of x,
cosine of x, e to the x,

00:05:49.940 --> 00:05:52.460
at WolframAlpha.com.

00:05:52.460 --> 00:05:55.000
And try it out for a bunch
of different functions.

00:05:55.000 --> 00:05:58.190
And you can keep adding
or taking away terms

00:05:58.190 --> 00:06:01.060
to see how well
it hugs the curve.


Euler's formula & Euler's identity

WEBVTT
Kind: captions
Language: en

00:00:00.728 --> 00:00:01.896
Voiceover: In the last video, we took the

00:00:01.896 --> 00:00:04.849
Maclaurin expansion of E to the X

00:00:04.849 --> 00:00:08.870
and we saw that it looked
like it was some type a

00:00:08.870 --> 00:00:10.871
combination of the
polynomial approximations

00:00:10.871 --> 00:00:15.272
of cosine of X and of sine of X.

00:00:15.272 --> 00:00:16.567
But it's not quite, because there's

00:00:16.567 --> 00:00:18.319
a couple of negatives in there.

00:00:18.319 --> 00:00:20.847
If we were to add these
two together that we

00:00:20.847 --> 00:00:22.567
did not have when we took

00:00:22.567 --> 00:00:25.778
the representation of E to the X.

00:00:25.778 --> 00:00:28.631
But to reconcile these,
I'll do a little bit of a

00:00:28.631 --> 00:00:30.879
I don't know if you can
even call it a trick.

00:00:30.879 --> 00:00:35.593
Let's see if we take
this polynomial expansion

00:00:35.593 --> 00:00:38.567
of E to the X, this
approximation, what happens

00:00:38.567 --> 00:00:41.351
if we say E to the X is equal to this,

00:00:41.351 --> 00:00:43.908
especially as this
becomes an infinite number

00:00:43.908 --> 00:00:46.447
of terms and becomes
less of an approximation

00:00:46.447 --> 00:00:48.550
and more of an equality.

00:00:48.550 --> 00:00:51.954
What happens if I take
E to the IX and before

00:00:51.954 --> 00:00:53.863
that might have been kind
of a weird thing to do.

00:00:53.863 --> 00:00:57.663
Let me write it down, E to the IX.

00:00:57.663 --> 00:00:59.247
Because before, I said how do you define

00:00:59.247 --> 00:01:00.617
E to the Ith power?

00:01:00.617 --> 00:01:02.152
That's a very bizarre thing to do,

00:01:02.152 --> 00:01:04.254
take something to the XI power.

00:01:04.254 --> 00:01:05.933
How do you even comprehend some type

00:01:05.933 --> 00:01:07.376
of a function like that.

00:01:07.376 --> 00:01:10.900
But now that we can have
a polynomial expansion

00:01:10.900 --> 00:01:13.127
of E to the X, we can
maybe make sense of it.

00:01:13.127 --> 00:01:16.800
Because we can take I to different amounts

00:01:16.800 --> 00:01:18.390
to different powers and
we know what that gives,

00:01:18.390 --> 00:01:20.776
I squared is negative one, I
to the third is negative I,

00:01:20.776 --> 00:01:22.615
and so on and so forth.

00:01:22.615 --> 00:01:24.983
So what happens if we take E to the IX.

00:01:24.983 --> 00:01:27.255
So once again, just like
taking the X up here

00:01:27.255 --> 00:01:29.295
and replacing it with
an IX, so every where

00:01:29.295 --> 00:01:32.895
we see the X in it's
polynomial approximation,

00:01:32.895 --> 00:01:34.631
we would write an IX.

00:01:34.631 --> 00:01:35.887
So let's do that.

00:01:35.887 --> 00:01:39.359
So E to the IX should be
approximately equal to,

00:01:39.359 --> 00:01:41.230
and it will become more and more equal,

00:01:41.230 --> 00:01:42.543
and this is more to give
you an intuition I'm not

00:01:42.543 --> 00:01:45.791
doing a rigorous proof here,
but it's still profound.

00:01:45.791 --> 00:01:47.656
Not to oversell it,
but I don't think I can

00:01:47.656 --> 00:01:50.608
oversell what is about
to be discovered or seen

00:01:50.608 --> 00:01:56.310
in this video, it would
be equal to one plus

00:01:56.310 --> 00:02:00.751
instead of an X will have
an IX, plus IX, plus,

00:02:00.751 --> 00:02:04.319
so what's IX squared?

00:02:04.319 --> 00:02:06.224
So let me write this down.

00:02:06.224 --> 00:02:11.790
What is IX squared over two factorial?

00:02:11.790 --> 00:02:13.584
Well I squared is going
to be negative one,

00:02:13.584 --> 00:02:16.346
and then you'd have X
squared over two factorials.

00:02:16.346 --> 00:02:21.105
It's going to be minus X
squared over two factorial,

00:02:21.105 --> 00:02:23.505
I think you might see
where this is going to go.

00:02:23.505 --> 00:02:26.140
And then what is IX?

00:02:26.140 --> 00:02:27.287
Remember everywhere we saw an X,

00:02:27.287 --> 00:02:28.938
we're going to replace it with an IX.

00:02:28.938 --> 00:02:31.293
So what is IX to the third power?

00:02:31.293 --> 00:02:32.391
Actually let me write this out,

00:02:32.391 --> 00:02:34.863
let me not skip some steps over here.

00:02:34.863 --> 00:02:40.872
So this is going to be IX
squared over two factorial,

00:02:40.872 --> 00:02:44.420
actually let me, I want
to do it just the way.

00:02:44.420 --> 00:02:52.820
So plus IX squared over two factorial,

00:02:52.820 --> 00:02:57.229
plus IX to the third over three factorial,

00:02:57.229 --> 00:03:02.881
plus IX to the fourth over four factorial,

00:03:02.881 --> 00:03:07.940
and we can keep going,
plus IX to the fifth

00:03:07.940 --> 00:03:11.370
over five factorial, and
we can just keep going

00:03:11.370 --> 00:03:12.954
so on and so forth.

00:03:12.954 --> 00:03:15.682
Let's evaluate if these
IXs raised to these

00:03:15.682 --> 00:03:17.898
different powers.

00:03:17.898 --> 00:03:23.371
So this will be equal to one plus IX,

00:03:23.371 --> 00:03:26.434
IX squared, that's the
same thing as I squared

00:03:26.434 --> 00:03:29.329
times X squared, I
squared is negative one.

00:03:29.329 --> 00:03:34.247
So this is negative X
squared over two factorial,

00:03:34.247 --> 00:03:36.487
and this is going to be the same thing as

00:03:36.487 --> 00:03:38.570
I to the third times X to the third.

00:03:38.570 --> 00:03:40.595
I to the third is the same thing as

00:03:40.676 --> 00:03:44.145
I squared times I, so it's
going to be negative I.

00:03:44.145 --> 00:03:47.737
So this is going to be minus I times X to

00:03:47.737 --> 00:03:51.518
the third over three factorial.

00:03:51.518 --> 00:03:56.651
So then plus, you're going to have,

00:03:56.651 --> 00:03:58.610
what's I to the fourth power?

00:03:58.610 --> 00:04:01.358
So that's I squared squared.

00:04:01.358 --> 00:04:03.226
So that's negative one
squared, that's just

00:04:03.256 --> 00:04:03.926
going to be one.

00:04:03.926 --> 00:04:05.255
So I to the fourth is one and

00:04:05.255 --> 00:04:06.735
then you have X to the fourth.

00:04:06.735 --> 00:04:10.350
Plus X to the fourth over four factorial.

00:04:10.350 --> 00:04:13.639
And then you're going
to have, I don't even

00:04:13.639 --> 00:04:15.359
write the plus yet, I to the fifth.

00:04:15.359 --> 00:04:18.583
So I to the fifth is
going to be one times I,

00:04:18.583 --> 00:04:22.130
so it's going to be I times X to the fifth

00:04:22.130 --> 00:04:26.842
over five factorials plus
I times X to the fifth

00:04:26.842 --> 00:04:28.225
over five factorial.

00:04:28.225 --> 00:04:29.906
I think you might see a pattern here.

00:04:29.906 --> 00:04:32.985
Coefficient is one, then
I, then negative one,

00:04:32.985 --> 00:04:38.946
then negative I, then one,
then I, then negative one,

00:04:38.946 --> 00:04:42.515
X to the sixth over six factorial,

00:04:42.515 --> 00:04:48.618
and then negative IX to the seventh

00:04:48.618 --> 00:04:51.131
over seven factorial.

00:04:51.131 --> 00:04:54.114
So we have some terms,
some of them are imaginary,

00:04:54.114 --> 00:04:57.119
they're being multiplied by I.

00:04:57.119 --> 00:04:58.600
Some of them are real.

00:04:58.600 --> 00:05:02.983
Why don't we separate them out?

00:05:02.983 --> 00:05:04.653
So once again, E to the IX, is going to be

00:05:04.653 --> 00:05:06.694
equal to this thing, especially as we add

00:05:06.694 --> 00:05:08.125
an infinite number of terms.

00:05:08.125 --> 00:05:11.741
Let's separate out the real
and the non-real terms.

00:05:11.741 --> 00:05:14.741
Or the real and the
imaginary terms I should say.

00:05:14.741 --> 00:05:20.294
So this is real, this
is real, this is real,

00:05:20.294 --> 00:05:23.732
and this right over here is real.

00:05:23.732 --> 00:05:27.445
And obviously we could
keep going on with that.

00:05:27.445 --> 00:05:30.210
So the real terms here are

00:05:30.210 --> 00:05:34.261
one minus X squared over two factorial

00:05:34.261 --> 00:05:37.974
plus X to the fourth over four factorial,

00:05:37.974 --> 00:05:39.909
you might be getting excited now,

00:05:39.909 --> 00:05:43.638
minus X to the sixth over six factorial

00:05:43.638 --> 00:05:45.261
and that's all I've done
here, but they would

00:05:45.261 --> 00:05:47.941
keep going so plus so on and so forth.

00:05:47.941 --> 00:05:50.930
So that's all of the real terms.

00:05:50.930 --> 00:05:52.197
And what are the imaginary terms here.

00:05:52.197 --> 00:05:55.130
And I'll just factor out the I over here.

00:05:55.130 --> 00:05:56.503
Actually, let me just factor out.

00:05:56.503 --> 00:06:02.862
So it's going to be plus I times,
well this is IX, so this will be X.

00:06:02.862 --> 00:06:05.153
And then the next, so
that's an imaginary term,

00:06:05.153 --> 00:06:06.440
this is an imaginary term.

00:06:06.440 --> 00:06:09.733
We're factoring out the
I, so minus X to the third

00:06:09.733 --> 00:06:14.539
over three factorial, and then the next

00:06:14.539 --> 00:06:15.862
imaginary term is right over there.

00:06:15.862 --> 00:06:19.908
We factor out the I,
plus X to the fifth over

00:06:19.908 --> 00:06:22.874
five factorial and then
the next imaginary term

00:06:22.874 --> 00:06:24.483
is right there, we factored out the I.

00:06:24.483 --> 00:06:29.948
So it's minus X to the
seventh over seven factorial.

00:06:29.948 --> 00:06:31.683
And then we would obviously keep going.

00:06:31.683 --> 00:06:34.475
So plus minus keep going,
so on and so forth,

00:06:34.475 --> 00:06:36.372
preferably to infinite
so that we get as good

00:06:36.372 --> 00:06:38.603
of a approximation as possible.

00:06:38.603 --> 00:06:43.140
So we have a situation where E to the IX

00:06:43.140 --> 00:06:47.275
is equal to all of this business here.

00:06:47.275 --> 00:06:50.371
But you probably remember
from the last two videos

00:06:50.371 --> 00:06:53.360
the real part, this was the polynomial,

00:06:53.360 --> 00:06:57.520
this was the Maclaurin
approximation of cosine

00:06:57.520 --> 00:07:00.364
of X around I should say
the Taylor approximation

00:07:00.364 --> 00:07:02.300
around zero or you could also call it the

00:07:02.300 --> 00:07:03.843
Maclaurin approximation.

00:07:03.843 --> 00:07:07.579
So this and this are the same thing.

00:07:07.579 --> 00:07:11.219
So this is cosine of
X, especially when you

00:07:11.219 --> 00:07:14.739
added an infinite power
of terms, cosine of X.

00:07:14.739 --> 00:07:18.873
This over here is sine of
X, the exact same thing.

00:07:18.873 --> 00:07:20.531
So it looks like we're
able to reconcile how

00:07:20.531 --> 00:07:23.300
you can add up cosine of X and sine of X

00:07:23.300 --> 00:07:25.739
to get something that's like E of the X.

00:07:25.739 --> 00:07:29.245
This right here is sine of X.

00:07:29.245 --> 00:07:31.292
And so if we take it for granted,

00:07:31.292 --> 00:07:33.275
I'm not rigorously proving it to you,

00:07:33.275 --> 00:07:34.675
and if you were to take an infinite number

00:07:34.675 --> 00:07:36.963
of terms here that this
will essentially become

00:07:36.963 --> 00:07:39.360
cosine of X and if you
take an infinite number

00:07:39.360 --> 00:07:41.219
of terms here this will become sine of X.

00:07:41.219 --> 00:07:45.139
It leads to a fascinating formula.

00:07:45.139 --> 00:07:50.499
We could say that E to the IX, is the same

00:07:50.499 --> 00:07:54.995
thing as cosine of X,
and you should be getting

00:07:54.995 --> 00:07:57.147
goose pimples right around now.

00:07:57.147 --> 00:08:02.764
is equal to cosine of X,
plus I times sine of X,

00:08:02.764 --> 00:08:08.039
This is Euler's Formula.

00:08:08.039 --> 00:08:12.777
And this right here is Euler's Formula.

00:08:12.777 --> 00:08:14.961
And if that by itself isn't exciting and

00:08:14.961 --> 00:08:17.240
crazy enough for you,
because is really should be.

00:08:17.240 --> 00:08:19.152
Because we've already done
some pretty cool things.

00:08:19.152 --> 00:08:21.447
We're involving E, which we get from

00:08:21.447 --> 00:08:23.430
continuous compounding interest.

00:08:23.430 --> 00:08:25.430
We have cosine and sine
of X, which are ratios

00:08:25.430 --> 00:08:28.344
of right triangles, it comes
out of the unit circle.

00:08:28.344 --> 00:08:30.447
And some how we've
thrown in the square root

00:08:30.447 --> 00:08:31.399
of negative one.

00:08:31.399 --> 00:08:34.526
There seems to be this
cool relationship here.

00:08:34.526 --> 00:08:37.940
But it becomes extra
cool, and we're going to

00:08:37.940 --> 00:08:38.430
assume we're operating in radians here.

00:08:38.430 --> 00:08:42.638
If we assume Euler's Formula, what happens

00:08:42.638 --> 00:08:44.998
when X is equal to pi?

00:08:44.998 --> 00:08:47.879
Just to throw in another
wacky number in there.

00:08:47.879 --> 00:08:49.479
The ratio between the circumference and

00:08:49.479 --> 00:08:50.878
the diameter of a cirle.

00:08:50.878 --> 00:08:52.887
What happens when we throw in pi?

00:08:52.887 --> 00:09:01.847
We get E to the Ipi is
equal to cosine of pi.

00:09:01.847 --> 00:09:06.469
Cosine of pi is what?

00:09:06.469 --> 00:09:10.920
Pi is half way around the unit circle,

00:09:10.920 --> 00:09:13.780
so cosine of pi is negative one and then

00:09:13.780 --> 00:09:18.564
sine of pi is zero, so
this term goes away.

00:09:18.564 --> 00:09:20.676
So if you evaluated at pi
you get something amazing,

00:09:20.676 --> 00:09:25.057
it's called Euler's Identity.

00:09:26.010 --> 00:09:27.945
I always have trouble pronouncing Euler's.

00:09:27.945 --> 00:09:32.114
Euler's Identity, which
we could write like this,

00:09:32.114 --> 00:09:34.448
or we could add one to both sides and

00:09:34.448 --> 00:09:36.441
we could write it like this.

00:09:36.441 --> 00:09:39.267
And I'll write it in
different colors for emphasis.

00:09:39.267 --> 00:09:51.515
E to the I times pi plus one is equal to ,

00:09:51.515 --> 00:09:53.100
I'll do that in a neutral color,

00:09:53.100 --> 00:09:55.149
is equal to, I'm just
adding one to both sides

00:09:55.149 --> 00:09:59.778
of this thing right over
here, is equal to zero.

00:09:59.778 --> 00:10:03.210
And this is thought provoking.

00:10:03.210 --> 00:10:06.273
I mean here we have, this
tells you that there's

00:10:06.273 --> 00:10:08.900
some connectedness to the universe that we

00:10:08.900 --> 00:10:10.479
don't fully understand or at least I don't

00:10:10.479 --> 00:10:11.265
fully understand.

00:10:11.265 --> 00:10:13.843
I is defined by engineers
for simplicity so that

00:10:13.843 --> 00:10:16.593
they can find the roots of
all sorts of polynomials.

00:10:16.593 --> 00:10:23.349
As you could say the square
root of negative one.

00:10:23.349 --> 00:10:26.714
Pi is the ratio between the circumference

00:10:26.714 --> 00:10:28.794
of a circle and it's diameter.

00:10:28.794 --> 00:10:30.233
Once again another interesting number but

00:10:30.233 --> 00:10:33.314
seems like it comes from
a different place as I.

00:10:33.314 --> 00:10:35.379
E comes from a bunch of different places.

00:10:35.379 --> 00:10:37.169
E you could either think of it comes out

00:10:37.169 --> 00:10:39.546
of continuing compounding interest,

00:10:39.546 --> 00:10:41.913
super valuable for finance.

00:10:41.913 --> 00:10:43.688
It also comes from the
notion that the derivative

00:10:43.688 --> 00:10:45.256
of E to the X is also E to the X,

00:10:45.256 --> 00:10:46.960
another fascinating number.

00:10:46.960 --> 00:10:49.360
But once again seemingly
unrelated to how we came

00:10:49.360 --> 00:10:51.482
up with I and seemingly unrelated

00:10:51.482 --> 00:10:53.789
with how we came up with pi.

00:10:53.789 --> 00:10:56.266
And then of course you
have some of the most

00:10:56.266 --> 00:10:58.561
profound basic numbers right over here.

00:10:58.561 --> 00:11:00.305
You have one, I don't have to explain

00:11:00.305 --> 00:11:01.896
why one is a cool number.

00:11:01.896 --> 00:11:05.264
And I shouldn't have to explain
why zero is a cool number.

00:11:05.264 --> 00:11:06.913
And so this right here connects all

00:11:06.913 --> 00:11:11.688
of these fundamental
numbers in some mystical

00:11:11.688 --> 00:11:12.976
way that shows that there's some

00:11:12.976 --> 00:11:15.538
connectedness to the universe.

00:11:15.538 --> 00:11:22.410
So frankly, if this
does not blow your mind,

00:11:22.410 --> 00:11:26.288
you really have no emotion.


Maclaurin series of e_

WEBVTT
Kind: captions
Language: en

00:00:00.640 --> 00:00:02.390
Now let's do something
pretty interesting.

00:00:02.390 --> 00:00:04.973
And this will, to some degree,
be one of the easiest functions

00:00:04.973 --> 00:00:07.340
to find the Maclaurin
series representation of.

00:00:07.340 --> 00:00:10.740
But let's try to
approximate e to the x.

00:00:10.740 --> 00:00:13.106
f of x is equal to e to the x.

00:00:13.106 --> 00:00:14.480
And what makes
this really simple

00:00:14.480 --> 00:00:15.850
is, when you take the
derivative-- and this is,

00:00:15.850 --> 00:00:18.720
frankly, one of the amazing
things about the number e--

00:00:18.720 --> 00:00:21.270
is that when you take the
derivative of e to the x,

00:00:21.270 --> 00:00:23.050
you get e to the x.

00:00:23.050 --> 00:00:25.590
So this is equal
to f prime of x.

00:00:25.590 --> 00:00:28.880
This is equal to f, the
second derivative of x.

00:00:28.880 --> 00:00:31.570
This is equal to the
third derivative of x.

00:00:31.570 --> 00:00:33.810
This is equal to the
n-th derivative of x.

00:00:33.810 --> 00:00:35.980
It's always equal to e to the x.

00:00:35.980 --> 00:00:38.780
That's kind of the
first mind blowing thing

00:00:38.780 --> 00:00:40.270
about the number e.

00:00:40.270 --> 00:00:42.390
It's just, you could keep
taking its derivative.

00:00:42.390 --> 00:00:45.180
The slope at any
point on that curve

00:00:45.180 --> 00:00:48.410
is the same as the value of
that point on that curve.

00:00:48.410 --> 00:00:49.800
That's kind of crazy.

00:00:49.800 --> 00:00:51.800
Anyway, with that said,
let's take its Maclaurin

00:00:51.800 --> 00:00:52.680
representation.

00:00:52.680 --> 00:00:55.220
So we have to find f
of 0, f prime of 0,

00:00:55.220 --> 00:00:56.525
the second derivative at 0.

00:00:56.525 --> 00:01:01.230
Well, when you take e to the 0,
e to the 0 is just equal to 1.

00:01:01.230 --> 00:01:03.680
And so this is going
to be equal to f of 0.

00:01:03.680 --> 00:01:06.040
This is going to be
equal to f prime of 0.

00:01:06.040 --> 00:01:14.410
It's going to be equal to any of
the derivatives evaluated at 0.

00:01:14.410 --> 00:01:16.410
The n-th derivative
evaluated at 0.

00:01:16.410 --> 00:01:20.120
And that's why it makes
applying the Maclaurin series

00:01:20.120 --> 00:01:22.600
formula fairly straightforward.

00:01:22.600 --> 00:01:24.670
If I wanted to
approximate e to the x

00:01:24.670 --> 00:01:28.330
using a Maclaurin series--
so e to the x-- and I'll

00:01:28.330 --> 00:01:29.910
put a little
approximately over here.

00:01:29.910 --> 00:01:32.360
And we'll get closer and
closer to the real e to the x

00:01:32.360 --> 00:01:34.490
as we keep adding
more and more terms.

00:01:34.490 --> 00:01:36.980
And especially if we had an
infinite number of terms,

00:01:36.980 --> 00:01:40.480
it would look like
this. f of 0--

00:01:40.480 --> 00:01:43.160
let me do it in-- what colors
did I use for cosine and sine?

00:01:43.160 --> 00:01:45.550
So I used pink and I used green.

00:01:45.550 --> 00:01:47.280
So let me use a
non-pink, non-green.

00:01:47.280 --> 00:01:49.930
I'll use the yellow here.

00:01:49.930 --> 00:01:55.710
So f of 0 is 1 plus f prime
of 0 times x. f prime of 0

00:01:55.710 --> 00:01:56.790
is also 1.

00:01:56.790 --> 00:02:00.900
So plus x plus, this
is also 1, so it's

00:02:00.900 --> 00:02:03.040
going to be x squared
over 2 factorial.

00:02:03.040 --> 00:02:06.373
So plus x squared
over 2 factorial.

00:02:06.373 --> 00:02:07.956
All of these things
are going to be 1.

00:02:07.956 --> 00:02:11.530
This is 1, this is 1, when
we're talking about e to the x.

00:02:11.530 --> 00:02:12.820
So you go to the third term.

00:02:12.820 --> 00:02:13.950
This is 1.

00:02:13.950 --> 00:02:16.180
You just have x to the
third over 3 factorial.

00:02:16.180 --> 00:02:18.809
Plus x to the third
over 3 factorial.

00:02:18.809 --> 00:02:20.350
And I think you see
the pattern here.

00:02:20.350 --> 00:02:22.950
We just keep adding terms.
x to the fourth over 4

00:02:22.950 --> 00:02:26.510
factorial plus x
to the fifth over 5

00:02:26.510 --> 00:02:31.220
factorial plus x to the
sixth over 6 factorial.

00:02:31.220 --> 00:02:35.300
And something pretty neat
is starting to emerge.

00:02:35.300 --> 00:02:38.270
Is that e to x, 1-- this is just
really cool-- that e to the x

00:02:38.270 --> 00:02:42.960
can be approximated by
1 plus x plus x squared

00:02:42.960 --> 00:02:45.620
over 2 factorial plus x to
the third over 3 factorial.

00:02:45.620 --> 00:02:47.470
Once again, e to
the x is starting

00:02:47.470 --> 00:02:49.160
to look like a
pretty cool thing.

00:02:49.160 --> 00:02:51.570
This also leads to other
interesting results.

00:02:51.570 --> 00:02:54.560
That if you wanted
to approximate e,

00:02:54.560 --> 00:02:58.820
you just evaluate this
at x is equal to 1.

00:02:58.820 --> 00:03:01.260
So if you wanted to
approximate e, you'd say

00:03:01.260 --> 00:03:05.900
e is approximate to-- well,
e is e to the first power.

00:03:05.900 --> 00:03:07.400
And that's going
to be approximately

00:03:07.400 --> 00:03:10.280
equal to this polynomial
evaluated at 1.

00:03:10.280 --> 00:03:12.750
If x is 1 here, we
make x 1 over here.

00:03:12.750 --> 00:03:15.010
So it'll be 1 plus 1.

00:03:15.010 --> 00:03:21.220
So it'll be 1 plus 1
plus 1 over 2 factorial,

00:03:21.220 --> 00:03:27.570
plus 1 over 3 factorial,
plus 1 over 4 factorial.

00:03:27.570 --> 00:03:30.700
So on and so forth, all
the way into infinity.

00:03:30.700 --> 00:03:35.640
And you could also view this
as 1 over 1 factorial as well.

00:03:35.640 --> 00:03:37.280
1 over 1 factorial.

00:03:37.280 --> 00:03:39.770
But what's really cool is this
is another really neat way

00:03:39.770 --> 00:03:40.870
to represent e.

00:03:40.870 --> 00:03:43.940
It shows that e once again shows
up in this kind of neat thing.

00:03:43.940 --> 00:03:48.660
It's kind of 2 plus
1/2, plus 1/6, plus--

00:03:48.660 --> 00:03:54.070
if you just keep doing this,
you get close to the number e.

00:03:54.070 --> 00:03:57.820
But that by itself isn't
the only fascinating thing.

00:03:57.820 --> 00:04:00.090
If we look back at our
Maclaurin representations

00:04:00.090 --> 00:04:03.020
of these other
functions, cosine of x--

00:04:03.020 --> 00:04:06.140
let me copy and
paste cosine of x.

00:04:06.140 --> 00:04:09.450
So cosine of x right up here.

00:04:09.450 --> 00:04:13.290
So let me do my best to copy
and paste the whole thing.

00:04:13.290 --> 00:04:17.220
So copy and paste.

00:04:17.220 --> 00:04:19.769
Copy and paste.

00:04:19.769 --> 00:04:22.510
So that is cosine of x.

00:04:22.510 --> 00:04:25.050
And let's do the same
thing for the sine

00:04:25.050 --> 00:04:27.260
of x that we did last video.

00:04:27.260 --> 00:04:28.485
So the sine of x.

00:04:31.040 --> 00:04:33.930
Let me copy and paste that.

00:04:33.930 --> 00:04:38.526
Copy, and then
let me paste that.

00:04:38.526 --> 00:04:40.260
Edit, paste.

00:04:40.260 --> 00:04:45.690
So do we see any relationship
between these approximations?

00:04:45.690 --> 00:04:47.927
So before, you probably
would have guessed maybe

00:04:47.927 --> 00:04:50.010
there's some relationship
between cosine and sine,

00:04:50.010 --> 00:04:52.180
but what about e to the x?

00:04:52.180 --> 00:04:54.980
And what you see
here is that cosine

00:04:54.980 --> 00:04:59.360
of x looks a lot like
this term plus this term,

00:04:59.360 --> 00:05:01.910
although we would want to put
a negative out front here.

00:05:01.910 --> 00:05:04.210
So it's a negative version
of this term right here,

00:05:04.210 --> 00:05:07.960
plus this term right here,
plus a negative version

00:05:07.960 --> 00:05:10.640
of this term right over here.

00:05:10.640 --> 00:05:15.830
And sine of x looks
just like this term

00:05:15.830 --> 00:05:22.490
plus a negative version of
this term, plus this term,

00:05:22.490 --> 00:05:24.750
plus a negative version
of the next term.

00:05:24.750 --> 00:05:27.570
So if we could somehow
reconcile the negatives

00:05:27.570 --> 00:05:30.390
in some interesting
way, it looks

00:05:30.390 --> 00:05:33.210
like e to the x is
somehow-- or at least

00:05:33.210 --> 00:05:35.980
its polynomial representation
of e to the x--

00:05:35.980 --> 00:05:39.360
is somehow related
to a combination

00:05:39.360 --> 00:05:42.090
of the polynomial
representations of cosine

00:05:42.090 --> 00:05:43.120
of x and sine of x.

00:05:43.120 --> 00:05:45.874
So this is starting to get
really, really, really cool.

00:05:45.874 --> 00:05:48.040
We're starting to see a
connection between something

00:05:48.040 --> 00:05:52.290
related to compound interest or
a function whose derivative is

00:05:52.290 --> 00:05:53.600
always equal to that function.

00:05:53.600 --> 00:05:55.070
And these things that
come out of the unit

00:05:55.070 --> 00:05:57.700
circle in oscillatory motion
and all of those things, there

00:05:57.700 --> 00:06:00.956
starts to seem some type of
pure connectedness there.

00:06:00.956 --> 00:06:02.580
But I'll leave you
there in that video.

00:06:02.580 --> 00:06:04.080
And in the next
video, I'll show you

00:06:04.080 --> 00:06:07.480
how we can actually
reconcile these three

00:06:07.480 --> 00:06:09.790
fascinating functions.


Maclaurin series of sin(x)

WEBVTT
Kind: captions
Language: en

00:00:00.660 --> 00:00:02.930
In the last video, we
took the Maclaurin series

00:00:02.930 --> 00:00:04.180
of cosine of x.

00:00:04.180 --> 00:00:06.670
We approximated it
using this polynomial.

00:00:06.670 --> 00:00:08.560
And we saw this pretty
interesting pattern.

00:00:08.560 --> 00:00:10.310
Let's see if we can
find a similar pattern

00:00:10.310 --> 00:00:14.360
if we try to approximate sine
of x using a Maclaurin series.

00:00:14.360 --> 00:00:16.000
And once again, a
Maclaurin series

00:00:16.000 --> 00:00:18.240
is really the same thing
as a Taylor series,

00:00:18.240 --> 00:00:20.800
where we are centering
our approximation

00:00:20.800 --> 00:00:23.740
around x is equal to 0.

00:00:23.740 --> 00:00:26.830
So it's just a special
case of a Taylor series.

00:00:26.830 --> 00:00:29.870
So let's take f of
x in this situation

00:00:29.870 --> 00:00:31.410
to be equal to sine of x.

00:00:36.380 --> 00:00:38.890
And let's do the same thing
that we did with cosine of x.

00:00:38.890 --> 00:00:40.598
Let's just take the
different derivatives

00:00:40.598 --> 00:00:42.450
of sine of x really fast.

00:00:42.450 --> 00:00:46.240
So if you have the first
derivative of sine of x,

00:00:46.240 --> 00:00:48.490
is just cosine of x.

00:00:48.490 --> 00:00:51.160
The second derivative
of the sine of x

00:00:51.160 --> 00:00:55.880
is the derivative of cosine of
x, which is negative sine of x.

00:00:55.880 --> 00:00:58.790
The third derivative is going
to be the derivative of this.

00:00:58.790 --> 00:01:00.437
So I'll just write
a 3 in parentheses

00:01:00.437 --> 00:01:02.270
there, instead of doing
prime, prime, prime.

00:01:02.270 --> 00:01:04.310
So the third derivative
is the derivative

00:01:04.310 --> 00:01:07.790
of this, which is
negative cosine of x.

00:01:07.790 --> 00:01:11.570
The fourth derivative
is the derivative

00:01:11.570 --> 00:01:15.020
of this, which is
positive sine of x again.

00:01:15.020 --> 00:01:17.950
So you see, just like cosine
of x, it kind of cycles

00:01:17.950 --> 00:01:19.990
after you take the
derivative enough times.

00:01:19.990 --> 00:01:22.550
And we care-- in order to do
the Maclaurin, series-- we care

00:01:22.550 --> 00:01:26.840
about evaluating the function,
and each of these derivatives

00:01:26.840 --> 00:01:28.450
at x is equal to 0.

00:01:28.450 --> 00:01:30.220
So let's do that.

00:01:30.220 --> 00:01:32.510
So for this, let me do this
in a different color, not

00:01:32.510 --> 00:01:34.030
that same blue.

00:01:34.030 --> 00:01:36.320
I'll do it in this purple color.

00:01:36.320 --> 00:01:38.810
So f-- that's hard
to see, I think

00:01:38.810 --> 00:01:40.930
So let's do this
other blue color.

00:01:40.930 --> 00:01:45.620
So f of 0, in this
situation, is 0.

00:01:45.620 --> 00:01:50.280
And f, the first derivative
evaluated at 0, is 1.

00:01:50.280 --> 00:01:52.880
Cosine of 0 is 1.

00:01:52.880 --> 00:01:57.300
Negative sine of 0
is going to be 0.

00:01:57.300 --> 00:02:01.210
So f prime prime, the second
derivative evaluated at 0 is 0.

00:02:01.210 --> 00:02:06.335
The third derivative
evaluated at 0 is negative 1.

00:02:06.335 --> 00:02:08.411
Cosine of 0 is 1.

00:02:08.411 --> 00:02:09.660
You have a negative out there.

00:02:09.660 --> 00:02:10.850
It is negative 1.

00:02:10.850 --> 00:02:14.850
And then the fourth
derivative evaluated at 0

00:02:14.850 --> 00:02:16.594
is going to be 0 again.

00:02:16.594 --> 00:02:18.385
And we could keep going,
but once again, it

00:02:18.385 --> 00:02:19.593
seems like there's a pattern.

00:02:19.593 --> 00:02:21.130
0, 1, 0, negative
1, 0, then you're

00:02:21.130 --> 00:02:22.920
going to go back to positive 1.

00:02:22.920 --> 00:02:24.750
So on and so forth.

00:02:24.750 --> 00:02:28.230
So let's find its
polynomial representation

00:02:28.230 --> 00:02:29.510
using the Maclaurin series.

00:02:29.510 --> 00:02:31.380
And just a reminder,
this one up here,

00:02:31.380 --> 00:02:34.210
this was approximately
cosine of x.

00:02:34.210 --> 00:02:36.220
And you'll get closer and
closer to cosine of x.

00:02:36.220 --> 00:02:37.960
I'm not rigorously
showing you how

00:02:37.960 --> 00:02:40.760
close, in that it's definitely
the exact same thing as cosine

00:02:40.760 --> 00:02:42.710
of x, but you get closer
and closer and closer

00:02:42.710 --> 00:02:44.975
to cosine of x as you
keep adding terms here.

00:02:44.975 --> 00:02:46.350
And if you go to
infinity, you're

00:02:46.350 --> 00:02:48.920
going to be pretty
much at cosine of x.

00:02:48.920 --> 00:02:51.490
Now let's do the same
thing for sine of x.

00:02:51.490 --> 00:02:52.960
So I'll pick a new color.

00:02:52.960 --> 00:02:54.980
This green should be nice.

00:02:54.980 --> 00:02:56.820
So this is our new p of x.

00:02:56.820 --> 00:02:58.590
So this is approximately
going to be

00:02:58.590 --> 00:03:01.600
sine of x, as we add
more and more terms.

00:03:01.600 --> 00:03:06.820
And so the first term here, f
of 0, that's just going to be 0.

00:03:06.820 --> 00:03:09.050
So we're not even going
to need to include that.

00:03:09.050 --> 00:03:11.090
The next term is
going to be f prime

00:03:11.090 --> 00:03:13.800
of 0, which is 1, times x.

00:03:13.800 --> 00:03:15.880
So it's going to be x.

00:03:15.880 --> 00:03:18.450
Then the next term is f
prime, the second derivative

00:03:18.450 --> 00:03:21.220
at 0, which we see here is 0.

00:03:21.220 --> 00:03:23.020
Let me scroll down a little bit.

00:03:23.020 --> 00:03:24.340
It is 0.

00:03:24.340 --> 00:03:26.610
So we won't have
the second term.

00:03:26.610 --> 00:03:29.590
This third term right
here, the third derivative

00:03:29.590 --> 00:03:32.920
of sine of x evaluated
at 0, is negative 1.

00:03:32.920 --> 00:03:36.830
So we're now going
to have a negative 1.

00:03:36.830 --> 00:03:39.490
Let me scroll down
so you can see this.

00:03:39.490 --> 00:03:42.240
Negative 1-- this is
negative 1 in this case--

00:03:42.240 --> 00:03:45.505
times x to the third
over 3 factorial.

00:03:50.880 --> 00:03:52.860
And then the next
term is going to be 0,

00:03:52.860 --> 00:03:55.850
because that's the
fourth derivative.

00:03:55.850 --> 00:03:59.660
The fourth derivative evaluated
at 0 is the next coefficient.

00:03:59.660 --> 00:04:03.052
We see that that is going to be
0, so it's going to drop off.

00:04:03.052 --> 00:04:04.510
And what you're
going to see here--

00:04:04.510 --> 00:04:06.825
and actually maybe I haven't
done enough terms for you,

00:04:06.825 --> 00:04:08.300
for you to feel good about this.

00:04:08.300 --> 00:04:10.330
Let me do one more
term right over here.

00:04:10.330 --> 00:04:12.690
Just so it becomes clear.

00:04:12.690 --> 00:04:15.450
f of the fifth
derivative of x is

00:04:15.450 --> 00:04:17.440
going to be cosine of x again.

00:04:17.440 --> 00:04:20.209
The fifth derivative-- we'll
do it in that same color,

00:04:20.209 --> 00:04:27.180
just so it's consistent-- the
fifth derivative evaluated at 0

00:04:27.180 --> 00:04:29.570
is going to be 1.

00:04:29.570 --> 00:04:33.470
So the fourth derivative
evaluated at 0 is 0,

00:04:33.470 --> 00:04:36.860
then you go to the fifth
derivative evaluated at 0,

00:04:36.860 --> 00:04:38.814
it's going to be positive 1.

00:04:38.814 --> 00:04:40.730
And if I kept doing this,
it would be positive

00:04:40.730 --> 00:04:44.440
1-- I have to write the 1
as the coefficient-- times x

00:04:44.440 --> 00:04:47.770
to the fifth over 5 factorial.

00:04:47.770 --> 00:04:50.530
So there's something
interesting going on here.

00:04:50.530 --> 00:04:55.500
For cosine of x, I had 1,
essentially 1 times x to the 0.

00:04:55.500 --> 00:04:58.420
Then I don't have x
to the first power.

00:04:58.420 --> 00:05:00.240
I don't have x to the
odd powers, actually.

00:05:00.240 --> 00:05:02.830
And then I just essentially have
x to all of the even powers.

00:05:02.830 --> 00:05:06.650
And whatever power it is, I'm
dividing it by that factorial.

00:05:06.650 --> 00:05:09.400
And then the signs
keep switching.

00:05:09.400 --> 00:05:12.300
I shouldn't say this is an even
power, because 0 really isn't.

00:05:12.300 --> 00:05:14.440
Well, I guess you can
view it as an even number,

00:05:14.440 --> 00:05:17.540
because-- well I won't
go into all of that.

00:05:17.540 --> 00:05:22.440
But it's essentially 0, 2,
4, 6, so on and so forth.

00:05:22.440 --> 00:05:24.200
So this is
interesting, especially

00:05:24.200 --> 00:05:25.440
when you compare to this.

00:05:25.440 --> 00:05:26.760
This is all of the odd powers.

00:05:26.760 --> 00:05:29.060
This is x to the first
over 1 factorial.

00:05:29.060 --> 00:05:30.300
I didn't write it here.

00:05:30.300 --> 00:05:32.580
This is x to the
third over 3 factorial

00:05:32.580 --> 00:05:34.477
plus x to the fifth
over 5 factorial.

00:05:34.477 --> 00:05:35.810
Yeah, 0 would be an even number.

00:05:35.810 --> 00:05:39.830
Anyway, my brain is in a
different place right now.

00:05:39.830 --> 00:05:40.890
And you could keep going.

00:05:40.890 --> 00:05:43.190
If we kept this process
up, you would then

00:05:43.190 --> 00:05:44.280
keep switching sines.

00:05:44.280 --> 00:05:48.200
X to the seventh over
7 factorial plus x

00:05:48.200 --> 00:05:49.527
to the ninth over 9 factorial.

00:05:49.527 --> 00:05:51.110
So there's something
interesting here.

00:05:51.110 --> 00:05:55.280
You once again see this
kind of complimentary nature

00:05:55.280 --> 00:05:56.930
between sine and cosine here.

00:05:56.930 --> 00:05:58.630
You see almost
this-- they're kind

00:05:58.630 --> 00:06:00.960
of filling each
other's gaps over here.

00:06:00.960 --> 00:06:03.220
Cosine of x is all
of the even powers

00:06:03.220 --> 00:06:05.680
of x divided by that
power's factorial.

00:06:05.680 --> 00:06:08.310
Sine of x, when you take its
polynomial representation,

00:06:08.310 --> 00:06:12.470
is all of the odd powers of
x divided by its factorial,

00:06:12.470 --> 00:06:14.100
and you switch sines.

00:06:14.100 --> 00:06:16.640
In the next video,
I'll do e to the x.

00:06:16.640 --> 00:06:18.660
And what's really
fascinating is that e

00:06:18.660 --> 00:06:22.310
to the x starts to look like
a little bit of a combination

00:06:22.310 --> 00:06:24.050
here, but not quite.

00:06:24.050 --> 00:06:25.790
And you really do
get the combination

00:06:25.790 --> 00:06:28.310
when you involve
imaginary numbers.

00:06:28.310 --> 00:06:32.860
And that's when it starts to
get really, really mind blowing.


Maclaurin series of cos(x)

WEBVTT
Kind: captions
Language: en

00:00:00.667 --> 00:00:06.764
In the last video, we hopefully set up some of the intuition for why - or I should say what - the Maclaurin

00:00:06.764 --> 00:00:11.733
series is all about, and I said at the end of the videos that a Maclaurin series is just a special case

00:00:11.733 --> 00:00:15.800
of a Taylor series. In the case of a Maclaurin series, we're approximating

00:00:15.800 --> 00:00:22.800
this function around x is equal to 0, and a Taylor series, and we'll talk about that in a future video,

00:00:22.800 --> 00:00:29.800
you can pick an arbitrary x value - or f(x) value, we should say, around which to approximate the function.

00:00:29.800 --> 00:00:34.133
But with that said, let's just focus on Maclaurin, becuase to some degree it's a little bit simpler,

00:00:34.133 --> 00:00:39.800
and that by itself can lead us to some pretty profound conclusions about mathematics,

00:00:39.800 --> 00:00:41.733
and that's actually where I'm trying to get to.

00:00:41.733 --> 00:00:45.133
So let's take the Maclurin series of some interesting functions

00:00:45.133 --> 00:00:48.359
and I'm gonna do functions where it's pretty easy to take the derivatives, and you can

00:00:48.359 --> 00:00:53.067
/keep/ taking their derivatives over and over and over and over and over again.

00:00:53.067 --> 00:01:01.733
So let's take the Maclaurin series of cosine of x, so if f(x)=cos(x),

00:01:01.733 --> 00:01:06.867
then - before I even apply this formula, that we somewhat derived in the last video,

00:01:06.867 --> 00:01:08.800
or at least got the intuitive for in the last video -

00:01:08.800 --> 00:01:13.067
let's take a bunch of derivatives of f(x), just so we have a good sense of it.

00:01:13.067 --> 00:01:20.467
So, if we take the first derivative, if we take the first derivative, derivative of cos(x) = -sin(x)

00:01:20.467 --> 00:01:25.800
if we take the derivative of that, if we take the derivative of that,

00:01:25.800 --> 00:01:30.467
derivative of sin(x) is cos(x), and we have the negative there, so it's -cos(x)

00:01:30.467 --> 00:01:35.867
so if we take the derivative of that, so this is the third derivative of cos(x),

00:01:35.867 --> 00:01:41.067
now it's just going to be positive sine of x, and if we take the derivative of that,

00:01:41.067 --> 00:01:42.733
we get cos(x) again.

00:01:42.733 --> 00:01:47.800
We get cosine of x again. So if we take the derivative of that,

00:01:47.800 --> 00:01:50.200
this is the fourth derivative, I should, I should use this notation

00:01:50.200 --> 00:01:52.867
but you get the idea, we'll get cos(x) again.

00:01:52.867 --> 00:01:57.733
And if you look at what we talked about in the last video, we want the difference - we want

00:01:57.733 --> 00:02:01.200
the function, and we want it's various derivatives evaluated at 0,

00:02:01.200 --> 00:02:10.800
so let's evaluate it at 0. So f(0), cos(0) is 1, cosine of zero is one.

00:02:10.800 --> 00:02:15.133
Whether you're talking about zero radians or zero degrees, doesn't matter,

00:02:15.133 --> 00:02:28.467
sine of zero is zero, so this is f prime of - f prime of zero, is zero. And then cos(0)

00:02:28.467 --> 00:02:32.867
is, once again, one, but we have the negative out there, so it becomes negative one.

00:02:32.867 --> 00:02:37.467
So f - the second derivative evaluated at zero is negative one.

00:02:37.467 --> 00:02:42.800
Let's take the third derivative, the third derivative evaluated at zero

00:02:42.800 --> 00:02:48.000
well, sine of zero is just zero, and then the fourth derivative evaluated at zero,

00:02:48.000 --> 00:02:54.467
cosine of zero is one. So f prime prime prime at zero is now equal to one.

00:02:54.467 --> 00:02:57.800
So you see an interesting pattern here - one, zero, negative one, zero, one,

00:02:57.800 --> 00:03:00.133
then you go to zero, then you go to negative one, zero.

00:03:00.133 --> 00:03:05.600
So if we were to apply this to find it's Maclaurin representation, what would we get?

00:03:05.600 --> 00:03:12.133
Let me do my best attempt at this. So we would get, our polynomial would be -

00:03:12.133 --> 00:03:19.533
so our polynomial approximation of cosine of x is going to be f(0),

00:03:19.533 --> 00:03:28.600
f(0) is one, and then we have one plus f'(0) times x.

00:03:28.600 --> 00:03:33.600
But f'(0) is just zero, so we're not going to have this term over there, it's going to be

00:03:33.600 --> 00:03:38.800
zero times x, I won't even take the trouble of writing it down, it would be this zero

00:03:38.800 --> 00:03:44.133
time x, then plus f prime prime or second derivative, which is negative one,

00:03:44.133 --> 00:03:49.467
so I'll write negative - negative, this is a negative one right here,

00:03:49.467 --> 00:03:53.133
this is a negative one, times x squared, times x squared,

00:03:53.133 --> 00:03:59.600
over 2 factorial - over two factorial, which in this case is just going to be two.

00:03:59.600 --> 00:04:04.333
But I'll just write it down here as two factorial, to make the pattern a little bit more obvious,

00:04:04.333 --> 00:04:09.333
and then we go to the next term, the third derivative evaluated at zero

00:04:09.333 --> 00:04:14.200
but the third derivative evaluated at zero is just zero, so this term won't be there as well,

00:04:14.200 --> 00:04:19.431
then you go to the fourth derivative, the fourth derivative evaluated at zero is positive one,

00:04:19.431 --> 00:04:23.733
so this coefficient right here is going to be a one, and so you're going to have

00:04:23.733 --> 00:04:30.533
one times x to the fourth over four factorial, so plus x to the fourth over four factorial,

00:04:30.533 --> 00:04:33.000
and I think you start seeing a pattern now.

00:04:33.000 --> 00:04:36.600
You have sign switches - and you would see this if we kept going, so

00:04:36.600 --> 00:04:39.133
you can verify it for yourself if you don't believe me -

00:04:39.133 --> 00:04:44.200
so you have a positive sign, a negative sign, a positive sign, and then a

00:04:44.200 --> 00:04:50.067
negative sign, so on and so forth, and this is, uh, one times x to the zeroth power,

00:04:50.067 --> 00:04:54.800
then you jump two to x to the squared, jump two to x to the fourth, and

00:04:54.800 --> 00:04:58.267
so if we kept that up, we'd have a positive sign, now we have a negative sign,

00:04:58.267 --> 00:05:03.267
it would be x to the sixth over six factorial, then you have a positive sign,

00:05:03.267 --> 00:05:07.800
x to the eighth over eight factorial, and then you'd have a negative sign,

00:05:07.800 --> 00:05:13.867
x to the tenth over ten factorial, and you can just keep going that way.

00:05:13.867 --> 00:05:18.867
And if you kept going with this series, this would be the polynomial representation of

00:05:18.867 --> 00:05:23.533
cosine of x. And it's frankly just kind of cool that if can be represented this way.

00:05:23.533 --> 00:05:27.600
It's a pretty simple pattern here for a trigonometric function.

00:05:27.600 --> 00:05:30.800
Once again, it kind of tells you that all of this math is connected. And we'll see,

00:05:30.800 --> 99:59:59.999
two or three videos from now, it's connected in far more profound ways then you can possibly imagine.


Taylor & Maclaurin polynomials intro (part 1)

WEBVTT
Kind: captions
Language: en

00:00:00.650 --> 00:00:02.410
I've draw an arbitrary
function here.

00:00:02.410 --> 00:00:03.785
And what we're
going to try to do

00:00:03.785 --> 00:00:06.150
is approximate this
arbitrary function--

00:00:06.150 --> 00:00:08.530
we don't know what it
is-- using a polynomial.

00:00:08.530 --> 00:00:10.329
We'll keep adding terms
to that polynomial.

00:00:10.329 --> 00:00:11.870
But to do this,
we're going to assume

00:00:11.870 --> 00:00:14.510
that we can evaluate
the function at 0,

00:00:14.510 --> 00:00:16.210
that it gives us some
value, and that we

00:00:16.210 --> 00:00:19.420
can keep taking the
derivative of the function

00:00:19.420 --> 00:00:21.900
and evaluating the
first, the second,

00:00:21.900 --> 00:00:25.450
and the third derivative, so
on and so forth, at 0 as well.

00:00:25.450 --> 00:00:28.940
So we're assuming that
we know what f of 0 is.

00:00:28.940 --> 00:00:31.720
We're assuming that we
know what f prime of 0 is.

00:00:31.720 --> 00:00:34.450
We're assuming that we know
the second derivative at 0.

00:00:34.450 --> 00:00:38.340
We're assuming that we know
the third derivative at 0.

00:00:38.340 --> 00:00:40.300
So maybe I'll write
it-- third derivative.

00:00:40.300 --> 00:00:44.940
I'll just write f prime prime
at 0, and so forth and so on.

00:00:44.940 --> 00:00:47.910
So let's think about how we
can approximate this using

00:00:47.910 --> 00:00:50.770
polynomials of ever
increasing length.

00:00:50.770 --> 00:00:53.499
So we could have a
polynomial of just one term.

00:00:53.499 --> 00:00:55.040
And it would just
be a constant term.

00:00:55.040 --> 00:00:58.050
So this would be a
polynomial of degree 0.

00:00:58.050 --> 00:00:59.930
And if we have a constant
term, we at least

00:00:59.930 --> 00:01:03.580
might want to make that constant
polynomial-- it really is just

00:01:03.580 --> 00:01:08.160
a constant function-- equal
the function at f of 0.

00:01:08.160 --> 00:01:12.220
So at first, maybe
we just want p of 0,

00:01:12.220 --> 00:01:15.930
where p is the polynomial
that we're going to construct,

00:01:15.930 --> 00:01:20.060
we want p of 0 to
be equal to f of 0.

00:01:20.060 --> 00:01:22.970
So if we want to do that
using a polynomial of only one

00:01:22.970 --> 00:01:26.080
term, of only one
constant term, we

00:01:26.080 --> 00:01:30.250
can just set p of x
is equal to f of 0.

00:01:30.250 --> 00:01:33.000
So if I were to graph it,
it would look like this.

00:01:33.000 --> 00:01:37.260
It would just be a
horizontal line at f of 0.

00:01:37.260 --> 00:01:40.080
And you could say, Sal, that's
a horrible approximation.

00:01:40.080 --> 00:01:42.360
It only approximates the
function at this point.

00:01:42.360 --> 00:01:44.526
Looks like we got lucky at
a couple of other points,

00:01:44.526 --> 00:01:46.170
but it's really bad
everywhere else.

00:01:46.170 --> 00:01:47.628
And now I would
tell you, well, try

00:01:47.628 --> 00:01:49.660
to do any better using
a horizontal line.

00:01:49.660 --> 00:01:52.520
At least we got it
right at f of 0.

00:01:52.520 --> 00:01:56.345
So this is about as good as we
can do with just a constant.

00:01:56.345 --> 00:01:58.220
And even though-- I just
want to remind you--

00:01:58.220 --> 00:01:59.720
this might not look
like a constant,

00:01:59.720 --> 00:02:02.080
but we're assuming that
given the function,

00:02:02.080 --> 00:02:03.720
we could evaluate
it at 0 and that

00:02:03.720 --> 00:02:05.020
will just give us a number.

00:02:05.020 --> 00:02:07.800
So whatever number that was, we
would put it right over here.

00:02:07.800 --> 00:02:10.020
We'd say p of x is
equal to that number.

00:02:10.020 --> 00:02:15.080
It would just be a horizontal
line right there at f of 0.

00:02:15.080 --> 00:02:17.120
But that obviously
is not so great.

00:02:17.120 --> 00:02:18.900
So let's add some
more constraints.

00:02:18.900 --> 00:02:22.280
Beyond the fact that we want
p of 0 to be equal to f of 0,

00:02:22.280 --> 00:02:27.730
let's say that we
also want p prime at 0

00:02:27.730 --> 00:02:31.330
to be the same thing
as f prime at 0.

00:02:31.330 --> 00:02:33.590
Let me do this in a new color.

00:02:33.590 --> 00:02:36.070
So we also want,
in the new color,

00:02:36.070 --> 00:02:38.930
we also want-- that's
not a new color.

00:02:38.930 --> 00:02:41.360
We also want p prime.

00:02:41.360 --> 00:02:44.030
We want the first derivative
of our polynomial,

00:02:44.030 --> 00:02:46.880
when evaluated at 0,
to be the same thing

00:02:46.880 --> 00:02:50.650
as the first derivative of the
function when evaluated at 0.

00:02:50.650 --> 00:02:53.950
And we don't want to lose
this right over here.

00:02:53.950 --> 00:03:00.380
So what if we set p of x
as being equal to f of 0?

00:03:00.380 --> 00:03:02.270
So we're taking our old
p of x, but now we're

00:03:02.270 --> 00:03:05.000
going to add another term so
that the derivatives match up.

00:03:05.000 --> 00:03:11.150
Plus f prime of times x.

00:03:11.150 --> 00:03:13.030
So let's think about
this a little bit.

00:03:13.030 --> 00:03:16.780
If we use this as our new
polynomial, what happens?

00:03:16.780 --> 00:03:18.290
What is p is 0?

00:03:18.290 --> 00:03:21.690
p of 0 is going to
be equal to-- you're

00:03:21.690 --> 00:03:27.180
going to have f of 0 plus
whatever this f prime of 0

00:03:27.180 --> 00:03:28.850
is times 0.

00:03:28.850 --> 00:03:32.210
If you put a 0 in for x, this
term is just going to be 0.

00:03:32.210 --> 00:03:35.380
So you're going to be left
with p of 0 is equal to f of 0.

00:03:35.380 --> 00:03:36.340
That's cool.

00:03:36.340 --> 00:03:38.560
That's just as good
as our first version.

00:03:38.560 --> 00:03:40.390
Now what's the
derivative over here?

00:03:40.390 --> 00:03:45.374
So the derivative is p
prime of x is equal to-- you

00:03:45.374 --> 00:03:46.540
take the derivative of this.

00:03:46.540 --> 00:03:49.910
This is just a constant,
so its derivative is 0.

00:03:49.910 --> 00:03:52.110
The derivative of a
coefficient times x

00:03:52.110 --> 00:03:53.950
is just going to
be the coefficient.

00:03:53.950 --> 00:03:56.480
So it's going to
be f prime of 0.

00:03:56.480 --> 00:04:02.800
So if you evaluate it
at 0-- so p prime of 0.

00:04:02.800 --> 00:04:04.972
Or the derivative of
our polynomial evaluated

00:04:04.972 --> 00:04:07.430
at 0-- I know it's a little
weird because we're not using--

00:04:07.430 --> 00:04:10.261
we're doing a p prime of x
of f of 0 and all of this.

00:04:10.261 --> 00:04:12.760
But just remember, what's the
variable, what's the constant,

00:04:12.760 --> 00:04:14.390
and hopefully, it'll make sense.

00:04:14.390 --> 00:04:17.500
So this is just obviously
going to be f prime of 0.

00:04:17.500 --> 00:04:19.270
Its derivative is
a constant value.

00:04:19.270 --> 00:04:20.769
This is a constant
value right here.

00:04:20.769 --> 00:04:23.352
We're assuming that we can take
the derivative of our function

00:04:23.352 --> 00:04:27.210
and evaluate that thing at
0 to give a constant value.

00:04:27.210 --> 00:04:30.140
So if p prime of x is equal
to this constant value,

00:04:30.140 --> 00:04:33.420
obviously, p prime
of x evaluated at 0

00:04:33.420 --> 00:04:35.160
is going to be that value.

00:04:35.160 --> 00:04:39.390
But what's cool about
this right here,

00:04:39.390 --> 00:04:42.650
this polynomial that has a 0
degree term and a first degree

00:04:42.650 --> 00:04:48.550
term, is now this polynomial
is equal to our function at x

00:04:48.550 --> 00:04:49.730
is equal to 0.

00:04:49.730 --> 00:04:52.270
And it also has the
same first derivative.

00:04:52.270 --> 00:04:56.640
It also has the same
slope at x is equal to 0.

00:04:56.640 --> 00:04:59.824
So this thing will look,
this new polynomial

00:04:59.824 --> 00:05:01.740
with two terms-- getting
a little bit better--

00:05:01.740 --> 00:05:04.400
it will look
something like that.

00:05:04.400 --> 00:05:08.560
It will essentially have--
it'll look like a tangent line

00:05:08.560 --> 00:05:13.050
at f of 0, at x is equal to 0.

00:05:13.050 --> 00:05:17.860
So we're doing better, but still
not a super good approximation.

00:05:17.860 --> 00:05:20.510
It kind of is going in
the same general direction

00:05:20.510 --> 00:05:22.462
as our function around 0.

00:05:22.462 --> 00:05:24.170
But maybe we can do
better by making sure

00:05:24.170 --> 00:05:26.590
that they have the
same second derivative.

00:05:26.590 --> 00:05:29.480
And to try to have the same
second derivative while still

00:05:29.480 --> 00:05:33.480
having the same first derivative
and the same value at 0,

00:05:33.480 --> 00:05:38.170
let's try to do
something interesting.

00:05:38.170 --> 00:05:40.350
Let's define p of x.

00:05:40.350 --> 00:05:41.780
So let's make it clear.

00:05:41.780 --> 00:05:43.970
This was our first try.

00:05:43.970 --> 00:05:46.990
This is our second
try right over here.

00:05:46.990 --> 00:05:49.740
And I'm about to embark
on our third try.

00:05:49.740 --> 00:05:53.050
So in our third try, my goal is
that the value of my polynomial

00:05:53.050 --> 00:05:55.740
is the same as the value
of the function at 0.

00:05:55.740 --> 00:05:57.590
They have the same
derivative at 0.

00:05:57.590 --> 00:06:00.460
And they also have the same
second derivative at 0.

00:06:00.460 --> 00:06:03.280
So let's define my
polynomial to be

00:06:03.280 --> 00:06:05.290
equal to-- so I'm going
to do the first two

00:06:05.290 --> 00:06:07.560
terms of these guys
right over here.

00:06:07.560 --> 00:06:13.490
So it's going to be
f of 0 plus f prime

00:06:13.490 --> 00:06:17.280
of 0 times x, so exactly
what we did here.

00:06:17.280 --> 00:06:19.040
But now let me add another term.

00:06:19.040 --> 00:06:22.930
I'll do the other
term in a new color.

00:06:22.930 --> 00:06:24.560
And I'm going to
put a 1/2 out here.

00:06:24.560 --> 00:06:27.210
And hopefully it might make
sense why I'm about to do this.

00:06:27.210 --> 00:06:31.150
Plus 1/2 times the
second derivative

00:06:31.150 --> 00:06:36.150
of our function
evaluated at 0 x squared.

00:06:36.150 --> 00:06:38.090
And when we evaluate
the derivative of this,

00:06:38.090 --> 00:06:40.890
I think you'll see
why this 1/2 is there.

00:06:40.890 --> 00:06:46.170
Because now let's evaluate
this and its derivatives at 0.

00:06:46.170 --> 00:06:51.700
So if we evaluate p of 0, p of
0 is going to be equal to what?

00:06:51.700 --> 00:06:53.350
Well, you have
this constant term.

00:06:53.350 --> 00:06:55.770
If you evaluate it at 0,
this x and this x squared

00:06:55.770 --> 00:06:56.800
are both going to be 0.

00:06:56.800 --> 00:06:58.660
So those terms are
going to go away.

00:06:58.660 --> 00:07:01.860
So p of 0 is still
equal to f of 0.

00:07:01.860 --> 00:07:04.900
If you take the derivative
of p of x-- so let

00:07:04.900 --> 00:07:06.770
me take the
derivative right here.

00:07:06.770 --> 00:07:08.130
I'll do it in yellow.

00:07:08.130 --> 00:07:10.180
So the derivative
of my new p of x

00:07:10.180 --> 00:07:12.936
is going to be equal to-- so
this term is going to go away.

00:07:12.936 --> 00:07:13.810
It's a constant term.

00:07:13.810 --> 00:07:17.320
It's going to be
equal to f prime of 0.

00:07:17.320 --> 00:07:18.840
That's the coefficient on this.

00:07:18.840 --> 00:07:24.100
Plus-- this is the power
rule right here-- 2 times 1/2

00:07:24.100 --> 00:07:30.430
is just 1, plus f prime
prime of 0 times x.

00:07:30.430 --> 00:07:32.120
Take the 2, multiply
it times 1/2,

00:07:32.120 --> 00:07:34.620
and decrement that
2 right there.

00:07:34.620 --> 00:07:39.540
I think you now have a sense
of why we put the 1/2 there.

00:07:39.540 --> 00:07:42.590
It's making it so that we don't
end up with the 2 coefficient

00:07:42.590 --> 00:07:43.990
out front.

00:07:43.990 --> 00:07:46.630
Now what is p prime of 0?

00:07:46.630 --> 00:07:50.770
So let me write it right
here. p prime of 0 is what?

00:07:50.770 --> 00:07:53.020
Well, this term right here
is just going to be 0,

00:07:53.020 --> 00:07:55.780
so you're left with this
constant value right over here.

00:07:55.780 --> 00:07:58.310
So it's going to
be f prime of 0.

00:07:58.310 --> 00:08:01.150
So so far, our third
generation polynomial

00:08:01.150 --> 00:08:03.300
has all the properties
of the first two.

00:08:03.300 --> 00:08:07.940
And let's see how it does
on its third derivative,

00:08:07.940 --> 00:08:09.930
or I should say the
second derivative.

00:08:09.930 --> 00:08:13.370
So p prime prime of
x is equal to-- this

00:08:13.370 --> 00:08:15.566
is a constant, so
its derivative is 0.

00:08:15.566 --> 00:08:17.690
So you just take the
coefficient on the second term

00:08:17.690 --> 00:08:20.940
is equal to f prime prime of 0.

00:08:20.940 --> 00:08:24.840
So what's the second
derivative of p evaluated at 0?

00:08:24.840 --> 00:08:27.010
Well, it's just going to
be this constant value.

00:08:27.010 --> 00:08:30.120
It's going to be f
prime prime of 0.

00:08:30.120 --> 00:08:32.919
So notice, by adding
this term, now,

00:08:32.919 --> 00:08:38.150
not only is our polynomial value
the same thing as our function

00:08:38.150 --> 00:08:41.010
value at 0, its derivative
at 0 is the same thing

00:08:41.010 --> 00:08:42.711
as the derivative of
the function at 0.

00:08:42.711 --> 00:08:44.710
And its second derivative
at 0 is the same thing

00:08:44.710 --> 00:08:47.399
as the second derivative
of the function at 0.

00:08:47.399 --> 00:08:48.940
So we're getting
pretty good at this.

00:08:48.940 --> 00:08:51.350
And you might guess that
there's a pattern here.

00:08:51.350 --> 00:08:56.290
Every term we add, it'll allow
us to set up the situation so

00:08:56.290 --> 00:09:01.060
that the n-th derivative
of our approximation at 0

00:09:01.060 --> 00:09:03.080
will be the same thing
as the n-th derivative

00:09:03.080 --> 00:09:05.120
of our function at 0.

00:09:05.120 --> 00:09:07.200
So in general, if we
wanted to keep doing this,

00:09:07.200 --> 00:09:08.700
if we had a lot of
time on our hands

00:09:08.700 --> 00:09:12.540
and we wanted to just keep
adding terms to our polynomial,

00:09:12.540 --> 00:09:14.490
we could-- and let me
do this in a new color.

00:09:14.490 --> 00:09:16.330
Maybe I'll do it in a
color I already used.

00:09:16.330 --> 00:09:18.185
We could make our
polynomial approximation.

00:09:21.610 --> 00:09:24.830
So the first term, the constant
term, will just be f of 0.

00:09:24.830 --> 00:09:29.830
Then the next term will
be f prime of 0 times x.

00:09:29.830 --> 00:09:33.650
Then the next term
will be f prime

00:09:33.650 --> 00:09:38.440
prime of 0 times
1/2 times x squared.

00:09:38.440 --> 00:09:40.829
I just rewrote that in a
slightly different order.

00:09:40.829 --> 00:09:43.370
Then the next term, if we want
to make their third derivative

00:09:43.370 --> 00:09:49.340
the same at 0, would be
f prime prime prime of 0.

00:09:49.340 --> 00:09:50.840
The third derivative
of the function

00:09:50.840 --> 00:09:59.280
at 0, times 1/2 times 1/3,
so 1 over 2 times 3 times x

00:09:59.280 --> 00:10:00.490
to the third.

00:10:00.490 --> 00:10:01.640
And we can keep going.

00:10:01.640 --> 00:10:03.880
Maybe you you'll start
to see a pattern here.

00:10:03.880 --> 00:10:06.630
Plus, if we want to make
their fourth derivatives

00:10:06.630 --> 00:10:10.854
at 0 coincide, it would
be the fourth derivative

00:10:10.854 --> 00:10:11.520
of the function.

00:10:11.520 --> 00:10:13.390
I could put a 4 up
there, but this is really

00:10:13.390 --> 00:10:18.320
emphasizing-- it's the fourth
derivative at 0 times 1 over--

00:10:18.320 --> 00:10:19.550
and I'll change the order.

00:10:19.550 --> 00:10:21.300
Instead of writing it
in increasing order,

00:10:21.300 --> 00:10:28.710
I'll write it as 4 times 3
times 2 times x to the fourth.

00:10:28.710 --> 00:10:30.200
And you can verify
it for yourself.

00:10:30.200 --> 00:10:31.620
If we just had this
only, and if you

00:10:31.620 --> 00:10:33.420
were to take the fourth
derivative of this,

00:10:33.420 --> 00:10:35.800
evaluate it at 0,
it'll be the same thing

00:10:35.800 --> 00:10:39.630
as the fourth derivative of
the function evaluated at 0.

00:10:39.630 --> 00:10:42.150
And in general, you
can keep adding terms

00:10:42.150 --> 00:10:45.210
where the n-th term
will look like this.

00:10:45.210 --> 00:10:50.890
The n-th derivative of your
function evaluated at 0 times

00:10:50.890 --> 00:10:56.180
x to the n over n factorial.

00:10:56.180 --> 00:10:59.380
Notice this is the same
thing as 4 factorial.

00:10:59.380 --> 00:11:03.081
4 factorial is equal to 4
times 3 times 2 times 1.

00:11:03.081 --> 00:11:04.580
You don't have to
write the 1 there,

00:11:04.580 --> 00:11:06.300
but you could put it there.

00:11:06.300 --> 00:11:10.300
This right here is the same
thing as 3 factorial-- 3 times

00:11:10.300 --> 00:11:12.300
2 times 1.

00:11:12.300 --> 00:11:13.610
I didn't put the 1 there.

00:11:13.610 --> 00:11:16.650
This right here is the same
thing as 2 factorial, 2 times

00:11:16.650 --> 00:11:17.530
1.

00:11:17.530 --> 00:11:18.570
This is the same thing.

00:11:18.570 --> 00:11:20.694
We didn't write anything,
but you could divide this

00:11:20.694 --> 00:11:23.840
by 1 factorial, which
is the same thing as 1.

00:11:23.840 --> 00:11:25.650
And you can divide
this by 0 factorial,

00:11:25.650 --> 00:11:26.880
which also happens to be 1.

00:11:26.880 --> 00:11:29.120
We won't have to study
it too much over here.

00:11:29.120 --> 00:11:32.730
But this general series that
I've kind of set up right here

00:11:32.730 --> 00:11:34.660
is called the Maclaurin series.

00:11:37.530 --> 00:11:39.800
And you can approximate
a polynomial.

00:11:39.800 --> 00:11:42.290
And we'll see it leads to
some pretty powerful results

00:11:42.290 --> 00:11:43.280
later on.

00:11:43.280 --> 00:11:45.610
But what happens-- and I
don't have the computing power

00:11:45.610 --> 00:11:47.310
in my brain to draw
the graph properly--

00:11:47.310 --> 00:11:49.720
is that when only
the functions equal,

00:11:49.720 --> 00:11:51.120
you get that horizontal line.

00:11:54.480 --> 00:11:56.430
When you make the
function equal 0

00:11:56.430 --> 00:11:59.470
and their first
derivatives equal at 0,

00:11:59.470 --> 00:12:01.940
then you have something that
looks like the tangent line.

00:12:01.940 --> 00:12:03.850
When you add another
degree, it might

00:12:03.850 --> 00:12:06.490
approximate the polynomial
something like this.

00:12:06.490 --> 00:12:11.170
When you add another degree, it
might look something like that.

00:12:11.170 --> 00:12:13.860
And as you keep adding
more and more degrees, when

00:12:13.860 --> 00:12:15.360
you keep adding
more and more terms,

00:12:15.360 --> 00:12:17.250
it gets closer
and closer around,

00:12:17.250 --> 00:12:20.490
especially as you get
close to x is equal to 0.

00:12:20.490 --> 00:12:24.130
But in theory, if you add
an infinite number of terms,

00:12:24.130 --> 00:12:26.660
you shouldn't be able to do--
I haven't proven this to you,

00:12:26.660 --> 00:12:27.910
so that's why I'm saying that.

00:12:27.910 --> 00:12:29.590
I haven't proved it yet to you.

00:12:29.590 --> 00:12:31.600
But if you add an
infinite number of terms,

00:12:31.600 --> 00:12:33.870
all of the derivatives
should be the same.

00:12:33.870 --> 00:12:36.900
And then the function
should pretty much

00:12:36.900 --> 00:12:38.600
look like each other.

00:12:38.600 --> 00:12:41.880
In the next video, I'll do
this with some actual functions

00:12:41.880 --> 00:12:44.390
just so it makes a
little bit more sense.

00:12:44.390 --> 00:12:46.660
And just so you know,
the Maclaurin series

00:12:46.660 --> 00:12:48.920
is a special case
of the Taylor series

00:12:48.920 --> 00:12:50.657
because we're centering it at 0.

00:12:50.657 --> 00:12:52.240
And when you're doing
a Taylor series,

00:12:52.240 --> 00:12:53.900
you can pick any center point.

00:12:53.900 --> 00:12:58.710
We'll focus on the
Maclaurin right now.