If an object moves at a velocity v = 3 m/s for a time t = 2 s, we know that the distance it moved in that time is d = 3 m/s x 2 s = 6 m. As long as the velocity is constant, the distance is found as d = vt. But what if the velocity is not constant? We could estimate the distance traveled by breaking the total time interval into smaller subintervals, each of width delta-t. By choosing a value of v on the function within that subinterval, we can approximate the distance traveled as delta-d = v delta-t. Adding up all of these estimates would give us an estimate of the total distance d.
Notice that each rectangle formed by v(t) and delta-t has delta-d as its area. Thus, the solution to finding the distance traveled during a time interval appears to be equivalent to finding the area under the velocity curve within that interval. The question then becomes one of determining the exact value of this area. This can be done by letting the number of rectangles go to infinity, or equivalently, letting the width of each rectangle go to zero.

The n slider controls how many rectangles are used for the approximation, from 0 to 100. Four different functions of various shapes are selectable by checking the desired checkbox. If n is set to zero, no rectangles are displayed.
Once n is set to 1 or greater, the approximating rectangles appear, along with text indicating the total area of the n rectangles. This area is an approximation of the exact area under the curve. As n increases, you can see that the approximation improves, as the difference between the rectangles and the curve gets smaller.
Above the n slider is another slider labeled with "LEFT" and "RIGHT". By changing this slider, you can change the point along the top of the rectangle that is used to approximate the function in each subinterval. Notice how changing this leads to variation in the accuracy of the total area estimate. This is dependent upon the shape of the curve. For example, the area under an ever-decreasing function is overestimated if the top left corner is used, but underestimated if the top right corner is used. The opposite is true for an ever-increasing function.