# Getting 2 different answers when finding spring constant $k$ when gravity is involved

OK, so I've been wracking my brain for the past hour trying to figure out how to calculate k in a problem like this:

A mass of 10 kg is attached to a spring hanging from the ceiling. It is released, allowed to oscillate, and comes to rest at a new equilibrium point 10 meters below the spring's natural length. What is the value of the spring constant k for this spring?

There's two approaches that are giving me different answers:

1: We can use forces: at equilibrium, the force of gravity will equal the spring force, so mg = kx. This gives a value of (10)(9.8) = k (10) or k = 9.8.

2: We can use potential energy. Before the mass is released, it has gravitational potential energy; at the new equilibrium, it has LESS gravitational PE, but more elastic PE, since it is now stretched. The elastic PE must have been converted from gravitational PE, so dPE (elastic) = dPE (gravitational). Since the change in height is the same as the change in stretch, the h in mgh = the x for spring stretch. So:

dPE (elastic) = dPE (gravitational), h = x

.5kx^2 = mgx

.5kx = mg

k = 2mg/x

Plugging in, we get k = 2(10)(9.8)/10 or k = 19.6, which is twice as much as the k found through the other method.

I must be missing something here, why am I getting two different values for k depending on which approach I use?

After you release the mass it accelerate downwards and at the static equilibrium position it has lost $mgx$ of gravitational potential energy whilst at the same time gaining $\frac12 kx^2$ elastic potential energy and $\frac 12mv^2$ kinetic energy.
So the mass overshoots the static equilibrium position and finally stops when the extension is $2x$.
At this position it has lost $mg(2x)$ gravitational potential energy whilst at the same time gaining $\frac12 k(2x)^2$ elastic potential energy.
Equating these two energies gives the same value of the spring constant as that found using the static extension $k=\frac{mg}{x}$.