We assume that the deformation is wholly due to external load, neglecting the effect of the weight of the rod. Then a well known formula says, elastic energy per unit volume
=12stress×strain=12σε
This gives 12mρEε2≈0.04kJ for the total deformation energy.