Please see edits at bottom - I think they are at the heart of my misunderstanding
It seems that I have a misunderstanding of the physical meaning behind the potential energy integrals and so I'm hoping someone can help set me straight. The misunderstanding arose in the following question from Taylor's Classical Mechanics:
A massless spring has unstretched length $l_0$ and force constant $k$. One end is now attached to the ceiling and a mass $m$ is hung from the other. The equilibrium length of the spring is now $l_1$. (a) Write down the condition that determines $l_1$. Suppose now the spring is stretched a further distance $x$ beyond its new equilibrium length. Show that the net force (spring plus gravity) on the mass is $F=-kx$. That is, the net force obeys Hooke's law, when $x$ is the distance from the equilibrium position — a very useful result, which lets us treat a mass on a vertical spring just as if it were horizontal. (b) Prove the same result by showing that the net potential energy (spring plus gravity) has the form $U(x) = const +\frac{kx^2}{2}$.
Part a) is fairly easy, but in part b) I couldn't get all of the first-order terms to vanish and I think that comes from a fundamental misunderstanding. I'll present my work for part b) below:
We consider a coordinate system where the origin is measured positively downward from the ceiling ($y$) while the reference point of the potentials is at a distance $l_0$ down from there. There are two forces on the body in question (each conservative), and thus we can define a total potential energy as the sum of the two potentials,
$$U(y)=U_g(y)+U_s(y)=-\int\limits_{l_0}^{y}mgdy'-\int\limits_{l_0}^{y}-k(y'-l_0)dy'=-mgy+mgl_0+\frac{k(y-l_0)^2}{2}.$$ Expanding, we get
$$U(y)=-mgy+mgl_0+\frac{ky^2}{2}-kyl_0+\frac{kl_0^2}{2}=const-y(kl_0+mg)+\frac{ky^2}{2}.$$ That middle term won't vanish and I think it's because I'm somehow misrepresenting the coordinate system with the bounds of integration or something like that.
As an aside (the second question alluded to in the title), could I have used two different reference points (datums) for the two integrals? My suspicion is yes, since applying the gradient operator would recover the requisite force from each, but I wanted to confirm.
EDIT begins
I now (think that I) have a modified and better understanding of what's going on here. I believe that Taylor is asking for a Taylor expansion (to second order) of the potential function about the equilibrium point $l_1$.
Performing this, where we let the variable $x$ be some distance around the point $y=l_1$, we get
$$U(x)=U(l_1)+U'(l_1)(x)+\frac{U''(l_1)}{2}(x)=const-l_1(kl_0+mg)+\frac{kl_1^2}{2}+(-(kl_0+mg)+kl_1)x+\frac{k}{2}x^2.$$
Simplifying, and collecting all constants, we get
$$U(x)=const+(k(l_1-l_0)+mg)x+kx^2=const+\frac{k}{2}x^2$$
which is the required result. Ultimately my question is what does it "mean" to Taylor expand our potential function about an equilibrium point. I know that we can arbitrarily redefine our potential up to some additive constant, so does this redefinition of the potential in terms of $x$ (using a Taylor expansion) amount to nothing more than a redefinition of the potential function (by a translation)?