Riemann Sum Program for the TI-83+ and TI-84+

Filed under Calculus, Difficulty: Easy, TI-83 Plus, TI-84 Plus.

RIEMANN, a program for the TI-83+ and TI-84+, approximates the area under a curve (integral) by calculating a Riemann sum, a sum of areas of simple geometric figures intersecting the curve. The program solves Riemann sums using one of four methods and displays a graph when prompted. The program itself is optimized to smaller than 1 kilobyte to reduce its memory impact. This tutorial covers the theory of Riemann sums and how to use this program.


defintegral Riemann Sum Program for the TI 83+ and TI 84+

This definite integral represents the net area between a function and the x axis between x=a and x=b.

Integrals are used in the natural and social sciences, statistics, economics, finance, and more, but oftentimes they are difficult to calculate. One method of calculating integrals is to look at the basic definition of an integral, as the area underneath a curve.

riemann1 Riemann Sum Program for the TI 83+ and TI 84+

Visual representation of an integral under the curve y=x²

We can approximate this area by taking a series of rectangles and packing them underneath the curve. Unlike a smooth curve, it is easy to calculate the area of a rectangle, (base*height), and the more, smaller rectangles we use, the more accurate the approximation will be. There are actually many different ways of placing rectangles to choose from, and using trapezoids is an even more effective approach, but all of these sums converge to the actual integral. Below are 3 different visual representations of Riemann sums:

LeftRiemann2 150x150 Riemann Sum Program for the TI 83+ and TI 84+MidRiemann2 150x150 Riemann Sum Program for the TI 83+ and TI 84+TrapRiemann2 150x150 Riemann Sum Program for the TI 83+ and TI 84+

Left, Middle, and Trapezoid Riemann Sums

You can read more about Riemann sums here.

Using the RIEMANN Program

Download RIEMANN.8xp and send the file to your calculator. If you’re not familiar with this process, you can view a tutorial here. To begin, enter the equation you want to use for calculations in the Y1 variable. The Y-Variables screen can be reached by pressing Y=. If your screen doesn’t look like this, press MODE and make sure “Func” is selected.

riemann83 SCREEN01 Riemann Sum Program for the TI 83+ and TI 84+

Y= Variable Screen

Press PRGM, select RIEMANN, and press ENTER to run.

riemann83 SCREEN02 Riemann Sum Program for the TI 83+ and TI 84+

Program on Home Screen

riemann83 SCREEN03 Riemann Sum Program for the TI 83+ and TI 84+

If you have your function in Y1, enter 1 to continue.

riemann83 SCREEN04 Riemann Sum Program for the TI 83+ and TI 84+

Enter 1 to draw a graph, or 2 to just solve numerically.

riemann83 SCREEN05 Riemann Sum Program for the TI 83+ and TI 84+

Enter the numbers for the left and right endpoints of the Integral.

riemann83 SCREEN06 Riemann Sum Program for the TI 83+ and TI 84+

Enter the number corresponding to the method you want to use.

riemann83 SCREEN08 Riemann Sum Program for the TI 83+ and TI 84+

The resulting graph.

Press ENTER to continue.

riemann83 SCREEN09 Riemann Sum Program for the TI 83+ and TI 84+

The numeric result corresponding to the area of the intervals.

riemann83 SCREEN10 Riemann Sum Program for the TI 83+ and TI 84+

You can choose to change the settings for your calculations or exit the program.

When a program is not in use, it is generally a good idea to archive it in order to conserve RAM.

Disp "ENTER F(X) IN Y1
Disp "
Input "YES(1) NO(2) ",G
If G=2:Stop
Disp "
Input "YES(1) NO(2) ",H
If H=1:Then
If W=0:Goto Z
Lbl U
If Ymin>0:0->Ymin
If Ymax<0:0->Ymax
ClrList L6,L5
Lbl 0
Disp "LEFT RECT (1)
Disp "RIGHT RECT (2)
Input "MIDPT RECT (4) ",R
Lbl 1
Input "N? ",N
Lbl 2
If R=1:Goto 3
If R=2:Goto 4
If R=3:Goto 3
If R=4:Goto 5
Lbl 3
Goto 7
Lbl 4
Goto 7
Lbl 5
If H≠1:Then
If N>5:Then
Lbl 8
IS>(Z,N:Goto 8
SW->S:Goto T
Goto 7
Lbl 9
If V G-W->X:Y1->E
Goto T
Lbl 7
If H=1:Goto D
Lbl I
Goto 2
If R=3:Then
Lbl T
Disp "SUM=",S
Lbl E
Lbl F
Lbl D
If R=3:Then
If C=N:Pause
Goto I
Lbl Z
If B-A≤9:Then
Goto U

6 Responses to Riemann Sum Program for the TI-83+ and TI-84+

  1. R. Dodds

    What does the Y mean? I can’t get the program to work without knowing what it is.

    • calcblog

      There was a typo in the code–fixed it! Y1 refers to the graph variable which can be reached be pressing VARS ENTER from the programming menu. It’s probably easier to just download this program to your calculator. (There’s a link in the downloads section.) :)

  2. Anonymous

    When I tried to run this program, my calculator gave me an error syntax message which it located at lines:
    IS>(Z,N:Goto 8
    It also gave me a window range error when I attempted to get and type of rectangle on my graph and brought me to the line:
    I took out the two syntax error program steps that I listed above and then attempted to run the program again. When I tried the graphing option, the graph would only calculate and show one rectangle before the calculating indicator just kept running without anything happening. When I broke from this and hit the go to option the calculator took me to the step:
    Lbl D
    When I tried the non graphing option which would just calculate the sum, the same thing happened where the calculating indicator kept running after I had entered the endpoints, what I wanted to calculate, and n. This time the calculator took me to the step:
    Lbl 7
    I don’t have extensive knowledge in programming or understand the concept of all the different tedious steps of the program. I also don’t really have a clue how to fix these errors which is why I need some assistance. I copied the code on this web page verbatim into my calculator and the only theory I have for why it doesn’t work is because somewhere along the line I have confused the letter I with the number 1, (or maybe the letter O with the number 0 but I don’t think the letter O was used as a variable in this code). My only attempt at a solution was taking out the syntax error lines I have listed above but that didn’t work as the calculator wasn’t able to complete calculations for either the sum or the rectangles in the graph. This is the best and most detailed and useful program I have found online and if I were able to get it to work I could save loads of time on my Calculus Homework. I hope you will be able to help me solve the problem I am facing.

  3. Dave

    I can’t seem to find the “Xmin”, “Ymin”, “Xmax”, or “Ymin” options on my calculator, unless it means the values assigned to them in WINDOW.

  4. Eric

    When I am using the program, it doesn’t allow me to choose which time of Riemann sum I want to use (i.e. left, right, trapezoid, or midpoint). Rather, it shows on the line below those options “544” and below that line it gives me the option to choose my N. When I’ve tried testing it out with different numbers and equations, every time it only gives me the left side Riemann sum, allowing me to change only my N and not my “method.” I have tried looking at my code and the published code to look for any discrepancies but haven’t found any to my knowledge. If you could help me with this for my Calculus class as soon as possible, it would be very much appreciated. Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>