The sound emitted by the whistle travels across the distance L between the train and the reflecting surface, and then for another L to come back to the train. This means that the time t=5.0 s between the whistle and the echo corresponds to the time the sound takes to cover a total distance of 2L. Assuming the sound moves by uniform motion with speed v=343 m/s, we can write the basic relationship between distance covered, time and velocity:

As we said before, this distance corresponds to twice the distance between the train and the reflecting surface (S=2 L), so we find

and so, this is the distance between the train and the reflecting surface.