It's not too hard to get the antiderivative in terms of elementary function...but the evil is in the substitution of upper and lower limits.
Finding the antiderivative is very easy using a t-sub. I've shown a different way the antiderivative can be found below:
Now to evaluate the definite integral. The integrand is
periodic (with segments ...0~
,
~
,...) and the antiderivative is
periodic (with segments ...
~
,
~
...). Note that we cannot just plug in the bounds due to this periodicity. In fact, it is only "safe" to integrate within ...
~
,
~
...
Thus we can split the bounds into three regions:
to
,
to
(which we will treat as 1009 lots of 0 to
by symmetry) and
to
.
Plugging all this into the antiderivative yields:
(This ignores all the shenanigans with limits going on.)
I hope this explains my thinking thoroughly enough - a lot of this is intuitive but hard to communicate.