Spreadsheets and Riemann Sums

These instructions will help you use a spreadsheet program (e.g. Microsoft Excel or OpenOffice) to approximate the area under a curve.

Think about the space between the graph of the function *f(x) =
x ^{2}*, the

- Start your spreadsheet software. Often you can do this by using the
**Start**menu to look at available**Programs**, then by choosing**Microsoft Office -> Excel**. - Put a text label "x" in cell A1 and label "f(x)" in cell B1 by clicking in the cells and typing.
- Fill in column A with values of
*x*between 0 and 1. For your first approximation you should use 0, .2, .4, .6, .8 and 1. These will be the values we input to the function, and the points (0,0), (.2, 0), (.4, 0), (.8,0) will be the lower left hand corners of the rectangles we use to approximate the area under the graph. - Fill in column B with the corresponding values of
*f(x)*as follows:- Click on cell B2.
- Type
**= A2*A2**and hit enter. (A zero should appear in cell B2.) - Select cells B2 through B7 by clicking and dragging. Usually, the cells will be highlighted in some color or outlined when you've done this correctly.
- Select
**Fill -> Down**from the**Edit**menu.

- Label cell C1 "Areas". The areas of the rectangles used to approximate the triangular shape will go in column C.
- In cell C2, type
**= (A3-A2)*B2**and hit enter. This will fill cell C2 with the area of the rectangle with lower left corner (0, 0), lower right corner (0, .2), and height*f(0) = 0*. Not surprisingly, a rectangle with height 0 has area 0. - Select cells C2 through C6 and use the
**Fill**command to fill in the rest of the rectangle areas. (If you accidentally select cell C7 you may get a nonsense entry in that cell.)**Take a second to think about your results. The numbers listed in column C are the areas of rectangles that fit under the graph of the function***f(x) = x*. This means that the area under the graph of the function is probably just a little bit more than the sum of those areas because some of the space under the curve was not covered by rectangles.^{2} - Label cell D1 "Sum".
- In cell D2 type
**= SUM(C2:C6)**and hit enter. Cell D2 should now show the sum of the areas of the rectangles (0.24). - Save your document so that you can come back to it later.

"A little more than 0.24" is a much better estimate than "less than
one half". You can improve this answer still further by making your
rectangles thinner. To compute a new estimate using areas of
rectangles with width .05 units, type **= A2 + .05** in cell A3 and
**Fill** down to cell A22, then fill columns B and C down to cells
B22 and C21 and set cell D2 to **= SUM(C2:C21)**.

**Question 1:** What estimate of the area under the graph of *f(x) = x ^{2}* do you get if you sum the areas of 20 rectangles with base width .05 units (as described above)?

**Question 2:** Your estimate in Question 1 should have been
different from 0.24. Explain the difference between the two
estimates. Which is more accurate? Why? Is the new estimate larger
or smaller than the old estimate? Is it larger or smaller than the
exact value of the area?

**Question 3:** What do you think the actual area is?

**Question 4:** If you have time, estimate the area again with even thinner rectangles. What base width did you use and what area estimate did you get?

Later, we'll be able to use calculus to find the exact area and
check our work. However, for some functions (like the famous
statistics function *g(x) = e ^{-x2}*) it is
impossible to compute an exact integral! For functions like these you
must use a tool like a calculator or spreadsheet to estimate the area.
Those tools use methods very similar to our method of adding areas of
rectangles.

**Extra Credit:** (Turn in a printout of your spreadsheet to add
up to 1 point to your final grade.) What is the area between the
graph of the function *g(x) = e ^{-x2}*, the