HP Forums

Full Version: (38G) Midpoint Rule
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
An excerpt from Appendix E: Graphing Utility Programs, Applied Calculus 6e (Larson);

Programs for graphing calculators are referenced in several sections in the text. This appendix contains translations of these programs for the TI-82, TI-83, TI-85, TI-86, TI-89, TI-92, Casio CFX-9850G, HP 38G, and Sharp EL 9200/9300, arranged by calculator model. Similar programs can be written for other brands and models of graphing calculators.
Enter a program in your calculator, then refer to the text discussion and apply the program as appropriate.


Midpoint Rule

This program uses the Midpoint Rule to approximate the definite integral ab ƒ(x) dx. Enter both programs into the calculator. Store the expression ƒ(x) dx in the F1 function in the Function aplet. Be sure F1 is checked. The program itself will prompt you for the limits a and b and for the number of subintervals η.

MIDPOINT PROGRAM
INPUT A;“ENTER LOWER LIMIT”; “ENTER A”;“ ”; 1:
INPUT B;“ENTER UPPER LIMIT”; “ENTER B”;“ ”; 1:
INPUT N;“N DIVISIONS”; “ENTER N”; “ ”; 1:
0►S:
(B-A)/N►W:
1►J:
WHILE JN
REPEAT RUN “MDPTLOOP”
END:
ERASE:
DISP 3; “APPROXIMATION”:
DISP 5; S:
FREEZE:

MDPTLOOP PROGRAM
A+(J-1)*W►L:
A+J*W►R:
(L+R)/2►X:
S+W*F1(X) ►S:
J+1►J

BEST!
SlideRule
(fixed 'typo')
Reference URL's