Riemann sums can be arduous, tedious, repetitive, and error-prone to calculate by hand, so they are prime candidates for computer software. A function that calculates Riemann sums is given below. Note that this is not a simple, one-line function - if possible, it will be easier to transfer it from another calculator, or download the function and install it using TI Connect than to type it.
The syntax for the function is:
riemann(expression, variable, lower limit, upper limit, number of intervals, which sum) or riemann(f(x), x, a, b, n, which)
where "which sum" takes the values:
The easiest way to get this function is to transfer it from another calculator or download the function file and install via TI Connect.
If you need to type the function by hand, instructions are given below.
If you must type the program by hand, it is easier to enter this function using the Program Editor than the Home screen. You access the program editor by pressing the key, Then select "7: Program Editor" and "3: New" from the submenu. |
|
In the New dialog, select "Function" from the Type menu, and type the name of the function ("riemann") in the Variable field. |
|
Now, type the function (shown at right). Some pointers:
|
riemann(f,x,a,b,n,w) :Func :Local dx,s,c :(b-a)/n dx :If w<0 Then :a c :b-dx b :ElseIf w=0 Then :a+dx/2 c :Else :a+dx c :EndIf :sum(seq(f,x,c,b,dx)) s :Return dx*s :EndFunc |
The function shown at right calculates a Riemann approximation to the area under the graph of y = x2 on [0, 4], using 4 rectangles (n = 4) constructed using left-hand endpoints. |
|
This function calculates a Riemann approximation to the area under the graph of y = x2 on [0, 4], using 4 rectangles (n = 4) constructed using midpoints. |
|
This function calculates a Riemann approximation to the area under the graph of y = x2 on [0, 4], using 4 rectangles (n = 4) constructed using right-hand endpoints. |
|