When a wire is stretched,work is done against the internal restoring forces acting between the particles of the wire. This work done is stored as elastic potential energy in the wire.
Consider a wire of length $L$ and cross-sectional area $A$. Let a deforming force $F$ be applied to the wire,resulting in an extension $l$.
From Young's modulus $Y = \frac{FL}{Al}$,we have $F = \frac{YAl}{L}$.
To increase the length by an additional small amount $dl$,the work done is $dW = F dl = \frac{YAl}{L} dl$.
To find the total work $W$ done to increase the length from $0$ to $l$,we integrate:
$W = \int_{0}^{l} \frac{YAl}{L} dl = \frac{YA}{L} \left[ \frac{l^2}{2} \right]_{0}^{l} = \frac{1}{2} \frac{YA}{L} l^2$.
This can be rewritten as:
$W = \frac{1}{2} \times \left( \frac{Yl}{L} \right) \times (l) \times A = \frac{1}{2} \times \text{Stress} \times \text{Strain} \times \text{Volume}$.
Thus,the elastic potential energy stored is $U = \frac{1}{2} \times \text{Stress} \times \text{Strain} \times \text{Volume}$.