An elastic spring of force constant k is compressed by an amount x. Then its potential energy will be