So I feel really stupid asking this, because this is a very elementary physics problem and I'm well past this level of physics, but I don't understand what's going on here. Say we have a vertical spring with spring constant 100N/m. A 100N mass is placed on top of it. This will cause the spring to compress by 1 meter by Hooke's law. Now the issue I have is with energy conservation. The work done on the spring in terms of the mass is mgh = (100N)(1m) = 100J. In terms of work done on the spring, we have Energy stored in spring U = 1/2kx^2 = (0.5)(100N/m)(1m^2) = 50J. So where does this energy discrepancy come from? I know that energy is conserved, so the problem lies in my methodology. Am I missing a component of velocity that the mass will have? I was assuming that if the mass was added to the spring slow enough, it wouldn't oscillate.