# physics

posted by
**josh**
.

A spring-loaded toy gun is used to shoot a ball of mass m straight up in the air. The spring has spring constant k. If the spring is compressed a distance x_0 from its equilibrium position ( y = 0 ) and then released, the ball reaches a maximum height h_max (measured from the equilibrium position of the spring). There is no air resistance, and the ball never touches the inside of the gun. Assume x_0 is less then h_max

Initially, the spring was compressed a distance x_0; its total initial energy was E_i = (1/2)kx_0^2 (neglecting the potential energy from the small change in height, x_0).

Find the total mechanical energy of the ball when it is a height h above the equilibrium position of the spring. Assume that h < h_max , so that the ball has some velocity v. Define the gravitational potential energy to be zero at the equilibrium height of the spring.

Express the total mechanical energy in terms of h, v, g, and the ball's mass m.