A spring with spring constant k is extended from x=0 to x=x1. The work done will be
kx12
12kx12
2kx12
2kx1
w=∫0x1kx dx=12kx12