A wire of length L and cross-section 'A' has Young's modulus of material Y. It is stretched by an amount 'x'. The work done against restoring force is
YAx2L
YAx22L
2YAx2L
Total energy = 12×stress×strain×volume
= 12×Y×(strain)2×volume
= 12Y×x2L2×AL = 12YAx2L