The problem is as follows:
A mass whose mass is $m$ is hanging vertically from a ceiling which is tied to a spring which has a constant of $K$ is oscillating. Given this condition find the velocity as a function of the elongation of the spring.
The alternatives given are as follows:
$\begin{array}{ll} 1.&\sqrt{\frac{K}{m}y^2+2gy}\\ 2.&\sqrt{2gy-\frac{K}{m}y^2}\\ 3.&\sqrt{\frac{K}{m}y^2-2gy}\\ 4.&\sqrt{\frac{K}{m}y}\\ 5.&\sqrt{2gy}\\ \end{array}$
How exactly should I find the velocity in this situation?. Could it be that since appears a square root that is related to the conservation of mechanical energy?
If this is the case it would be that:
$\frac{1}{2}ky^{2}=\frac{1}{2}mv^2$
Therefore in this situation it would be:
$v=\sqrt{\frac{ky^{2}}{m}}$
But it doesn't appear in any of the alternatives. Exactly which part did I missunderstood. Upon inspecting this problem it doesn't explicitly mentions about the height from where the bob is hanging.
But I'm assuming that the intended elongation for the spring is $y$ hence it appears in the alternatives. Therefore, can someone help me here?.
The first thing to note is that in all of options, when $y=0$ then $v=0$. So the extension of the spring is measured as a displacement from a point where the oscillating mass is stationary.
The second thing to note is that an expression for the energy of the system must contain three terms:
Adding these three terms together then conservation of energy gives us:
$\frac 1 2 mv^2 -mgy + \frac 1 2 Ky^2 = \text{constant}$
If we assume that the mass has been released when the spring is at its natural length, then $v=0$ when $y=0$, so
$\frac 1 2 mv^2 -mgy + \frac 1 2 Ky^2 = 0\\ \Rightarrow \frac 1 2 mv^2 = mgy - \frac 1 2 Ky^2 \\ \Rightarrow v^2 = 2gy -\frac K m y^2$