Hooke's Law states thatthe stress developed inside an elastic body is directly proportional to the strain responsible for it.
Hooke's law for a spring
The force needed to extend or compress a spring by distance is directly proportional to the amount of expansion or compression.
And this force can be written as: ; Where, = force applied on the spring, = spring stretch or compression, =spring constant.
Explanation
The restoring force is the force that acts on the spring, which is responsible for bringing the spring to its equilibrium position after being stretched or compressed.
This restoring force always acts opposite to the direction of externally applied force.
Hence there is a negative sign in the spring force equation.