Ober- und Untersumme

n = 5 (slider from 1 to 50, step 1)
f(x) = x³ - x² - x + 2
s = Segment((-1, 0), (1.7, 0))
B = Point(s)
b: x(B)
A = Point(s)
a: x(A)
C = (0, -0.5)
O = UpperSum(f, a, b, n)
U = LowerSum(f, a, b, n)
g = Function(f, -1.3, 1.8)
T1: "a = " + (x(A))
T2: "b = " + (x(B))
T4: "Lower sum = " + U
T5: "Upper sum = " + O
T6: "Difference = " + (abs(O - U))