Source: High school physics (Chinese)
Problem Sets:
Problem
A 5.0 g bullet is fired vertically upward by a spring gun. The spring must be compressed by at least 10 cm for the bullet to reach a target 20 m high (measured from the muzzle).
We apply the conservation of mechanical energy for the bullet-spring-Earth system. Let the initial state be when the spring is compressed, and the final state be when the bullet reaches its maximum height. Let the gravitational potential energy be zero at the bullet's initial position (when the spring is compressed by $x = 0.10$ m). The initial energy is entirely elastic potential energy stored in the spring:
$$E_i = \frac{1}{2}kx^2$$At the final height, the bullet's speed is zero. The total height gained relative to the initial position is $h+x$, where $h = 20$ m. The final energy is entirely gravitational potential energy:
$$E_f = mg(h+x)$$By conservation of energy, $E_i = E_f$:
$$\frac{1}{2}kx^2 = mg(h+x)$$Solving for the spring constant $k$, with $m = 5.0 \text{ g} = 0.0050 \text{ kg}$:
$$k = \frac{2mg(h+x)}{x^2}$$ $$k = \frac{2(0.0050 \text{ kg})(9.8 \text{ m/s}^2)(20 \text{ m} + 0.10 \text{ m})}{(0.10 \text{ m})^2} \approx 200 \text{ N/m}$$