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?
The first method F = mg = kx is what you would use to find the spring constant k. The second equation is used for the dynamic problem "How fast is the mass moving at distance x?". To solve, equate the potential energy "lost" by the downward motion to the potential energy of the spring AND the kinetic energy of the object: E = mgx = (1/2 kx^2) + (1/2 mv^2)