Mass hanging from spring: potential energy I have encountered a problem with a mass $m$ hanging from a spring. I want to find the maximum distance it will be stretched from the spring's equilibrium. At the maximum distance the spring is stretched, the mass will be at rest so the weight will cancel out the spring force, so we should have,
$$ky = mg$$
or 
$$y = \frac{mg}{k}$$
Where $k$ is the spring constant, $y$ is the maximum distance, $m$ is the mass and $g$ is gravitational acceleration. But, if you look at this problem through the conservation of energy, you would conclude energy is conserved, since we have only a spring force and gravity acting. If we define our origin to be the spring's equilibrium, then the initial energy of the system is zero. The energy at all other times must be zero, so at maximum distance, we have,
$$\frac{ky^2}{2} + mg(-y) = 0$$ 
Which yields a different answer of
$$y = \frac{2mg}{k}$$
What's going on? Where am I going wrong in approaching this problem?
 A: 
What's going on? Where am I going wrong in approaching this problem?

Carefully consider your 3rd statement:

At the maximum distance the spring is stretched, the mass will be at
  rest so the weight will cancel out the spring force

At maximum distance, the mass will certainly be at rest but is it necessarily true that the weight and spring force cancel?
Put another way, does that fact that an object is (instantaneously) at rest imply that the acceleration of the object is zero?
A: You have to understand that if the net force at a point is zero, we can only claim that the acceleration at that point is zero, it doesn't imply that the velocity at that point is zero as well. So when you release the block from it's natural length, it will fall down by mg/k, in the process of which it will acquire some velocity, and then continue moving downwards until it's Kinetic Energy is zero. For a block to be at rest, the necessary condition is that it shall have zero velocity, and not zero acceleration. As an example take the case of uniform motion in one dimension, it has zero acceleration( as constant velocity) , but still it isn't at rest. For a block to be at rest, it MUST have zero velocity. 
