I am having trouble understanding the following definite integral:

The way I did it is as follows:

from which I got a similar answer to the correct one which looked as follows:

My question is that due to it being an absolute value surely you have to break the integral up into ?