The spring extends by x on loading, then energy stored by the spring is :(if T is the tension in spring and k is spring constant)
T22k
T22k2
2kT2
2T2k
U=F22k=T22k