If k is the spring constant and x is the deformation, the magnitude of spring force is given by
F=2kx2
F=kx
F=2kx
F=kx4
Spring force is directly proportional to the deformation (elongation or compression).
F∝x
⇒F=kx where k is the spring constant.
If a spring of spring constant k extends by x on loading due to an applied force F, then the energy stored by the spring is