A block of mass m initially at rest is dropped from a height h on to a spring of force constant k. the maximum compression in the spring is x then
Change in gravitational potential energy
= Elastic potential energy stored in compressed spring
⇒mg(h+x) = 12kx2