A = (-3, 2)
B = (-0.72, 3.66)
C = (2.54, 1.62)
D = (4.296156046824487, 3.6424427024242307)
L: {A, B, C, D}
f = FitPoly(L, 3)
a = Point(xAxis)
b = Point(xAxis)
n = 7 (slider from 1 to 100, step 1)
dx: (x(b) - x(a)) / n
L1 = Sequence((x(a) + i * dx, f(x(a) + i * dx)), i, 0, n)
L2 = Sequence(Segment[Element[L1, i], Element[L1, i + 1]], i, 1, n)
c = Segment(Element[L1, 1], a)
d_1 = Segment(Element[L1, n + 1], b)
Laenge = Sum(L2)
text1 = LaTeX(Laenge, true, true)