Write expression for energy stored in a spring

Ganesh Gani's image