I am not sure whether I have understood your question correctly, but if it is going to help you, I could outline a derivation of equation (2), which after the application of a trigonometric identity, can be converted into pendulum's equation.
Fix a 2D inertial, orthonormal coordinate system $O\,\vec{i}\,\vec{j}$
Parametrize the curve by arc-length:
$$\vec{r}(s) = x(s)\,\vec{i} \,+\, y(s)\,\vec{j}$$ where $s \in [0, L]$ is the arc-length parameter. An arc-length parametrization is characterized by the identity
$$\left\|\frac{d\vec{r}}{ds}\right\|^2 \,=\,\Big(\,\frac{dx}{ds}\,\Big)^2+\, \Big(\,\frac{dy}{ds}\,\Big)^2 \,=\, 1$$ which is a constraint.
Then, after denoting by $R = R(s)$ radius of curvature at distance $s$ from the origin of the curve, $$\frac{1}{R^2} \,=\, \left\|\frac{d^2\vec{r}}{ds^2}\right\|^2
\,=\, \left(\frac{d^2x}{ds^2}\right)^2 \,+\, \left(\frac{d^2y}{ds^2} \right)^2$$ The length of the curve is fixed, and on top of that usually the endpoints are also fixed: one end is at the origin $O$ of the coordinate system, the other end is at positive coordinate position $(a, \,b) \,=\, a\,\vec{i} + b\,\vec{j}$
which yields the constraints
$$\vec{r}(0) \,=\, \vec{0}\,\,\text{ and }\,\,\vec{r}(L) \,=\, a\,\vec{i} + b\,\vec{j}$$
Consequently, the constraint Lagrangian is
$$\int_0^{L} \, \frac{1}{2}\,\left\|\frac{d^2\vec{r}}{ds^2}\right\|^2\,ds \,+\, \lambda \, \big(\,\vec{i}\cdot\vec{r}(L) - a\,\big) \,+\, \mu \, \big(\,\vec{j}\cdot\vec{r}(L) - b\,\big)\,+\, \nu\,\left(\,\left\|\frac{d\vec{r}}{ds}\right\|^2 - 1 \,\right)$$ which, by Newton-Leibniz, can be written as
$$\int_0^{L} \, \frac{1}{2}\,\left\|\frac{d^2\vec{r}}{ds^2}\right\|^2\,ds \,+\, \lambda \, \Big(\,\int_{0}^{L}\, \Big(\, \vec{i}\cdot\frac{d\vec{r}}{ds}\,\Big)\,ds - a\,\Big) \,+\, \mu \, \Big(\,\int_{0}^{L}\, \Big(\, \vec{j}\cdot\frac{d\vec{r}}{ds}\,\Big)\,ds - b\,\Big)\,+\, \nu\,\left(\,\left\|\frac{d\vec{r}}{ds}\right\|^2 - 1 \,\right)$$
an then
$$\int_0^{L} \,\left(\, \frac{1}{2}\,\left\|\frac{d^2\vec{r}}{ds^2}\right\|^2 \,+\, \lambda\, \Big(\, \vec{i}\cdot\frac{d\vec{r}}{ds}\,\Big) \,+\, \mu \, \Big(\, \vec{j}\cdot\frac{d\vec{r}}{ds}\,\Big)\,\right)\,ds\,+\, \nu\,\left(\,\left\|\frac{d\vec{r}}{ds}\right\|^2 - 1 \,\right) \,-\, \lambda\,a - \mu\, b$$ where the constant terms can be removed, yielding the constraint Lagrangian
$$\int_0^{L} \,\left(\, \frac{1}{2}\,\left\|\frac{d^2\vec{r}}{ds^2}\right\|^2 \,+\, \lambda\, \Big(\, \vec{i}\cdot\frac{d\vec{r}}{ds}\,\Big) \,+\, \mu \, \Big(\, \vec{j}\cdot\frac{d\vec{r}}{ds}\,\Big)\,\right)\,ds\,+\, \nu\,\left(\,\left\|\frac{d\vec{r}}{ds}\right\|^2 - 1 \,\right)$$ In order the reduce the order of the derivatives, substitute
$$\vec{u}(s) \,=\, \frac{d\vec{r}}{ds}(s)$$
and the Lagrangian is now
$$\int_0^{L} \,\left(\, \frac{1}{2}\,\left\|\frac{d\vec{u}}{ds}\right\|^2 \,+\, \lambda\, \Big(\, \vec{i}\cdot\vec{u}\,\Big) \,+\, \mu \, \Big(\, \vec{j}\cdot\vec{u}\,\Big)\,\right)\,ds\,+\, \nu\,\left(\,\left\|\vec{u}\right\|^2 - 1 \,\right)$$
One can easily remove the last holonomic constraint by introducing $\theta = \theta(s)$ such that
$$\vec{u}(s) \,=\, \cos\theta(s)\,\vec{i}\,+\, \sin\theta(s)\,\vec{j}$$ which turns the Lagrangian into
$$\int_0^{L} \,\left(\, \frac{1}{2}\,\left(\,\frac{d\theta}{ds}\,\right)^2 \,+\, \lambda\, \cos(\theta) \,+\, \mu \, \sin(\theta)\,\right)\,ds$$
The Euler-Lagrange equation is
$$\frac{d^2\theta}{ds^2}\,=\, -\,\lambda \,\sin(\theta) \,+\, \mu\, \cos(\theta)$$
By certain trigonometric identities, one can find $\omega$ such that if one makes the substitution $\varphi \,=\, \theta + \omega$ the equation becomes something like
$$\frac{d^2\varphi}{ds^2} \,=\, -\, \Big(\,\sqrt{\lambda^2 + \mu^2}\,\Big)\,\cos(\varphi)$$