Compute the length of the curve over the interval