I'm puzzled about the potential energy of a spring. A spring is a conservative system. So the potential energy should be defined only up to a constant -- can be defined to be 0 anywhere. However, one cannot escape needing the un-stretched length of the spring.
For example, the difference in gravitational potential energy between two heights $h_1$ and $h_2$ is: $$\Delta U = mg(h_2 - h_1)$$
However, the difference in potential energy between two points of extension is as follows:
Let one end of the spring be at $x=0$. Let the other end of the un-stretched spring be at $x_0$. Now find the difference in spring potential energy between two other points of extension $x_1$ and $x_2$. Let $k=2$ in some units of force.
$$\Delta U = (x_2 - x_0)^2 - (x_1 - x_0)^2 = (x_2-x_1 )\cdot(x_2 + x_1 - 2x_0)$$
Which is not a function only of $x_2-x_1$
Of course, this also agrees with the work integral.
What am I missing? ( I have a PhD in physics, so I should know better ;) )