Download as xls, pdf, or txt
Download as xls, pdf, or txt
You are on page 1of 3

Integration by Simpson's 3-Point Rule

This spreadsheet has a general program for numerical integration by Simpson's 3-point rule. The
user inputs the upper bounds, the lower bounds and number of intervals. A greater interval number
increases the accuracy. The spreadsheet also has an example calculated with just a spreadsheet
calculation to demonstrate what the program is doing. The general formula for Simpsons rule is:

UB
n
f (x )dx=i=2,4,6 . .. ( h/3)( xi 2 +4x i1+x i )
LB

Where,

LB = Lower bounds of integration


UB = Upper bounds of integration
X= Independent variable
n= number of intervals
h= step size
i= index for the interval
Simpson's Rule Program

This sheet uses a general purpose macro for Simpsons Rule 3-pt. Integration

Input
Example: f(x) = X2+2X-0.15
lower bounds = 0.00 input values in the yellow-shaded cells
Upper bounds = 2.4
number of increments= 12
h= 0.2 calculated step size

Calculation

The "change function" button takes you to the location in the macro to change the function.
Close window when complete. The "integrate function" button actives the integration program.

Change Function Integrate Function

Results

area under curve = 10.008 by VBA program


Example Sheet

This sheet shows a demonstration example calculated out using only the spreadsheet

Example: f(x) = X2+2X-0.15


lower bounds = 0.00
Upper bounds = 2.4
number of increments 12
h= 0.2

i x f(x) Trapazoidal Simpson Simpson


Rule 3 pt. 4 pt
0 0 -0.15
1 0.2 0.29 0.014
2 0.4 0.81 0.11 0.121333
3 0.6 1.41 0.222 0.342
4 0.8 2.09 0.35 0.569333
5 1 2.85 0.494
6 1.2 3.69 0.654 1.145333 1.494
7 1.4 4.61 0.83
8 1.6 5.61 1.022 1.849333
9 1.8 6.69 1.23 3.078
10 2 7.85 1.454 2.681333
11 2.2 9.09 1.694
12 2.4 10.41 1.95 3.641333 5.094

area= 10.0240 10.0080 10.0080

compares to an analytic solution of: 10.0080

You might also like