# The Distance Problem

Consider the distance problem: Find the distance traveled by an object during a certain time period if the velocity of the object is known at all times. If the velocity remains constant, then the distance problem is easy to solve by means of the formula `s=vt`.

But if the velocity varies, it is not so easy to find the distance traveled.

Example 2. Suppose the odometer on our car is broken and we want to estimate the distance driven over a 30-second time interval. We take speedometer readings every five seconds and record them in the following table:

Time (s) | 0 | 5 | 10 | 15 | 20 | 25 | 30 |

Velocity (ft/s) | 25 | 31 | 35 | 43 | 47 | 46 | 41 |

During the first five seconds the velocity doesn’t change very much, so we can estimate the distance traveled during that time by assuming that the velocity is constant. If we take the velocity during that time interval to be the initial velocity (25 ft/s), then we obtain the approximate distance traveled during the first five seconds: `25 ft/s*5s=125ft`.

Similarly, during the second time interval the velocity is approximately constant and we take it to be the velocity when t=5. So our estimate for the distance traveled from t=5 to t=10 is `31 ft/s*5s=155ft`.

If we add similar estimates for the other time intervals, we obtain an estimate for the total distance traveled: `25*5+31*5+35*5+43*5+47*5+46*5=1135ft.`

We could just as well have used the velocity at the end of each time period instead of the velocity at the beginning as our assumed constant velocity. Then our estimate becomes `31*5+35*5+43*5+47*5+46*5+41*5=1215ft.`

If we had wanted a more accurate estimate, we could have taken velocity readings every two seconds, or even every second.

Perhaps the calculations in Example 2 remind you of the sums we used earlier to estimate areas. The similarity is explained when we sketch a graph of the velocity function of the car and draw rectangles whose heights are the initial velocities for each time interval. The area of the first rectangle is `25*5=125`, which is also our estimate for the distanced traveled in the first five seconds. In fact, the area of each rectangle can be interpreted as a distance because the height represents velocity and the width represents time. The sum of the areas of the rectangles is `L_6=1135`, which is our initial estimate for the total distance traveled.

In general, suppose an object moves with velocity v=f(t), where `a<=t<=b` and `f(t)>=0` (so the object always moves in the positive direction). We take velocity readings at times `t_0(=a),t_1,t_2,...,t_n(=b)` so that the velocity is approximately constant on each subinterval. If these times are equally spaced, then the time between consecutive readings is `Delta t=(b-a)/n`. During the first time interval the velocity is approximately `f(t_0)` and so the distance traveled is approximately `f(t_0) Delta t`. Similarly, the distance traveled during the second time interval is about `f(t_1) Delta t` and the total distance traveled during the time interval is approximately `sum_(i=1)^nf(t_(i-1)) Delta t`.

If we use the velocity at right-hand endpoints instead of left-hand endpoints, our estimate for the total distance becomes `sum_(i=1)^nf(t_i) Delta t`.

The more frequently we measure the velocity, the more accurate we expect our estimates to become, so it seems natural that the exact distance s is `s=lim_(n->oo)f(t_(i-1)) Delta t=lim_(n->oo)f(t_i) Delta t`.

Because Equation for distance has the same form as our expressions for area, it follows that the distance traveled is equal to the area under the graph of the velocity function.