Let’s think of an elastic member whose length is l, and whose cross-sectional area is A, which is subjected to an external axial load W. If the applied load is increased gradually from zero to the value W, the member also increases by δ.

So, the work is done by the load is equal to the product of the average load and the displacement δ.
External work is done = We =(1/2)⨯Wδ = 0.5⨯Wδ
Let, the energy stored by the member be Wi. Since the work done by the external force on the member equals the energy stored by it, we have, We=Wi
Let the tension in the member be S.
For the equilibrium of the member, S=W.

The intensity of the tensile stress = f =S/A.
Now, tensile strain = e = f/E = f/AE.
Where E is Young’s Modulus of the material of the member.
So, change in length of the member =δ= strain⨯ stress.
Or, δ = el = Sl/AE
Now, Strain energy stored = Work done = 0.5⨯Wδ
After putting the value of W and δ in the above equation, we get
Strain energy stored = 0.5⨯ S⨯(Sl/AE) = 0.5⨯(S2l/AE) =S2l/2AE.

In this case, the strain energy stored is due to axial loading on the member.
Strain energy stored per unit volume of the member = (S2l/2AE)/Al = S2l/2A2E = f2/2E.