Elastic potential energy is defined as