What's wrong with my derivation for the spring constant? 
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.
 A: In short: you have calculated the maximum displacement of the stone, and your friend has calculated the equilibrium displacement.
If you place the stone of mass $m$ on the spring (which I assume to be of negligible mass), the stone ends up oscillating around the equilibrium point. So the sum of the potential energy stored in the spring and the kinetic energy of the stone needs to be equated to the gravitational potential energy at start:
$$\frac12 k x^2 + \frac12 m v^2 = m g x$$
Here $v$ represents the velocity of the stone at the moment it passes through the equilibrium point with displacement $x$. Now you don't know $v$, so this energy balance method is not very helpful. Of course you can assume the movements eventually dampen out (e.g. due to air friction), but this means you would have to take into account the energy used to heat the air, and again: you have no information on this. 
Your friend is using a force balance equation ($k x = m g$), and this method works fine.
Your energy method is useful for determining the amplitude of the oscillation of the spring. In fact, what you have calculated is the maximum displacement (the displacement when the stone reverses its velocity and momentarily has vanishing speed). This maximum displacement is $\sqrt2$ times the equilibrium displacement.
A: Short answer:
The distance the rock falls in your thought experiment is not the same as the spring compression described in the actual question.
Long answer:
In your thought experiment, the rock is released from rest and it falls some distance before turning around. So the question arises:

*

*For an object of mass $m$ released from rest just touching a relaxed spring of constant $k$, how far will the mass fall before turning around?

Your analysis applies here. Let the distance be $d.$ The work $\frac{1}{2} k d^2$ done by the spring is equal in magnitude to the work $mgd$ done by the Earth:
$$\frac{1}{2}kd^2=mgd\tag{1}$$
You can use this equation to solve for the distance $d$ the rock falls.
But the actual question is different: The experiment that needs to be done in order to go from a rock just touching the spring to the rock at rest and at equilibrium with the spring (and gravity) is the following:

*

*The rock is held (by a hand) at rest just touching the spring.

*The rock is slowly lowered by hand until it reaches the equilibrium position.

*The rock is released (by the hand), leaving only the spring and gravitational force on it.

During this process, negative work is done by the hand on the rock. This work was not accounted for in your solution.
Thus, the answers are different.
