A train with length $L$ is moving towards a train station of length $S$ with speed $v$.
The train starts to decelerate with acceleration $-a$ as soon as head reaches the station until completely stops. Right after the train completely stops, it starts to accelerate with acceleration $a$ until its tail leaves the station with speed $v$.
Which part of the train stays for the longest time in the station?
The correct answer is the mid-part of the train. If the head stays in the station for $t$ and the mid-part of the train stays for $\sqrt{2}t$. Could anyone give me some clue on how to get this?
First notice that the situation is symmetric and denote the following time events:
If you just want to show that the middle stays longer than the front, it suffices to notice the relevant time intervals are 1→2 and 3→4. In both intervals, the train travels the same distance, but in the latter interval it is slower.
To get a quantitative result:
Sketch the position of the train at each event.
Determine the distance the train traveled at each event using the point of standstill as a reference point.
Use the formula for the time spent to travel a distance $d$ in constantly accelerated motion $\left( t=\sqrt{\frac{2d}{a}}\right)$ to determine the times of the above events, again with respect to the time when the train stands still.
Add, subtract, and multiply as needed.
Note that to obtain the result you specified, you probably need to assume that the station is longer than the train (which is not necessarily true in reality as for proper usage of a train it suffices that the distance between the first and last door is shorter than the station but the train itself can be longer).
Finally note that you can just replace the front with any part before the middle to show that there is no point that is neither front nor middle nor tail that stays longest at the station.