n = 4 (slider from 2 to 50, step 1)
f(x) = sin(x)
a = Sequence(Segment[(k * 3.141592653589793 / n, f(k * 3.141592653589793 / n)), ((k + 1) * 3.141592653589793 / n, f((k + 1) * 3.141592653589793 / n))], k, 0, n - 1)
b = Sum(a, n)
liste1 = Sequence(Segment[(k * 3.141592653589793 / n, 0), (k * 3.141592653589793 / n, f(k * 3.141592653589793 / n))], k, 1, n - 1)
g = Function(f, 0, 3.141592653589793)
texte1: "Longueur  = " + b