Solution (source code)

= Solution

Write $I[y]=\int_a^bG(x,y,y')\,dx$. For endpoint-zero variations $\eta$, the <first variations> are
$$
\delta J(\eta)=\int_a^b(F_y\eta+F_{y'}\eta')\,dx,\qquad
\delta I(\eta)=\int_a^b(G_y\eta+G_{y'}\eta')\,dx.
$$
For a normal constrained <extremal>, choose a variation $\eta_0$ with $\delta I(\eta_0)\ne0$. Given any $\eta$, use the <implicit function theorem> to choose a small correction in the $\eta_0$ direction so that $y+t\eta+s(t)\eta_0$ preserves the constraint. Differentiating it and the stationarity condition at zero gives
$$
\delta J(\eta)=\lambda\delta I(\eta),\qquad
\lambda=\frac{\delta J(\eta_0)}{\delta I(\eta_0)}.
$$
Integrate the derivative-of-variation term by parts. Since the variations vanish at both endpoints, the <boundary term> is zero. The <fundamental lemma of the calculus of variations> then gives
$$
\boxed{(F-\lambda G)_y-\frac d{dx}(F-\lambda G)_{y'}=0.}
$$
The regularity condition on the constraint is what permits the coefficient of $F$ to be normalized to 1. In a degenerate case, the general multiplier statement uses $\lambda_0F-\lambda_1G$ with the two coefficients not both zero; the source's displayed form is the normal case.

For a string described as a <function graph> $r(x)=(x,y(x))$, its arc-length element is $|r'(x)|\,dx=\sqrt{1+y'(x)^2}\,dx$. Inextensibility therefore gives
$$
\boxed{\int_0^{2a}\sqrt{1+y'^2}\,dx=l.}
$$
This also forces $l\ge2a$, with equality only for the straight <function graph>.