This is a seemingly small but annoying problem I can't seem to find an answer to. I have a problem of the form
$$J(y) = \int^{x_1}_{0} F(x,y,y') \,ds + \int^{x_2}_{x_1} G(x,y,y') \,ds$$
where the boundary conditions at the endpoints at $x = 0, x= x_2$ are known and $x_1$ is allowed to vary. In other words I am trying to minimize the competing functionals.
Since you're letting $x_1$ be free, your functional is better written $J(y,x_1)$. It's pretty simple to work out the Euler-Lagrange conditions if you think about it in the right way.
First, by considering variations of $y$ that keep it fixed on $(x_1,x_2)$, we see that on the interval $(0,x_1)$, $y$ must satisfy the usual Euler-Lagrange equation for $F$; and likewise on $(x_1,x_2)$ that of $G$.
Now note that if $F(x_1,y(x_1),y'(x_1)) > G(x_1,y(x_1),y'(x_1))$ we can increase $J(y,x_1)$ by increasing $x_1$, and the reverse if $F<G$; so the final condition to have a stationary point is that $F(x_1,y(x_1),y'(x_1)) = G(x_1,y(x_1),y'(x_1))$.
Since any first variation of $(y,x_1)$ can be written as a sum of a function on $(0,x_1)$, a function on $(x_1,x_2)$ and a velocity $x_1' \in \mathbb R$, these three conditions are exactly what is required for $(y,x_1)$ to be a stationary point of $J$.