==============================
a = 0;
(*beginning point*)
b = 3; (*ending point*)
f[x_] := (1 - x)^2;(*function*)
points[x_] :=
Table[{i, f[i]}, {i, a,
b, (b - a)/
x}]; (*generates a list of the points for the line segments*)
distance[x_] :=
Sum[Sqrt[((b - a)/x)^2 + (f[i] - f[i - (b - a)/x])^2], {i,
a + (b - a)/x,
b, (b - a)/
x}];(*evaluates the approximate length of the line segment*)
|