Dear Student,
The Potential Energy of a stretched wire is given by,
PE = ½ × stress × strain × volume
=> PE = ½ × (F/A) × (ΔL/L) × (AL)
Now,
Y = (F/A)/(ΔL/L)
=> F = AYΔL/L
So, PE = ½ × (YΔL/L) × (ΔL/L) × (AL)
=> PE = AY(ΔL)2/(2L)
Regards.........