Why Piecewise Motion Needs Care
A position function may use different formulas on different time intervals. Even when the position fits together continuously, the velocity can change abruptly at a join. Within a single formula, the motion may also stop and then reverse direction. To find the distance traveled, we must account for all these changes rather than relying only on the starting and ending positions.
For a one-dimensional motion, the difference between final and initial position gives displacement, not necessarily distance. For a trajectory in the plane or in space, the straight-line distance between its endpoints is likewise not the length of the path it followed. Total distance accumulates the motion along every part of the trajectory.
Piecewise Trajectories, Speed, and Stops
Let \(\mathbf{r}(t)\) be a position vector for \(a\leq t\leq b\). Assume the trajectory is continuous and has a continuous derivative on each of finitely many time intervals, allowing the derivative to differ across the interval boundaries. On a smooth interval, the velocity is \(\mathbf{v}(t)=\mathbf{r}'(t)\), and the speed is the magnitude \(\|\mathbf{v}(t)\|\).
For a scalar motion, a reversal occurs when velocity changes sign: the position changes from increasing to decreasing, or from decreasing to increasing. A smooth reversal occurs at a stop, where velocity is zero. At a formula-change time, the one-sided velocities may instead point in opposite directions even though neither is zero; the velocity at the join may then be undefined. In two or three dimensions, a stop still means zero velocity, but a change of direction does not by itself imply a reversal: the velocity may simply turn rather than point back along its previous path.
A stop matters when locating intervals on which velocity has a constant sign or direction. It does not add distance by itself, and a stationary interval contributes zero distance. A formula-change time must also be included in the partition even if the trajectory keeps moving through it.
Why the Pieces Add
Arc length on each smooth interval is the integral of speed, as in the earlier material on parametric arc length. The reason the piecewise formula works is that distance accumulates over successive time intervals: the portion traveled before a join and the portion traveled after it are both part of the path.
For scalar motion, the absolute value in \(|x'(t)|\) is essential. If \(x'(t)\geq 0\) throughout an interval, then the position is nondecreasing and the fundamental theorem of calculus gives \(\int_u^v |x'(t)|\,dt=x(v)-x(u)\). If \(x'(t)\leq 0\) throughout, then \(\int_u^v |x'(t)|\,dt=x(u)-x(v)\). Thus, on an interval where the position moves in one direction, distance equals the absolute value of the change in position. If velocity changes sign, split at the change before using endpoint positions to compute the separate distances.
Worked Example: A Smooth Stop and a Reversal at a Join
Worked Example: A Smooth Stop and a Reversal at a Join
Consider the scalar position, with time measured in seconds and position in metres, given by $$ x(t)= \begin{cases} (t-1)^2, & 0\leq t\leq 2,\\ 3-t, & 2<t\leq 4. \end{cases} $$ Find the total distance traveled and describe the velocity changes.
The formulas agree at \(t=2\): the first gives \(x(2)=1\), and the second gives \(3-2=1\). On the first piece, $$ x'(t)=2(t-1). $$ This velocity is zero at \(t=1\), positive for \(0\leq t<1\), and negative for \(1<t\leq 2\). The motion therefore stops and reverses smoothly at \(t=1\). On the second piece, \(x'(t)=-1\). At the join \(t=2\), the left-hand velocity is \(2\) and the right-hand velocity is \(-1\). The motion reverses direction there too, but there is no zero velocity at the join; the derivative is not defined there.
Split the distance calculation at the stop and at the formula change: $$ D=\int_0^1 2(1-t)\,dt+\int_1^2 2(t-1)\,dt+\int_2^4 1\,dt. $$ The three contributions are $$ \left[2t-t^2\right]_0^1=1,\qquad \left[(t-1)^2\right]_1^2=1,\qquad [t]_2^4=2. $$ Thus \(D=1+1+2=4\) metres. For a check, the position moves from \(1\) metre to \(0\), then back to \(1\), then on to \(-1\): the distances are \(1+1+2=4\) metres. The endpoint displacement is \(-1-1=-2\) metres, which is not the total distance.
Worked Example: A Stop on a Piecewise Planar Path
Worked Example: A Stop on a Piecewise Planar Path
Let a trajectory in the plane, with time in seconds and coordinates in metres, be $$ \mathbf{r}(t)= \begin{cases} (t,0), & 0\leq t\leq 2,\\ (2,t-2), & 2<t\leq 3,\\ (2,1), & 3<t\leq 4,\\ (6-t,1), & 4<t\leq 6. \end{cases} $$ Find the total distance and describe what happens at the joins.
The position agrees at each join: at \(t=2\) it is \((2,0)\), at \(t=3\) it is \((2,1)\), and at \(t=4\) it remains \((2,1)\). The velocities on the four open pieces are, respectively, \((1,0)\), \((0,1)\), \((0,0)\), and \((-1,0)\). Their speeds are \(1\), \(1\), \(0\), and \(1\) metre per second.
Integrate speed on each time interval: $$ D=\int_0^2 1\,dt+\int_2^3 1\,dt+\int_3^4 0\,dt+\int_4^6 1\,dt =2+1+0+2=5\text{ metres}. $$ The trajectory moves two metres horizontally, then one metre vertically, remains stationary for one second, and then moves two metres horizontally in the opposite direction from its first segment. At \(t=2\), it turns from horizontal to vertical motion. At \(t=3\), it stops; it stays stopped until \(t=4\), then starts moving again. At \(t=4\), it moves in a direction opposite to its first segment. As a check, the initial point is \((0,0)\) and the final point is \((0,1)\), so their straight-line separation is \(1\) metre. The larger path distance, \(5\) metres, includes all three moving pieces.
Worked Example: A Curved Piece Followed by a Straight Piece
Worked Example: A Curved Piece Followed by a Straight Piece
Suppose $$ \mathbf{r}(t)= \begin{cases} (t,t^2), & 0\leq t\leq 1,\\ (t,1), & 1<t\leq 2. \end{cases} $$ Find the total distance, leaving the exact answer in terms of a logarithm where appropriate.
The two position formulas meet at \((1,1)\). On the first piece, the velocity is \((1,2t)\), so the speed is \(\sqrt{1+4t^2}\). On the second piece, the velocity is \((1,0)\), so the speed is \(1\). Therefore $$ D=\int_0^1\sqrt{1+4t^2}\,dt+\int_1^2 1\,dt. $$ An antiderivative for the first integrand is $$ F(t)=\frac{t}{2}\sqrt{1+4t^2}+\frac14\ln\left(2t+\sqrt{1+4t^2}\right). $$ To check it, differentiating gives $$ F'(t)=\frac12\sqrt{1+4t^2}+\frac{2t^2}{\sqrt{1+4t^2}}+\frac{1}{2\sqrt{1+4t^2}} =\sqrt{1+4t^2}. $$ Consequently, the curved piece has length $$ F(1)-F(0)=\frac{\sqrt5}{2}+\frac14\ln(2+\sqrt5), $$ and the straight piece has length \(2-1=1\). The total is $$ D=1+\frac{\sqrt5}{2}+\frac14\ln(2+\sqrt5)\approx 2.4789\text{ metres}. $$ The decimal is rounded to four digits after the decimal point. As a check on the straight-piece contribution, the position changes from \((1,1)\) to \((2,1)\), a horizontal distance of \(1\) metre, matching its speed integral.
A Common Mistake: Using Only the Endpoints
A frequent error is to calculate the change in position and report its magnitude as total distance. For the first worked example, this incorrect calculation is $$ |x(4)-x(0)|=|-1-1|=2\text{ metres}. $$ That is the magnitude of the displacement, not the distance traveled. It ignores the motion from \(1\) to \(0\) and back to \(1\) before the final motion to \(-1\). The correction is to split at the reversal and formula change, then add the lengths of all the pieces: \(1+1+2=4\) metres.
For vector motion, taking the magnitude of the endpoint displacement has the same limitation: it measures the straight-line separation of the endpoints. It gives the path length only in special cases, such as motion along a straight line without backtracking. In general, integrate speed on each piece and add the results.
A Reliable Calculation Process
Use them to form intervals on which one position formula applies.
Differentiate the position formula on its own interval and use one-sided velocities when inspecting a join.
For scalar motion, locate zeros of velocity and check whether its sign changes. For vector motion, distinguish zero velocity from a change in the direction of a nonzero velocity.
Use \(|x'(t)|\) for scalar motion and \(\|\mathbf{r}'(t)\|\) for vector motion. Include stationary pieces, whose distance contribution is zero.
Add the nonnegative distances. Compare the result with the endpoint displacement as a check, remembering that distance cannot be less than the magnitude of displacement.
Check Your Understanding
Use speed on each relevant interval rather than assuming that endpoint displacement gives total distance.
- For scalar motion with \(x'(t)\geq 0\) throughout an interval \([u,v]\), express the distance traveled using \(x(u)\) and \(x(v)\).
- If a scalar velocity changes from negative to positive at a smooth interior time, what happens to the position there?
- Can a trajectory change direction at a formula-change time without stopping? Explain using one-sided velocities.
- A two-dimensional trajectory has velocity \(\mathbf{v}(t)=\mathbf{0}\) for every \(t\) in \([3,5]\). What distance does it contribute on that interval?
- Why can the magnitude of endpoint displacement be smaller than the total distance traveled?