Find the energy stored in a spring when it is stretched or compressed