When finding the total distance traveled, the "distance" is always positive, regardless of the direction. But this idea doesnβt match up with the integral since the integral of the velocity function on \([3,5]\) will return a "negative" distance. The easiest way to fix the sign is to put on the absolute value to make the "negative" distance positive.
\begin{align*}
\text{distance} \amp= \int_0^5 \left|v(t)\right|\, dt \\
\amp= \int_0^3 \left|v(t)\right|\, dt + \int_3^5 \left|v(t)\right|\, dt \\
\amp= \int_0^3 v(t)\, dt + \int_3^5 -v(t)\, dt \\
\amp= \int_0^3 \left(12 - 4t\right) \, dt - \int_3^5 \left(12 - 4t\right)\, dt \\
\amp= \left(12t - 2t^2\right)\bigg|_0^3 - \left(12t - 2t^2\right)\bigg|_3^5 \\
\amp= 18 - (-8) \\
\amp= 26
\end{align*}