The motion of train is divided into three parts.
In the first part, train accelerates with from rest for , hence the distance covered is . At the end of this part, the train has speed .
In the second part, the train moves with constant speed for , hence it covers .
In the third part, the train retards with from speed until full stop. For that, time is required. The distance covered is .
Total distance covered is .