A Train is Moving along Straight Line with a Constant Acceleration a : Projectile Motion

Problem: A train is moving along straight line with a constant acceleration a. A boy standing in the train throws a ball forward with a speed of 10 m/s at an angle 60° from horizontal. The boy has to move forward by 1.15 m inside the train to catch the ball back at the initial height. The acceleration of the train in m/s2 is,  (IIT JEE 2011)

Solution: Consider the motion in a frame attached to the ground. Let train's velocity at the time of projection of ball be $u_0$. The ball is projected with a velocity $u={10}\;\mathrm{m/s}$ (relative to the train) at an angle ${60}^\mathrm{o}$ from the horizontal (see figure).
Thus the horizontal and vertical component of the initial velocity of the ball are, \begin{alignat}{2} &u_{x}=u_0+u\cos 60, \nonumber\\ & u_{y}=u\sin 60. \nonumber \end{alignat} The time of flight is given by \begin{align} t&=\frac{2u_y}{g} =\frac{2u\sin 60}{g} =\sqrt{3}\;\mathrm{s}. \end{align} The distance travelled by the train and the ball in time $t$ are \begin{align} x_\text{train} &=u_0 t+\tfrac{1}{2}a t^2, \\ x_\text{ball} &=(u_0+u\cos 60) t. \end{align} Since the boy moves forward by 1.15 m, we have, \begin{alignat}{2} & x_\text{ball}=x_\text{train}+1.15, \nonumber\\ \label{gba:eqn:1} & (u_0+u\cos 60) t=u_0 t+\tfrac{1}{2}a t^2+1.15. \end{alignat} Substitute $u={10}\;\mathrm{m/s}$ and $t=\sqrt{3}\;\mathrm{s}$ in first equation and then solve to get $a={5}\;\mathrm{m/s^2}$. I encourage you to solve this problem in a frame attached to the train.