# Spring and height of block

Gold Member

## Homework Statement

A block of mass 250 g is kept on a vertical spring with spring constant 100N/m fixed from below.
The spring is now compressed to have a length 10 cm shorter than its natural length and is released. How high does the block rise?g = 10m/s

## Homework Equations

E=½kx²
and other basic equations

## The Attempt at a Solution

So I found out initial energy imparted,
$$E_1 = ½kx² = 0.5 J$$
then equated to change in potential and new spring energy.
$$E_2 = mgh + ½k(x-h)²$$ where h is the height required
solving E₁= E₂, I get an awkward answer. the answer given is 20 cm. How?