If I have a variational problem of the form:
$$\min \int_{a}^{b} F(x, y(x), y'(x)dx\quad\text{subject to}\quad \int_{a}^{b} G(x, y(x), y'(x))dx=C\tag{1}$$
The solution can be found by transforming the problem into an unconstrained problem:
$$\min \int_a^b H(x, y(x), y'(x), \lambda)dx\tag{2}$$
Where, $$H(x, y(x), y'(x), \lambda)=F(x, y(x), y'(x))-\lambda G(x, y(x), y'(x))\tag{3}$$
WHERE $\lambda$ is a Lagrange multiplier and solve then the Euler-Lagrange equation:
$$\frac{d}{dx}H_{y'}-H_y=0\tag{4}$$ together with the constraint.
Now, suppose my constraint becomes $$\int_{c}^{d} G(x, y(x), y'(x))dx=C\tag{5}$$ instead of $$\int_{a}^{b} G(x, y(x), y'(x))dx=C .\tag{6}$$ If $a\neq c$ or $b\neq d$ I cannot use the same trick, how can I solve the problem?