TI-85 Program: Computing regular Riemann sums


This is a program for the TI-85 which will compute Riemann sums for regular partitions of arbitrary length taking either the right endpoint, the left endpoint or the midpoint of the subintervals as xi*.

To use this program, you input a formula for the integrand function F(x), values for the lower and upper limits A and B, and the length n of the partition. You will be prompted to input either R, L or M to identify which choice to use for xi*.

:Disp "Riemann sums for regular partitions 
  using right or left endpoints or midpoint"
:Disp""
:InpSt "F(x)= ",FCN
:St>Eq(FCN,F)
:Input "a= ",A
:Input "b= ",B
:ClLCD
:Disp "right,left,mid"
:InpSt "R,L,M: ",C
:Disp ""
:
:If C=="R"
:Goto RIGHT
:If C=="L"
:Goto LEFT
:Goto MID
:
:Lbl RIGHT
:0->SR
:Input "n= ",N
:For(J,1,N,1)
:evalF(F,x,A+J*(B-A)/N)*(B-A)/N->FJ
:SR+FJ->SR
:End
:Disp "right Riemann sum is "
:Disp SR
:Pause
:Goto RIGHT
:
:Lbl LEFT
:0->SL
:Input "n= ",N
:For(J,1,N,1)
:evalF(F,x,A+(J-1)*(B-A)/N)*(B-A)/N->FJ
:SL+FJ->SL
:End
:Disp "left Riemann sum is "
:Disp SL
:Pause
:Goto LEFT
:
:Lbl MID
:0->SM
:Input "n= ",N
:For(J,1,N,1)
:evalF(F,x,A+(2*J-1)*(B-A)/(2*N))*(B-A)/N->FJ
:SM+FJ->SM
:End
:Disp "mid Riemann sum is "
:Disp SM
:Pause
:Goto MID

Note that, in the above, J denotes the variable of summation; SR, SL, and SM respectively denote the right, left and midpoint Riemann sum; and FJ is f(xi*)Deltai. (Sorry no Greek capital delta available.)

[In the code typed above, the symbols "St>Eq(" and "evalF(" can be found on the CATALOG menu. The symbol "->" is accessed using the "STO>" key which is the second key from the lefthand bottom of the calculator. Many of the other command words can be found on the I/O and CTL menus. The greater than and less than symbols may be found on the TEST menu.]




This document was created on August 26, 1998.

Your questions, comments or suggestions are welcomed. Please direct correspondence to:

Andy Miller
Department of Mathematics
University of Oklahoma
e-mail: amiller@ou.edu

URL: http://www.math.ou.edu/~amiller/ti85/rsum.htm