Numerical Integration:
This program uses Simpson's method to estimate the definite integral of a function. You must
enter the function in Y1 before running the program.
PROGRAM:SIMPSON
:INPUT "LOWER LIMIT=",A
:INPUT "UPPER LIMIT=",B
:INPUT "N DIVISIONS=",D
:0->S
:(B-A)/(2*D)->W
:FOR(J,1,D,1)
:A+2(J-1)W->L
:A+2JW->R
:(L+R)/2->M
:W(Y1(L)+4y1(M)+Y1(R))/3+S->S
:END
:DISP "AREA="
:DISP S