A rocket reises from rest with an acceleration 5m/s^2 until it runs out of fuel at a height of 500 m . The maximum height dose the rocket from the ground reach is?

h = (1/2) a t^2

500 = 2.5 t^2

t = 14.1 seconds accelerating up

Vi = 5 t = 5 * 14.1 = 70.7 m/s at 500 m

then coasting up
v = Vi - 4.9 t^2
v = 0 at top
4.9 t^2 = 70.7
t = 3.8 seconds coasting up beyond 500 m

v average coasting = 70.7/2 = 35.4 m/s average for 3.8 seconds
h = 500 + 35.4 * 3.8 = 634 meters