find the length of the curve over the interval