I am trying to remind myself of variational calculus and wanted to try and derive the catenary equation, but the final equation, although corresponding to what I can find on the internet, seems incomplete. Am I misunderstanding what I am actually asking the math to do?
I started with writing the total energy of the hanging wire as
$$ E = \int_{x_1}^{x_2}{\gamma gy\sqrt{1+y'^2}dx}, $$
where $\gamma$ is the linear density.
$\gamma g$ being just a scaling factor, I need to minimize
$$ \int_{x_1}^{x_2}{y\sqrt{1+y'^2}dx} = \int_{x_1}^{x_2}{L(y,y')dx}. $$
This leads to the usual formulation of
$$ \frac{\partial L}{\partial y} - \frac{d}{dx}\frac{\partial L}{\partial y'} = 0. $$
In this case this has yielded $1 + y'^2 - yy''= 0$. Using substitution $y'= u$ I have arrived to the solution
$$ u = \frac{dy}{dx} = \sqrt{C_1^2y^2 - 1}, $$ $$ y = \frac{1}{C_1}\cosh(C_1x + C_2), $$
which, if $C_2 = 0$, apart from $C_1$ being upside down, seems to agree with the common one. The question I have now is where is the constant which would allow me to shift the whole shape vertically. It feels to me that the final equation should look like $y = \frac{1}{C_1}\cosh(C_1x + C_2) + C_3$. Otherwise, the catenary can't go below $0$, which it should be able to do, at least in my mind, due to the positions of the edge points being arbitrary. The problem is, this equation does not fit into the initial differential equation unless $C_3 = 0$.
Is this just a case of potential energy only being defined relative to a certain "floor" height? If I write the initial equation as
$$ E = \int_{x_1}^{x_2}{\gamma g(y - y_0)\sqrt{1+y'^2}dx}, $$
mathematically I get what I want, but it feels as if something is lacking in my understanding.
If possible, please point me in the direction of a ground-up explanation. My field being electromagnetics, I haven't seen rigorous mechanics in about 5 years and it is currently making my brain generate smoke when I think about it.