Math 4B -- Lab 4
Simpson’s Rule Using Microsoft Excel
1. Simpson’s Rule approximates an integral by the formula

It is most easily evaluated using a table, after some preliminary calculations.
2. Example:
To estimate
manually, using
4 subintervals:
a. Note that a = 2, b = 3, N = 4
b. Calculate Dx
=
= 1/4 and the factor
= 1/12
c. Build
the following table. Start the first row
with x = a and add dx to get each new entry in the
x column. Use a calculator to get the other quantities.
|
dx |
x |
f(x) |
multiplier |
product |
(b-a)/3N |
integral |
|
.25 |
2 |
16 |
1 |
16.0000 |
|
|
|
|
2.25 |
25.6289 |
4 |
102.5156 |
|
|
|
|
2.5 |
39.0625 |
2 |
78.1250 |
|
|
|
|
2.75 |
57.1914 |
4 |
228.7656 |
|
|
|
|
3 |
81 |
1 |
81.0000 |
|
|
|
Sum: |
|
|
|
506.4062 |
.08333333 |
42.2005 |
3. To get the same table using Microsoft Excel, you will enter the first few numbers and you will enter
formulas to calculate the other boxes on the top line or two. Your steps:
a. Open Microsoft Excel. You may use either an IBM or a Mac computer.
b. Make the following table entries (but do not type the column numbers or row letters).
|
|
A |
B |
C |
D |
E |
F |
G |
|
1 |
dx |
x |
f(x) |
multiplier |
product |
(b-a)/3N |
integral |
|
2 |
.25 |
2 |
=B2^4 |
1 |
=C2*D2 |
|
|
|
3 |
|
=B2+$A$2 |
|
4 |
|
|
|
|
4 |
|
|
|
2 |
|
|
|
|
5 |
|
|
|
4 |
|
|
|
|
6 |
|
|
|
1 |
|
|
|
(1) Cells that start with = symbols are
formulas. The codes (A6, B7, etc.) are
the cells
that contain the
information. For example, cell B3 will
add the numbers that appear in cells
B2 and A2. (We’ll explain the $ symbols later)
(2) Notice that when you finish entering a
formula, Excel automatically calculates the numerical
result of the
formula. To review the formula, move to
the cell and observe the formula in the
formula bar near the top
of the screen.
(3) If any cell contains ######, the column is
not wide enough. Select the column
letter (to
highlight the whole
column), and select menu entries FORMAT...COLUMN...AUTO FIT
SELECTION.
c. Next, fill in the formulas for the rest of columns B, C and E. Here’s how you do it:
(1) Highlight the cell with the formula.
(2) Move the cursor to the lower
right corner (the “handle”) of the highlighted region
until the cursor changes
to a solid symbol. Click and hold the mouse button.
(3)
Note the instruction at the bottom of the screen: “Drag outside selection to extend series or
fill.” Continue to hold the mouse button, and
drag the cursor slowly downward and slightly
to the right until all
the rows down to row 6 are highlighted.
(4) Release the mouse button. Excel will fill the entire column.
(5) To read or edit the formulas in any cell,
select the cell. You will be able to read (or edit) the
formula in the
formula box near the top of the screen.
What is the formula in cell B6? ________________________________
Compare this with the formula in cell B3; what cell reference changed? _______________
What cell reference stayed the same? __________________________________________
What is the purpose of a $ in the cell reference? __________________________________
d. Now fill in the formulas for the sum of column E as well as (b-a)/3N and the final area estimate.
(1) Cell E7: Formula is =SUM(E2:E6)
(2) Cell F7: Formula is =A2/3 Why is this (b-a)/3N? _____________________________
(3) Cell G7: Formula is =E7*F7 What is the area estimate? _________________________
e. Print the table.
4. Now for a
full-blown Simpson’s Rule problem. Use
the method above to estimate
using N = 20.
a.
You will have to type p as PI()
That’s right: include an empty parenthesis after the word PI.
b.
The bottom row will be on a different row (not row 6 or 7). You need to continue until you last “x” is
the decimal equivalent of p/2
c.
Type your name at the bottom of your completed table. Print the table, and circle the area estimate
on the printout.
Return to: Merced College; Don Power Updated 7/10/06 by Don Power