How to find the total distance traveled, given the position function? 
A particle moves in a straight line according to the rule $x(t)=t^3-2t+5$, where $x(t)$ is given in meters and where $t$ is given in seconds. Determine the position, velocity, and acceleration of the particle at $t=0$ and $t=3$ seconds. How far has the particle moved during this $3$ second period? 

Answer
\begin{align*}x(t)&=t^3-2t+5&x(0)&=5\,m&x(3)&=26\,m\\
v(t)&=3t^2-2&v(0)&=-2\,m/s&v(3)&=25\,m/s\\
a(t)&=6t&a(0)&=0&a(3)&=18\,m/s^2\end{align*}
Total distance traveled is $23.18$m. 
My question concerns the total distance traveled. I know by definition distance is the total displacement (the net total distance, regardless of direction). But how do you get $23.18$ m from the equations?  
 A: You should integrate the absolute value of velocity from 0 to 3. Than you get the desired result.
A: if u look at the velocity function then u will find that the velocity is negative in the time interval from "0 to sq.root(2/3) sec". And it is positive in the time interval from "sq.root(2/3) to 3 sec". 
so take the absolute value(put an extra negative sign before velocity function) of velocity in the first time interval and integrate with in time interval b/w "0 to sq.root(2/3) sec". now again integrate velocity with in time interval b/w "sq.root(2/3) to 3 sec".
now add both of the results and u will get your answer. i.e. 23.18m.
A: Basically a particle will be moving in negative direction if its velocity is negative.As this type of motion is a straight line motion where $x$ is in terms of $t$ therefore total distance travelled =(distance travelled in $+v_e$ direction)+(mod of distance travelled in $-v_e$ direction)....
To solve for total distance travelled:
1.Find velocity vector by differentiating $x$ vector.
2.Find time intervals contained in the given time intervals where $v$ is $-v_e$
3.Integrate $v$ for time interval in which $v$ is $+v_e$ and add a '$-$' sign to those time time interval in which $v$ is $-v_e$ then integrate it for respective time in which $v$ is $-v_e$
4.Finally add the integrated values...
