An $8.00\ \mathrm{kg}$ stone at rest on a spring. The spring is compressed $10.0\ \mathrm{cm}$ by the stone. What is the spring constant?
I used conservation of energy to solve this problem. The stone goes from the higher point to the lower point, whose distance from the higher one is $10\ \mathrm{cm}$. That means gravitational force has done work on the stone, the value of which is $mgh = 8 \times 9.8 \times 0.1 = 7.84$. The gravitational force does work on the stone that increases the kinetic energy of the stone. However the stone is at rest which means its kinetic energy is $0$. So there must be something done negative work on the stone to decrease its kinetic energy to zero which must be equal to work done by the gravitational force. That is the elastic force done by the spring, which has work calculated by $0.5\ kx^2$ where $x$ is the distance by which spring is compressed. So $$mgh = -0.5\ kx^2$$
At the end the value $k$ I get is $1568\ \mathrm{N/m}$. However, my friend used a different method, saying the stone is at rest so the force done by the spring equals the stone's weight. He takes $$kx=-mg$$ and he gets $k = 784\ \mathrm{N/m}$
His method is quite right and consistent with the laws of physics. I cant find anything wrong with his method. So that means my method is wrong since the answer is different but I don't notice anything wrong with that. Please point it out for me.