# Velocity using spring contraction

I'm trying to determine the maximum final velocity of a body with which it contracts a spring until it touches the wall. It happens only with the presence of maximum energy. So, I've taken the kinetic energy and used the first derivative to obtain the maximum velocity. Is this the right way to solve this problem? It only gives the minimum velocity which is zero..!

-
Of the original kinetic energy of the body, some goes into potential energy in the spring and the remainder is left as kinetic energy of the now slowed object ... –  John Rennie Sep 25 '12 at 17:40
potential energy means it goes to friction? I'm taking friction as zero. That means it doesn't stop. –  BadSniper Sep 25 '12 at 17:44
@BadSniper: Hello Bad Sniper, What are you going to find actually..? Using the compressibility and length of spring to find the maximum velocity with which the object smashes the spring..? I think your question is unclear..! –  Waffle's Crazy Peanut Sep 25 '12 at 18:02
yes, I'm trying the find the maximum velocity obtained by a body when spring is compressed until the body touches the wall. –  BadSniper Sep 25 '12 at 18:04
Potential energy is the energy stored in the spring, not friction. –  John Rennie Sep 25 '12 at 18:17