Riemann Sum Examples

Here are examples showing the calculation of Riemann sums. Click a link in this list to jump to the example you want:


TI-83 Example: Find left and right Riemann sums using 200 subintervals for the function f(x) = 4/(1+x2) on the interval [0,1].

Solution: Since the length of the interval is 1, we have delta x = 1/200.

For the left Riemann sum, we want to add up (1/200) times the sum of 4/(1+x2) evaluated at

x = 0,    x = 1/200,    x = 2/200,    . . .,  x = 199/200.

This is a perfect job for seq( and sum( on the calculator. The expression we want to evaluate is

(1/200)*sum(seq(4/(1+X^2),X,0,199/200,1/200))
(Read this as "One over two hundred times the sum of 4/(1+X2) as X goes from zero to 199/200 in increments of 1/200.")

To enter sum(, we press [2nd] [LIST] [->] [->] (right-arrow twice, to get the MATH menu) and [5].

To enter seq(, we press [2nd] [LIST] [->] and [5]. We then type in the rest of the expression above, using the ordinary keyboard keys, and finishing off with two right parentheses.

(1/200)*sum(seq(
4/(1+X^2),X,0,19
9/200,1/200))
     3.146588487



When we hit [ENTER], the calculator spends about five seconds thinking things over, and then produces an answer. The screen looks like this:


For the right Riemann sum, we want to use pretty much the same expression, but with values of X going from 1/200 to 2 instead of from 0 to 199/200. The expression we want to evaluate is

(1/200)*sum(seq(4/(1+X^2),X,1/200,1,1/200))

4/(1+X^2),X,0,19
9/200,1/200))
     3.146588487
(1/200)*sum(seq(
4/(1+X^2),X,1/20
0,1,1/200))
     3.136588487
To save the trouble of typing in the whole expression again, we press [2nd] [ENTRY] and then use the arrow keys along with [DEL] and [2nd]  [INS] to edit the previous entry. When we press [ENTER] the calculator ponders the problem for a few seconds, and then produces an answer. The screen looks like this:
We conclude that the area A under the curve y=4/(1+x2) between x=0 and x=1 satisfies

3.136588487 < A < 3.146588478.

Comment: This method uses the TI-83's LIST data type, and TI-83 lists are limited to 999 entries. So for Riemann sums that involve more than 999 terms, we'd have to use another method (probably involving writing a program) or another machine.


TI-85 Example: Find left and right Riemann sums using 2000 subintervals for the function f(x) = 4/(1+x2) on the interval [0,1].

Solution: Since the length of the interval is 1, we have delta x = 1/2000.

For the left Riemann sum, we want to add up (1/2000) times the sum of 4/(1+x2) evaluated at

x = 0,    x = 1/2000,    x = 2/2000,    . . .,  x = 199/2000.

We use the seq( and sum( functions on the calculator. The expression we want to evaluate is

(1/2000)*sum(seq(4/(1+x^2),x,0,1999/2000,1/2000))

The sum and seq commands are in the LIST menu, under the sub-menu OPS. To find them, we press [2nd] [LIST] [OPS] [MORE] and [5]. With sum and seq on the screen menu, it's a snap to type in the expression above.

(1/2000)*sum seq(4/(1
+x^2),x,0,1999/2000,1
/2000)
        3.14209261192



When we hit [ENTER], the calculator grinds away at the problem for almost a minute, and then produces an answer. Here's the resulting screen (minus the menu-related stuff at the bottom):


For the right Riemann sum, we want to use the same expression, but with values of x going from 1/2000 to 2 instead of from 0 to 1999/2000. Here's what we want to evaluate:

(1/2000)*sum seq(4/(1+x^2),x,1/2000,1,1/2000))

(1/2000)*sum seq(4/(1
+x^2),x,0,1999/2000,1
/2000)
        3.14209261192
(1/2000)*sum seq(4/(1
+x^2),x,1/2000,1,1/20
00)
        3.14109261192
To save the trouble of typing in the whole expression again, we press [2nd] [ENTRY] and then use the arrow keys along with [DEL] and [2nd]  [INS] to edit the previous entry. When we press [ENTER] the calculator thinks for a while, and then produces an answer. The screen looks like this:
We conclude that the area A under the curve y=4/(1+x2) between x=0 and x=1 satisfies

3.14109261192 < A < 3.14209261192.

Comments:

  1. The TI-85 doesn't seem to have a hard limit on the length of a list, but it will run out of memory if you try to make use too many subintervals. My TI-85 tends to choke on lists with more than about 2380 elements.

  2. The average of the lower and upper bound we have determined should be a pretty good estimate of the area under the curve. What is it?


Excel Example: Find the left and right Riemann sums using 20 subintervals for the function 1/(1+x3) on the interval [1,3].

Solution: We begin by opening a Workbook document in Excel. Usually an untitled workbook comes up automatically when Excel starts.

Since the length of our interval is 2 and we want 20 subintervals, we get delta x = 0.1. In fact, it's not hard to see that we'll want to have the x values

x = 1,    x = 1.1,    x = 1.2,    .   .   . ,    x = 3.

To get these values into the worksheet, we type 1 into cell A1 and 1.1 into cell A2. We then use the mouse to highlight cells A1 and A2.

Next we very carefully pick up the small black square in the lower right corner of the highlight box and drag it down column A to cell A21. Column A magically fills with the numbers 1, 1.1, 1.2, and so on.

To evaluate our function at all these points along the x-axis, we enter the function in cell B1. To do this, we highlight cell B1 and then type

=1/(1+A1^3)
followed by [Return]. Cell B1 should now show the value of our function at x=1. (That value is 0.5.)

Next we highlight cell B1 and then very carefully pick up the small black square in its lower right corner, and drag it down the column to cell B21. Column B magically fills with the values of our function at the points named in column A.

The left Riemann sum is equal to 0.1 times the sum of the entries in cells B1 through B20. To compute this, we choose an empty cell somewhere, highlight it, and then type

=0.1*sum(B1:B20)
followed by return. (To dress things up, we could move to an adjacent cell, and type in an identifier for this number, such as "Left[10]".)

The right Riemann sum is equal to 0.1 times the sum of the entries in cells B2 through B21. To compute this, we choose another empty cell, highlight it, and then type

=0.1*sum(B2:B21)
followed by return. Here's what the worksheet looks like when we have finished:
    A B C D
1 1 0.5 Left[10]: 0.171305
2 1.1 0.429000429 Right[10]: 0.148091
3 1.2 0.366568915   
4 1.3 0.312793244   
5 1.4 0.267094017   
6 1.5 0.228571429   
7 1.6 0.196232339   
8 1.7 0.169118891   
9 1.8 0.146370023   
10 1.9 0.127242652   
11 2 0.111111111   
12 2.1 0.097456388   
13 2.2 0.085851648   
14 2.3 0.075947444   
15 2.4 0.067458176   
16 2.5 0.060150376   
17 2.6 0.053832903   
18 2.7 0.048348886   
19 2.8 0.043569188   
20 2.9 0.039387136   
21 3 0.035714286   

The left Riemann sum is 0.171305 and the right Riemann sum is 0.148091.