Hooke's law describes the force exerted back by the spring. When a force is applied to a spring, it is tied at one end to stretch or push it, and a response force is created to resist the change. The spring uses this power to pull its detached end. Hence, Hooke's law is the name given to it.
Mathematical representation of Hooke's law
Analyzing the spring
A negative sign indicates that the spring's deformation is reversed by the restoring force.
As long as x is small in comparison to the total possible deformation of the spring, the connection remains good.
If a great deal of force is applied to the spring, it can expand beyond a point where it will deform.
On the release of the stress, the spring will revert to a permanently distorted shape, which will be different from its initial shape.
Hence, the spring force is known as restoring force.