When a wire is stretched, work is done against the interatomic forces, this work is stored as elastic potential energy in the wire.
Work done = average force × increase in length W=2F×l=U
Let A be area of cross-section of the wire,
then U=21(AF)×(Ll)×LA U=21stress×strain×volume of wire
Hence, energy per unit volume U=21×stress×strain