A question in my textbook says - A block of mass $m$ is released from rest onto an ideal non deformed spring from a negligible height. Neglecting air resistance, find compression $x$ of the spring. I tried using two approaches for this Q but I can't figure out which one if right or if both are wrong.
Using Hooke's Law. $$ mg -kx = 0 $$ $$ x = (mg) / k $$
2nd - Using Work-Energy theorem. Considering the Gravitational potential energy at the lowest point of the compression to be 0 and since change in KE is 0.
$$ mgx -(kx^2)/2 = 0 $$ $$ mgx = (kx^2)/2 $$ $$ x = (2mg)/k $$
Is any of my approach correct? If yes then why is the other one wrong? Or are both completely wrong?