Where are told,

The the velocity is the integral of that,

But the initial conditions say,

Thus,

So the distance is,

The displacement is,

This integral is more confusing to integrate.

But the trick is to divide it into parts.

One where the and the other when

When does this change happen?

Simple find,

So at we have a change.

Thus,

But because of the changing signs we can write,

Thus,