solution: part b.

In part a. we found that the block had 58.8J of mechanical energy in the form of kinetic energy only. We will continue to use the position of the spring at rest as a reference point for PE. If we were to change it, we would have to take that into account when calculating the initial energy.
Initial Conditions:

eqnarray26

We have no friction during compression of the spring, so the energy will be converted to PE of the spring and gravitational PE. Just set the total initial energy equal to the energy the block has when the spring is compressed a distance x.

eqnarray28

Use quadratic equation:

eqnarray36

The positive number obtained for x is a compression, while the negative one is for a spring expansion. We are solving for a compression, so the positive number is correct. tex2html_wrap56