find energy stored in elongated or compressed strring.
Kindly refer to the link given below for an answer to a similar query :
https://www.meritnation.com/ask-answer/question/derive-the-expression-for-elastic-energy-stored-in-a-spring/physics/3255381
https://www.meritnation.com/ask-answer/question/derive-the-expression-for-elastic-energy-stored-in-a-spring/physics/3255381