Motion problems with integrals: displacement vs. distance