
Antoni C. answered 12/07/20
Math and computer programming tutor with over 3 years experience
Given a velocity function for an object, we can find the distance traveled by calculating the absolute value of the area under the velocity curve, over the interval of interest. It is important to note that we are looking for the absolute value, and not the net value of the area under the velocity curve. This can be better understood by looking at the plot of the velocity function.
When v(t) is above the x-axis, this means the object is moving forwards. When v(t) is below the x-axis, this means the object is moving backwards. Even when the object is moving backwards, the total distance traveled is INCREASING. Regardless of whether the object is moving forwards or backwards, we want to calculate the total distance covered (and not the displacement of the object).
So to get into the calculation, we must first break up the velocity functions into intervals where it is above the x-axis, and below the x-axis. In other words we need to find all x intercepts of v(t) over the interval [1,5]. cos(t) = 0 for values: t = π/2 + πk where k is any integer. This can also be easily found by looking at the plot of v(t). For this I am using Desmos, and can easily observe that v(t) = 0 at t=π/2 and t=3*π/2.
So our velocity function is above the x-axis on the interval [1,π/2)∪(3*π/2, 5].
Our velocity function is below the x-axis on the interval (π/2, 3*π/2).
Now all that is left to do is to integrate v(t) over each interval, take the absolute value, and sum over all intervals:
This comes out to:
distance = ∫cos(t)dt from 1 to π/2 + abs(∫cos(t)dt from π/2 to 3*π/2) + ∫cos(t)dt from 3*π/2 to 5
distance = sin(π/2)-sin(1) + abs(sin(3*π/2) - sin(π/2)) + sin(5)-sin(3*π/2)
distance = 0.159 + 2 + 0.041
distance = 2.2

Antoni C.
https://pasteboard.co/JDRHvQF.png12/07/20