TITLE: Which part of the train stays for the longest time in the station?
QUESTION [8 upvotes]: 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?

REPLY [2 votes]: Let me use $2S$ and $2L$ for convenience.
Let $[-S,S]$ be the station.
The main hint is that the tail leaves the station with the same speed as the head entered the station. By symmetry, this implies that the middle of the train was exactly at the middle of the station when the train stopped. More precisely, the speed when the middle of the train was at $L+S$ and $-L-S$ were the same, so the location of the middle of the train when it stopped is necessarily $0$.
Let $x$ be the relative position of a passenger with respect to the middle of the train. This passenger decelerates until reaching position $x$ and accelerates after that. The time spent at the station is thus proportional to $\sqrt{S+x}+\sqrt{S-x}$ if $|x|<S$, and some other equation if $|x|>S$, which is maximized at $x=0$.