AS no ext force acts on the system
energy is conserved
(1) the kinetic energy cinverts into spring potential energy
1/2 mv^2 = 1/2 kx^2
x=vroot(m/k)
x=1.5 m
(2) As the body returns backwards ,towards it's original position
decrease in P.E = W.D
decrease in P.E=change in K.E
1/2kx^2 = 1/2 mv^2-0 {this cond is from the position where the vel of body is zero , i.e. at max compression stage}
v= 3m/s
minus sign signifies the direction