LEFT RIGHT SUMS - TI 81

Introduction
This program computes left and right hand approximations for  $\int\limits_a^bf(x)dx$. It also includes the average of the approximations.
 
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.


The Program
:Disp "A" {Disp is in PRGM under I/O}
:Input A {Input is in PRGM under I/O}
:Disp "B"
:Input B
:Disp "N"
:Input N
:(B-A)/N$\to$H {The arrow is STO}
:A$\to$
:0$\to$ {The 0 is a zero} 
:1$\to$ {The 1 is a one}
:Lbl 1  {Lbl is in PRGM under CTL}
:L+Y1*H$\to$ {Y1 is in Y-VARS under FUNCTION} {The * is the times sign}
:X+H$\to$
:IS>(J,N)  {IS> is in PRGM under CTL}
:Goto 1  {Goto is in PRGM under CTL}
:B$\to$
:L+Y1*H$\to$
:A$\to$
:R-Y1*H$\to$
:(L+R)/2$\to$
:Disp "LEFT RIGHT AVG"       {Disp is in PRGM under I/O} { " is on the + button}
:Disp L 
:Disp R 
:Disp T 


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
LEFT RIGHT AVG
28.88625
31.13625
30.01125