mikelepore said:
If you have a constant applied force F, the spring will start deforming, and that displacement will stop at some position x.
You have an interesting point here.
Imagine a very weak spring; it takes next to no force at all to compress it. It is actually
impossible to exert a large force upon a weak spring.
Assume that the motion of compressing the spring is
slow. The reason to compress slowly is to avoid effects that arise from inertia. Now, in compressing a spring slowly the amount of force you can exert upon the spring depends on the counterforce from the spring
Let's say you are using a hydraulic jack to exert force upon the spring. Let's say you removed one of the wheels of a car, you have placed a jack under the coil spring of that wheel's suspension. You are using a jack with a force gage. As you jack up, what will the force gage read?
Initially, when the jack
just touches the spring, the force gage will read a very low number. Next you jack up a fraction of a milimeter: the amount of force that the force gage reads will still be small, since a small force suffices to compress the spring just a fraction of a milimeter. As the spring is compressed more and more, more and more force is needed.
At all times the amount of force that the jack is exerting upon the spring is the same as the counterforce from the spring. (More precisely: in order to compress the force upon the spring needs to be a fraction larger than the spring's counterforce. Just a fraction.)
Therefore to evaluate the work done upon the spring the force at each point along the way is the force as described by Hooke's law. (If you use Hooke's law for the approximation.)
Possibly what you have in mind is a scenerio where a heavy object that is in motion makes contact with a spring, for example a moving train making contact with a spring buffer at the end of a railway track.
Does the train start exerting full force right at the
very instant that it makes contact with the buffer spring? No, it doesn't. In order to exert a force the train must be decelerating (it takes a force to decelelate). In the instant after contact is made the compression of the spring is still minute, so the force exerted by the spring upon the train is still minute, hence just a minute deceleration, hence just a minute force from the train upon the spring. Of course, as the compression of the spring proceeds the force becomes larger and larger, and the train does come to a stop.