# Spring mass damper system: Distance from equilibrium after applying velocity to mass

I have a spring fixed to a wall on one end and a mass object on the other end in its natural resting position. The question is how far does the spring stretch when a velocity $$v_0$$ is applied to it, assuming there is no friction.

My idea was that the spring will be stretched until the velocity $$v_0=0$$ and the kinetic energy $$k=0$$ resulting in the max $$E_{pot}$$.

However I can't figure out a relationship between $$E_{kin}$$ and $$E_{pot}$$ other than $$E_{kin} + E_{pot} = E_{total}$$ and therefore I don't know how to continue from here on.

Initially the mass has kinetic energy $$\frac 1 2 mv^2$$ and the spring has potential energy $$E_{pot}=0$$. So $$E_{total} = \frac 1 2 mv^2$$.
When the spring is fully extended, the velocity of the mass is $$0$$, so $$E_{kin}=0$$, and the potential energy is a function $$f$$ of the spring's maximum extension $$x_{max}$$. So $$E_{total}=f(x_{max})$$.
Since there is no friction, $$E_{total}$$ is conserved so $$\frac 1 2 mv^2 = f(x_{max})$$.
Find an expression for the potential energy of the spring $$f(x_{max})$$ - this will involve the spring constant - and then re-arrange this equation to find $$x_{max}$$ as a function of $$m$$, $$v$$ and the spring constant.