In stretching a wire work is done against internal restoring forces. This work is stored in the wire as elastic potential energy or strain energy.
A and stretches it by x then
Dividing both sides by volume of the wire we get energy stored in unit volume of wire.
[As AL = volume of wire]
∴ Thermal energy density = Thermal energy per unit volume = 12 Thermal stress x strain