Remember that if velocity is the derivative of displacement, then displacement is the result of integrating velocity. If a particle moves from a to b, then its total distance travelled is
,
assuming that the particle does not change direction. What the integral actually provides is displacement, but if the particle changes direction then distances need to be calculated for each separate period when the velocity is positive or negative.