how to calculate potential energy of a spring?
Just use the formula:
PE = 1/2 k x²
k : Spring Constant
x : Extension of the spring