**Introduction**

This program plots the graph of a function *f*(*x*), draws
left or right hand rectangles, and computes the corresponding approximation
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 RECTS.8xp

**The Program **

:Prompt A,B,N,T | {Prompt is in PRGM under I/O} |

:ClrDraw | {ClrDraw is in DRAW under Draw} |

:DrawF Y1 | {DrawF is in DRAW under Draw} {Y1 is in VARS under Y-VARS} |

:Pause | {Pause is in PRGM under CTL} |

:(B-A)/NH | {The arrow is in STO} |

:0S | {The 0 is a zero} |

:1J | {The 1 is a one} |

:Lbl 1 | {Lbl is in PRGM under CTL} |

:A+(J-1)*HU | {The * is the times sign} |

:U+T*HX | {X is the X,T button} |

:Line(U,0,U,Y1) | {Line is in DRAW under Draw} {The 0 is a zero} |

:Line(U,Y1,U+H,Y1) | |

:Line(U+H,Y1,U+H,0) | |

:S+H*Y1S | |

:IS>(J,N) | {IS> is in PRGM under CTL} |

:Goto 1 | {Goto is in PRGM under CTL} |

:Pause | |

:Disp "SUM" | {Disp is in PRGM under I/O} { " is on the + button} |

:Disp S |

**Running the Program**

You will need to enter a function *f*(*x*) into
Y1 before running
the program. Change the graphing WINDOW so that the desired portion of
the function fills the screen. The program will first ask for values of A, B,
and N (number of subdivisions). The value of T determines the type of rectangle
to be viewed. T=0 corresponds to left hand rectangles, T=1 corresponds to
right hand rectangles. Any value between 0 and 1 can also be used.
After plotting the graph, the program will pause. Hit
ENTER. The rectangles will be drawn and the program will pause
again. Hit
ENTER. The value of the approximation will appear.

To test the program try the following:

*f*(*x*) = x^{2}+ 3, WINDOW:
0< x <5,
0< y <25, A=1, B=4, N=6, T=1.

You should see a portion of a parabola and 6 right hand rectangles.
The numerical answer will be 33.875