I know how to write down the local ordinary differential equation (ODE) via Newton's force law, balancing between the left and right rope tension and the gravity exerted on a infinitesimal piece of rope. The solution is Catenary which has the form $$ y (x)= a \cosh \left(\frac{x}{a} \right) = \frac{a}{2}\left(e^\frac{x}{a} + e^{-\frac{x}{a}}\right) $$ with appropriate boundary conditions. But I only aware the way to solve from ODE.
Could we solve the hanging rope shape using the variational principle? This means that we input the shape of the rope minimize the potential energy $V$ (because there is no kinetic $T$) for lagrangian $L= T-V$ (question 1: but this seems maximize the $L$ strangely?).
Suppose the length of the role is fixed say $\ell$. The two hanging points out horizontal apart at $x=-l$ and $x=l$.
Then we have a constraint on the length of the role is fixed say $\ell$. Then we have a constraint $$ \ell = \int_{-l}^l \sqrt{1 + y'(x)^2} dx $$ Then we minimize potential energy $V$ (but this maximizes the lagrangian $L$ strangely?) $$ V= \rho g \int_{-l}^l y(x) \sqrt{1 + y'(x)^2} dx $$ with $ \rho$ the constant density and gravity constant $g$.
I suppose we are solving the eq of motion from Variational Principle with a Constraint like $$\boxed{ V - \lambda(\ell - \int_{-l}^l \sqrt{1 + y'(x)^2} dx )= \rho g \int_{-l}^l y(x) \sqrt{1 + y'(x)^2} dx - \lambda(\ell - \int_{-l}^l \sqrt{1 + y'(x)^2} dx )} $$ How do we obtain $y(x)$ then by minimization or maximization ?
See these two related questions show no answers (!!!):