JACQUES D. answered 08/03/22
Ivy league and MIT educated Chemical Engineer with career as teacher
My answer got deleted, so I am going to summarize:
-au (the neg. momentum change of the gases = m(dvTrolley/dt (the momentum change of the trolley)
This is separable after we sub in m = m0 - at: dv/u = -a/(m0 - at) dt
Integrating: (v-v0)/u = ln|(m0 - at)/m0| (from v0 to v, and 0 to t)
solving for t for v = 0:
-v0/u = ln((m0 -at)/m0) I removed the absolute value as m0 > at since it is specified that there is enough gas mass to stop the trolley
Just rearrange and solve for t.