00:01
I'll start off by describing the concept of a riemann sum.
00:06
So the riemonsum is a way of approximating the area under a curve, f of x, from one end to another, a to b, so it is a finite region.
00:22
And the idea is to break up the x axis into an even number of rectangles.
00:28
So let's say that, just for the sake of argument, we're going to use two rectangles.
00:40
So what you would do is you would make columns or rectangles with a base that is determined by the range of the variable x, b minus a, in this case, divided by two.
00:58
So let's just break up that region into two individual pieces.
01:02
So that is going to be the base of your rectangle.
01:06
The height of the rectangle of each rectangle is evaluated by the function at some point xi that's in the interval.
01:21
So we have two intervals here, one and two.
01:27
And really, the only rule is that each xi should be inside that interval to evaluate the function.
01:35
But in general, the three most consistent rules are to choose the right endpoint, and i'll show that.
01:42
There you pick x1 right on that curve at the right edge of the rectangle, and the same with the second interval x2.
01:59
So xi can be at the right edge or the left or the left, or here.
02:14
Right in the middle, or even a random point in each interval, i guess you would call it, or partition.
02:34
However you want to call the base chopping up that region into even pieces.
02:39
But the bases are even, and then you do something reasonable.
02:44
And the reason why you might choose the midpoint is if you have a monotonically increasing function, the right end point will overestimate the area.
02:55
The left end point will underestimate.
02:58
And so you may want to choose the average or choose the midpoint, etc.
03:07
So let's take a look at an example of how you would implement the rhyme and sum, but the rhyme and sum is basically the base times the height of each rectangle all added together.
03:20
So the heights are going to be what changes.
03:23
The bases are all the same.
03:29
And then so you just add up all the heights of each point that you pick in that grid.
03:40
Okay, so let's take a look at an example.
03:43
I usually like to use an excel spreadsheet to do the calculations because otherwise you make a mistake...