A ball of mass M at rest is dropped from the height h above the ground onto a spring on the ground, whose spring constant is k. Neglecting air resistance and assuming that the spring is in its equilibrium, express, in terms of the quantities given in this problem and the gravitational acceleration g, the distance x of which the spring is pressed down when the ball completely loses its energy.
Find the x above if the ball's initial speed is vi.