A cannon on a train car fires a projectile to the right with speed v relative to the train, from a barrel elevated at angle theta. The cannon fires just as the train, which had been cruising to the right along a level track with speed vt, begins to accelerate with acceleration a. Find an expression for the angle at which the projectile should be fired so that it lands as far as possible from the cannon. You can ignore the height of the cannon above the track. Ok, so I know in the x direction the projectile has a constant velocity of vcostheta + vt in the y direction initial veloctity of vsintheta. I've tried solving for t in the vertical direction and then substituting into the x direction kinematic formula but I am still not sure how to find theta for some maximum distance. Also, the answer has a (the accleration of the train) in it. I do not get at all why this is important unless it is talking about the case in which the a is so large that the train passes the projectile before it lands. Thanks in advance.