This program is Copyright © 1978 by HewlettPackard and is used here by permission. This program was originally published in "HP33E Mathematics Applications".
This program is supplied without representation or warranty of any kind. HewlettPackard Company and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.
Let x_{0}, x_{1}, . . ., x_{n} be equally spaced points such that x_{i} = x_{0} + ih for i = 1, 2, . . ., n at which corresponding values f(x_{0}), f(x_{1}), . . ., f(x_{n}) of the function f(x) are known. The function itself need not be known explicitly but if it is, these values can be found previously by writing the function into memory and evaluating at the various points. n must be an even positive integer.
_{(x0..xn)}f(x) dx ~ h/3[f(x_{0}) + 4f(x_{1}) + 2f(x_{2}) + ... + 4f(x_{n3}) 2f(x_{n2}) + 4f(x_{n1}) +f(x_{n})]
Let the solution be indicated by I.
Step 
Instructions 
Input Data/Units 
Keys 
Output Data/Units 
1 
Enter program 

2 
Store increment 
h 
STO 0 

3 
Enter first function value  f(x_{0}) 
GSB 01 
Partial sum 
4 
Enter last function value  f(x_{n}) 
R/S 
Partial sum 
5 
Enter values i = 1, 2, ..., n2 
f(x_{i}) 
R/S 
Partial sum 
6 
Enter value i = n1 
f(x_{n1}) 
R/S 
I 
Compute _{(0..pi)} sin^{2} x dx using Simpson's rule with h = pi/8.
The following data must be found first:
i 
0 
1 
2 
3 
4 
5 
6 
7 
8 
x_{i} 
0 
pi/8 
pi/4 
3pi/8 
pi/2 
5pi/8 
3pi/4 
7pi/8 
pi 
f(x_{i}) 
0 
0.1464 
0.5 
0.8536 
1 
0.8536 
0.5 
0.1464 
0 
Solution:
_{(0..pi)}
sin^{2} x dx ~ 1.5708
Keystrokes Display g pi 8 ÷ STO 0 0 GSB 01 0.0000 0 R/S 0.0000 0.1464 R/S 0.5 R/S 0.8536 R/S 1 R/S 0.8536 R/S 0.5 R/S 0.1464 R/S 1.5708
LINE CODE KEYS 00 f CLEAR PRGM 01 24 3 RCL 0 02 3 3 03 71 ÷ 04 23 0 STO 0 05 61 x 06 23 1 STO 1 07 74 R/S 08 12 18 GSB 18 09 74 R/S 10 4 4 11 61 x 12 12 18 GSB 18 13 74 R/S 14 2 2 15 61 x 16 12 18 GSB 18 17 13 09 GTO 09 18 24 0 RCL 0 19 61 x 20 23 51 1 STO + 1 21 24 1 RCL 1 22 15 12 g RTN
R0 h/3 R1
Go back to the software library
Go back to the main exhibit hall