Solution (source code)

= Solution

With fixed endpoint values, a smooth extremal satisfies the <Euler-Lagrange equation> $F_y-(d/dx)F_{y'}=0$. If $F$ has no explicit $x$ dependence, differentiation gives
$$
\frac d{dx}(F-y'F_{y'})=y'\left(F_y-\frac d{dx}F_{y'}\right)=0.
$$
Thus $F-y'F_{y'}$ is constant, the <Beltrami identity>.

For this integrand, $F_y=2y$ and $F_{y'}=1+2y'$, so the equation is $y''=y$. Consequently
$$
\boxed{y(x)=Ae^x+Be^{-x}}.
$$
The two constants are fixed uniquely by the prescribed values at distinct endpoints. Equivalently, writing these values as $y_1,y_2$,
$$
y(x)=\frac{y_1\sinh(x_2-x)+y_2\sinh(x-x_1)}{\sinh(x_2-x_1)}.
$$
Its first integral is $y^2-y'^2$, which is constant. Using only that first integral without the <Euler-Lagrange equation> could admit spurious constant functions, so the differential equation was used directly.

For any nonzero endpoint-vanishing perturbation $\eta$, the linear terms in $J[y+\eta]-J[y]$ vanish by the <Euler-Lagrange equation> and <integration by parts>; also $\int\eta'=0$. The remainder is
$$
J[y+\eta]-J[y]=\int_{x_1}^{x_2}(\eta^2+\eta'^2)\,dx>0.
$$
Hence the extremal is the \b[unique strict global minimum], and cannot be a maximum.