Introduction
This program computes left, right, Trapezoid, Midpoint, and
Simpson's approximations for
.
If you have not used one of the programs posted on this website before,
you should read through
the information in the Intro to Programming
section first.
If you have a TI Connectivity Cable, you can download the program main.allsums.89p
The Program
| :allsums( ) | {This will already appear if you named the program allsums} |
| :Prgm | {This will already appear} |
| :Clr IO | {Clr IO is in the CATALOG menu} | is STO}
| :Lbl p | {Lbl is in the CATALOG menu} |
| :Local a,b,n | {Local is in the F4 menu} |
| :Input "a=", a | {Input is in the F3 menu} |
| :Input "b=", b | |
| :Input "n=", n | |
| :(b-a)/n |
|
| :a |
|
| :0 |
{The 0 is a zero}{The l is a lowercase L} |
| :0 |
{The 0 is a zero} |
| :For j,1,n | {For EndFor is in the F2 menu}{The 1 is a one} |
| :l+y1(x)*h |
(The l is a lowercase L} {y1 is the Y button followed by a 1} |
| :m+y1(x+h/2)*h |
{* is the times button} |
| :x+h |
|
| :EndFor | |
| :l+y1(b)*h |
{The l is a lowercase L} |
| :r-y1(a)*h |
|
| :(l+r)/2 |
{The l is a lowercase L} |
| :(2*m+t)/3 |
|
| :Disp "L R T M S" | {Disp is in the F3 menu} |
| :Disp l | (The l is a lowercase L} |
| :Disp r | |
| :Disp t | |
| :Disp m | |
| :Disp s | |
| :Pause | {Pause is in the CATALOG menu} |
| :Goto p | {Goto is in the CATALOG menu} |
| :EndPrgm | {This will already appear} |
Running the Program
You will need to enter a function f(x) into y1 before running
the program. The program will ask for values of A, B, and N (number of
subdivisions).
To test the program try the following:
f(x) = x2+ 3,
A=1, B=4, N=20.
Your answer will be
L R T M S
28.88625
31.13625
30.01125
29.994375
30