The force applied to the spring is the weight of the object that compresses it, so it is equal to:

Because of this force, the spring compresses by

. Using Hook's law,

,
since we know the intensity of the force (the weight W) and the compression of the spring, x, we can find k, the spring constant:
