PreRelease Riemann Sums
Author: Mike May, S.J.

This is a sample with Riemann II

Start 2

Display LowerSum

Display UpperSum

Display Integral

Display left sum

Display right sum

LowerLimit = -1.5 (slider from -5 to 5, step 0.1)
UpperLimit = 3 (slider from -5 to 5, step 0.1)
n = 45 (slider from 1 to 100, step 1)
f(x) = x^(2.0)
c = LowerSum(f, LowerLimit, UpperLimit, n)
d = UpperSum(f, LowerLimit, UpperLimit, n)
e = Integral(f, LowerLimit, UpperLimit)
texte1: c + " < " + e + " <" + d
ShowLowerSum = false
ShowUpperSum = false
ShowIntegral = false
ListInf = Sequence(LowerLimit + k * (UpperLimit - LowerLimit) / n, k, 0.0, n - 1.0, 1.0)
ListSup = Sequence(LowerLimit + k * (UpperLimit - LowerLimit) / n, k, 1.0, n, 1.0)
IntInf: f(ListInf)
IntSup: f(ListSup)
SumRiemanInf: (UpperLimit - LowerLimit) / n Sum[IntInf]
SumRiemanSup: (UpperLimit - LowerLimit) / n Sum[IntSup]
texte2: "\frac{b-a}{n}.Σ_{k=0}^{k=n-1}f(x_k)\;=\; " + SumRiemanInf
texte3: "\frac{b-a}{n}.Σ_{k=1}^{k=n}f(x_k)\;=\; " + SumRiemanSup
List1 = Sequence(RectRieman[Element[ListInf, k], Element[ListSup, k], f(Element[ListInf, k])], k, 1.0, n)
List2 = Sequence(RectRieman[Element[ListInf, k], Element[ListSup, k], f(Element[ListSup, k])], k, 1.0, n)
ShowLeftSum = true
ShowRightSum = false

Tool: RectRieman
xi,xi+1,f(x)
Input: a, b, c
Output: poly1, a_1, c_1, b_1, d

A: (a, 0.0)
B: (b, 0.0)
C: (b, c)
D: (a, c)
poly1, a_1, b_1, c_1, d = Polygon(A, B, C, D)