From Khan Academy

Let's deal with moving left and right to start.

Let's deal with moving left and right to start.

The particle is moving to the right when its velocity is positively valued; that is, when v(t)>0.

The particle is moving to the left when its velocity is negatively valued; that is, when v(t)<0.

Now we consider when the particle is speeding up and slowing down.

The particle is speeding up for those times when the product of its velocity and its acceleration is greater than zero. Therefore we want

v(t)⋅a(t)>0.

For this condition to be satisfied, we want those times when v(t) and a(t) are both positively valued or both negatively valued.

In contrast, he particle is slowing down for those times when the product of the velocity and the acceleration is less than zero. Therefore we want

v(t)⋅a(t)<0.