If a spring extends by x on loading ,then energy stored by the spring is(if T is the tension in the spring and k is the spring constant)
T22x
T22k
2kT2
2T2k
work = Force.displacement dw =F.dx---(1) in a spring F=-kx⇒ dF=-kdx⇒ -dFk=dx---(2) substitute eqn(2) in (1) dw =F(-dFk)⇒ integrating ∫dw =∫F(-dFk)⇒ w=-F22k here work w is energy stored F is tension in the spring T negative is for restoring force of spring ∴energy stored =T22k