My approach was to find x from the force equation which was about 2.5 inches and then set the kinetic energy of the object equal to the potential of the spring and solve for velocity but I am not sure how to change the force equation to fit in 1/2 kx^2

could someone tell me if this is the wrong approach or how to change the equation please