WEBVTT
Kind: captions
Language: en
00:00:15.410 --> 00:00:20.260
Here, I want to discuss one common type of
problem where integration comes up: Finding
00:00:20.260 --> 00:00:23.640
the average of a continuous variable.
00:00:23.640 --> 00:00:27.590
This is a useful thing to know in its own
right, but what’s really neat is that it
00:00:27.590 --> 00:00:32.020
gives a completely different perspective for
why integrals and derivatives are inverses
00:00:32.020 --> 00:00:34.230
of one and other.
00:00:34.230 --> 00:00:40.510
Take a look at the graph of sin(x) between
0 and pi, which is half its period.
00:00:40.510 --> 00:00:44.130
What is the average height of this graph on
that interval?
00:00:44.130 --> 00:00:46.610
It’s not a useless question.
00:00:46.610 --> 00:00:51.550
All sorts of cyclic phenomena in the world
are modeled with sine waves: For example,
00:00:51.550 --> 00:00:56.770
the number of hours the sun is up per day
as a function of which-day-of-the-year-it-is
00:00:56.770 --> 00:00:58.850
follows a sine wave pattern.
00:00:58.850 --> 00:01:03.460
So if you wanted to predict, say, the average
effectiveness of solar panels in summer months
00:01:03.460 --> 00:01:08.780
vs. winter months, you’d want to be able
to answer a question like this: What’s the
00:01:08.780 --> 00:01:13.950
average value of that sine function over half
its period.
00:01:13.950 --> 00:01:19.259
Whereas a case like that will have all sorts
of constants mucking up the function, we’ll
00:01:19.259 --> 00:01:25.440
just focus on a pure unencumbered sin(x) function,
but the substance of the approach would be
00:01:25.440 --> 00:01:26.840
the same in any application.
00:01:26.840 --> 00:01:33.660
It’s kind of a weird thing to think about,
isn’t it, the average of a continuous variable.
00:01:33.660 --> 00:01:39.000
Usually, with averages, we think of a finite
number of values, where you add all them up
00:01:39.000 --> 00:01:44.580
and divide that sum by how many values there
are.
00:01:44.580 --> 00:01:50.860
But there are infinitely many values of sin(x)
between 0 and pi, and its not like we can
00:01:50.860 --> 00:01:54.550
add all those numbers and divide by infinity.
00:01:54.550 --> 00:01:58.490
This sensation actually comes up a lot in
math, and is worth remembering, where you
00:01:58.490 --> 00:02:04.040
have this vague sense that you want to add
together infinitely many values associated
00:02:04.040 --> 00:02:08.280
with a continuum like this, even though that
doesn’t really make sense.
00:02:08.280 --> 00:02:13.920
Almost always, when you get this sense, the
key will be to use an integral somehow.
00:02:13.920 --> 00:02:19.340
And to think through exactly how, a good first
step is usually to approximate your situation
00:02:19.340 --> 00:02:21.090
with some kind of finite sum.
00:02:21.090 --> 00:02:27.350
In this case, imagine sampling a finite number
of points, evenly spaced in this range.
00:02:27.350 --> 00:02:32.600
Since it’s a finite sample, you can find
the average by adding up all the heights,
00:02:32.600 --> 00:02:39.700
sin(x), at each one, and divide that sum by
the number of points you sampled, right?
00:02:39.700 --> 00:02:44.440
And presumably, if the idea of an average
height among all infinitely many points is
00:02:44.440 --> 00:02:49.340
going to make any sense at all, the more points
we sample, which would involve adding up more
00:02:49.340 --> 00:02:55.560
heights, the closer the average of that sample
should be to the actual average of the continuous
00:02:55.560 --> 00:02:57.610
variable, don’t you think?
00:02:57.610 --> 00:03:02.250
This should feel at least somewhat related
to taking an integral of sin(x) between 0
00:03:02.250 --> 00:03:07.620
and pi, even if it might not be clear at first
exactly how the two ideas will match up.
00:03:07.620 --> 00:03:13.360
For that integral, you also think of a sample
of inputs on this continuum, but instead of
00:03:13.360 --> 00:03:18.340
adding the height sin(x) at each one, and
dividing by how many there are, you add up
00:03:18.340 --> 00:03:25.610
sin(x)*dx where dx is the spacing between
the samples; that is, you’re adding little
00:03:25.610 --> 00:03:28.030
areas, not heights.
00:03:28.030 --> 00:03:33.330
Technically, the integral is not quite this
sum, it’s whatever that sum approaches as
00:03:33.330 --> 00:03:35.650
dx approaches 0.
00:03:35.650 --> 00:03:41.380
But it’s helpful to reason with respect
to one of these finite iterations, where you’re
00:03:41.380 --> 00:03:46.440
adding the areas of some specific number of
rectangles.
00:03:46.440 --> 00:03:52.319
So what you want to do is reframe this expression
for the average, this sum of the heights divided
00:03:52.319 --> 00:03:59.470
by the number of sampled points, in terms
of dx, the spacing between samples.
00:03:59.470 --> 00:04:05.060
If I tell you that the spacing between these
points is 0.1, for example, and you know that
00:04:05.060 --> 00:04:10.380
they range from 0 to pi, can you tell me how
many there are?
00:04:10.380 --> 00:04:17.020
Well, you can take that length of the interval,
pi, and divide it by the length of the space
00:04:17.020 --> 00:04:19.430
between each sample.
00:04:19.430 --> 00:04:25.030
If it doesn’t go in evenly, you’d round
down to the nearest integer, but as an approximation
00:04:25.030 --> 00:04:27.290
this is fine.
00:04:27.290 --> 00:04:32.890
So if we write the spacing between samples
as dx, the number of samples is pi/dx.
00:04:32.890 --> 00:04:41.030
So replacing the denominator with pi/dx here,
you can rearrange, putting the dx up top and
00:04:41.030 --> 00:04:42.660
distributing.
00:04:42.660 --> 00:04:49.370
But, think about what it means to distribute
that dx up top; it means the terms you’re
00:04:49.370 --> 00:04:56.800
adding all look like sin(x)*dx for the various
inputs x that you’re sampling, so that numerator
00:04:56.800 --> 00:04:59.500
looks exactly like an integral expression.
00:04:59.500 --> 00:05:05.490
And for larger and larger samples of points,
the average approaches the actual integral
00:05:05.490 --> 00:05:12.020
of sin(x) between 0 and pi, all divided by
the length of that range, pi.
00:05:12.020 --> 00:05:18.150
In other words, the average height of this
graph is this area divided by its width.
00:05:18.150 --> 00:05:22.540
On an intuitive level, and just thinking in
terms of units, that feels pretty reasonable,
00:05:22.540 --> 00:05:23.720
doesn’t it?
00:05:23.720 --> 00:05:27.520
Area divided by with gives you average height.
00:05:27.520 --> 00:05:31.250
So let’s actually compute this expression.
00:05:31.250 --> 00:05:36.160
As we saw, last video, to compute an integral
you need to find an antiderivative of the
00:05:36.160 --> 00:05:41.470
function inside the integral; some function
whose derivative is sin(x)
00:05:41.470 --> 00:05:49.510
And, if you’re comfortable with trig derivatives,
you know the derivative of cos(x) is -sin(x),
00:05:49.510 --> 00:05:55.400
so if you negate that, -cos(x) is the antiderivative
of sin(x).
00:05:55.400 --> 00:05:59.220
To gut check yourself on that, look at this
graph of -cos(x).
00:05:59.220 --> 00:06:07.520
At 0, the slope is 0, then it increases to
some maximum slope at pi/2, then it goes back
00:06:07.520 --> 00:06:14.410
down to 0 at pi, and in general its slope
does indeed seem to match the height of the
00:06:14.410 --> 00:06:18.199
sine graph.
00:06:18.199 --> 00:06:24.680
To evaluate the integral of sin(x) between
0 and pi, take that antiderivative at the
00:06:24.680 --> 00:06:29.600
upper bound, and subtract its value at the
lower bound.
00:06:29.600 --> 00:06:35.000
More visually, that’s the difference in
the height of this -cos(x) graph above pi,
00:06:35.000 --> 00:06:41.120
and its height at 0, and as you can see, that
change in height is exactly 2.
00:06:41.120 --> 00:06:43.639
That’s kind of interesting, isn’t it?
00:06:43.639 --> 00:06:48.770
That the area under this sine graph turns
out to be exactly 2.
00:06:48.770 --> 00:06:53.639
So the answer to our average height problem,
this integral divided by the width of the
00:06:53.639 --> 00:06:59.920
region, evidently turns out to be 2/pi, which
is around 0.64.
00:06:59.920 --> 00:07:05.900
I promised at the start that this question
of finding the average value of a function
00:07:05.900 --> 00:07:10.080
offers an alternate perspective on on why
integrals and derivatives are inverses of
00:07:10.080 --> 00:07:17.370
one and other; why the area under one graph
is related to the slope of another.
00:07:17.370 --> 00:07:23.240
Notice how finding this average value 2/pi
came down to looking at the change in the
00:07:23.240 --> 00:07:30.919
antiderivative -cos(x) over the input range,
divided by the length of that input range.
00:07:30.919 --> 00:07:36.259
Another way to think about that fraction is
as the rise-over-run slope between the point
00:07:36.259 --> 00:07:41.720
of the antiderivative graph below zero, and
the point of that graph above pi.
00:07:41.720 --> 00:07:47.610
Now think about why it might make sense that
this slope represents the average value of
00:07:47.610 --> 00:07:50.509
sin(x) on that region.
00:07:50.509 --> 00:07:56.710
By definition, sin(x) is the derivative of
this antiderivative graph; it gives the slope
00:07:56.710 --> 00:07:59.760
of -cos(x) at every input.
00:07:59.760 --> 00:08:04.800
So another way to think about the average
value sin(x) is as the average slope over
00:08:04.800 --> 00:08:09.370
all tangent lines here between 0 and pi.
00:08:09.370 --> 00:08:14.310
And from that view, doesn’t it make a lot
of sense that the average slope of a graph
00:08:14.310 --> 00:08:19.500
over all its point in a certain range should
equal the total slope between the start and
00:08:19.500 --> 00:08:23.650
end point?
00:08:23.650 --> 00:08:28.400
To digest this idea, it helps to see what
it looks like for a general function.
00:08:28.400 --> 00:08:34.079
For any function f(x), if you want to find
its average value on some interval, say between
00:08:34.079 --> 00:08:40.190
a and b, what you do is take the integral
of f on that interval, divided by the width
00:08:40.190 --> 00:08:43.199
of the interval.
00:08:43.199 --> 00:08:47.020
You can think of this as taking the area under
the graph divided by the width.
00:08:47.020 --> 00:08:52.899
Or more accurately, it’s the signed area
of that graph, since area below the x-axis
00:08:52.899 --> 00:08:55.670
is counted as negative.
00:08:55.670 --> 00:08:58.720
And take a moment to remember the connection
between this idea of a continuous average
00:08:58.720 --> 00:09:03.279
and the usual finite notion of an average,
where you add up many numbers and divide by
00:09:03.279 --> 00:09:05.230
how many there are.
00:09:05.230 --> 00:09:10.990
When you take some sample of points spaced
out by dx, the number of samples is about
00:09:10.990 --> 00:09:13.679
the length of the interval divided by dx.
00:09:13.679 --> 00:09:20.170
So if you add up the value of f(x) at each
sample and divide by the total number of samples,
00:09:20.170 --> 00:09:26.749
it’s the same as adding up the products
f(x)*dx and dividing by the width of the entire
00:09:26.749 --> 00:09:28.249
interval.
00:09:28.249 --> 00:09:32.379
The only difference between that and the integral
expression is that the integral asks what
00:09:32.379 --> 00:09:37.339
happens as dx approaches 0, but that just
corresponds with samples of more and more
00:09:37.339 --> 00:09:41.660
points that approximate the true average increasingly
well.
00:09:41.660 --> 00:09:48.940
Like any integral, evaluating this comes down
to finding an antiderivative of f(x), commonly
00:09:48.940 --> 00:09:50.550
denoted capital F(x).
00:09:50.550 --> 00:09:58.970
In particular, what we want is the change
to this antiderivative between a and b, F(b)
00:09:58.970 --> 00:10:04.570
- F(a), which you can think of as the change
in the height of this new graph between the
00:10:04.570 --> 00:10:05.879
two bounds.
00:10:05.879 --> 00:10:11.179
I’ve conveniently chosen an antiderivative
which passes through 0 at the lower bound
00:10:11.179 --> 00:10:16.310
here, but keep in mind that you could freely
shift this up and down, adding whatever constant
00:10:16.310 --> 00:10:21.360
you want to it, and it would still be a valid
antiderivative.
00:10:21.360 --> 00:10:26.550
So the solution to the average problem is
the change in the height of this new graph
00:10:26.550 --> 00:10:30.389
divided by the change to its x value between
a and b.
00:10:30.389 --> 00:10:37.199
In other words, it’s the slope of the antiderivative
graph between these endpoints.
00:10:37.199 --> 00:10:44.870
And again, that should make a lot of sense,
because little f(x) gives the slope of a tangent
00:10:44.870 --> 00:10:50.870
line to this graph at each point, after all
it is by definition the derivative of capital
00:10:50.870 --> 00:10:56.389
F.
So, why are antiderivative the key to solving
00:10:56.389 --> 00:10:57.389
integrals?
00:10:57.389 --> 00:11:03.019
Well, my favorite intuition is still the one
I showed last video, but a second perspective
00:11:03.019 --> 00:11:09.190
is that when you reframe the question of finding
the average of a continuous value as finding
00:11:09.190 --> 00:11:14.959
the average slope of bunch of tangent lines,
it lets you see the answer just by the comparing
00:11:14.959 --> 00:11:23.379
endpoints, rather than having to actually
tally up all points in between.
00:11:23.379 --> 00:11:27.389
In the last video, I described a sensation
that should bring integrals to your mind.
00:11:27.389 --> 00:11:31.679
Namely, if you feel like the problem you’re
solving could be approximated by breaking
00:11:31.679 --> 00:11:36.709
it up somehow, and adding up a large number
of small things.
00:11:36.709 --> 00:11:41.170
Here I want you to come away recognizing a
second sensation that should bring integrals
00:11:41.170 --> 00:11:42.230
to your mind.
00:11:42.230 --> 00:11:48.220
If there’s some idea that you understand
in a finite context, and which involves adding
00:11:48.220 --> 00:11:53.269
up multiple values, like taking the average
of a bunch of numbers, and if you want to
00:11:53.269 --> 00:11:59.319
generalize that idea to apply to an infinite
continuous range of values, try seeing if
00:11:59.319 --> 00:12:01.910
you can phrase things in terms of an integral.
00:12:01.910 --> 00:12:08.110
It’s a feeling that comes up enough that’s
it’s definitely worth remembering.
00:12:08.110 --> 00:12:12.189
My thanks, as always, to those making these
videos possible.