In this problem you have to maximize the distance between two particles of positions s_1 and s_2. This means that you have to maximize the following quantity (that is time-dependent)
d(t)=|s_1(t)-s_2(t)|=|cos(t)-cos(t+pi/4)|
To maximize this quantity, let's compute the derivative
d'(t)=(cos(t)-cos(t+pi/4))/|cos(t)-cos(t+pi/4)| * (sin(t+pi/4)-sin(t))
and study when it's positive:
(cos(t)-cos(t+pi/4))*(sin(t+pi/4)-sin(t))>0
The product is positive if and only if the two factors are both positive or both negative. So we can study their sign separately.
cos(t)-cos(t+pi/4)>0 iff cos(t)>cos(t+pi/4)
The equality occurs when t=-pi/8 + k pi for all k in ZZ, i.e. the inequality is satisfied for t \in (-pi/8+2kpi,7/8pi+2 k pi) for all k in ZZ. So for these values the first factor is positive, and for the complementary values in RR it's not.
sin(t+pi/4)-sin(t)>0 iff sin(t+pi/4)>sin(t)
The equality occurs when t=3/8 pi + k pi for all k in ZZ, i.e. the inequality is satisfied for t in (-5/8pi+2k pi,3/8 pi+2k pi) for all k in ZZ.
If we finally consider the product, we get that the derivative d'(t) is positive if and only if t in (-pi/8+k pi,3/8 pi + k pi) for all k in ZZ and it's negative if and only if t \in (3/8 pi + k pi,7/8 pi + k pi) for all k in ZZ.
So 3/8 pi+ kpi for all k in ZZ are the point that maximize the distance d(t).