I've been being confused lately as to the 2 methods. The example I'm thinking of is when a weight of mass m is hung on a spring and it stretches x meters. First of all, I know you can equate the spring force (kx) to the force of gravity (mg), to get k = mg/x But is it also possible to say that the gravitational potential energy lost (mgx) is equal to the energy gained by the spring (1/2 kx^2)? When I do this, I get a different k which is half the original k and probably wrong. How can you calculate K for this problem using energy?