I have a question on solving an optimization problem with calculus of variations.
I am attempting to maximize the functional
$$ J[y] = \displaystyle\int_a^b F(x,y,y') \, \mathrm{d}x, \tag{1}$$
but my constraint is not in integral form; it is an inequality
$$ 0 \leq g(x,y,y') \leq 1, \tag{2}$$
Is it possible to solve this with calculus of variations?
I have rewritten the constraint to the form of $ g(x,y,y')-g(x,y,y')^2 \geq 0 $ and I think I should use Lagrange multiplier in form of $\lambda(x)$ and $\lambda(x) \geq 0 $ as follows:
$$ L(y)=\int_a^b F(x,y,y')+\lambda(x)(g(x,y,y')-g(x,y,y')^2) \, \mathrm{d}x $$
In this way my problem got very complicated and non-solvable, can anybody guide me to the correct or better solution. Thanks in advance and any suggestion will be appreciated.
We can introduce slack functions $s_1, s_2$ such that the inequality constraints $g (x, y, y') \geq 0$ and $g (x, y, y') \leq 1$ can be replaced by the following equality constraints
$$g (x, y, y') - s_1^2 (x, y, y') = 0, \qquad \qquad g (x, y, y') + s_2^2 (x, y, y') = 1$$
The Lagrangian then becomes
$$F (x, y, y') + \lambda_1 (x) \left( g (x, y, y') - s_1^2 (x, y, y')\right) + \lambda_2 (x) \left( g (x, y, y') + s_2^2 (x, y, y') - 1\right)$$
I do not know what the corresponding Euler-Lagrange equations would be, though.