In a variational problem, where one seeks function $y(x)$ that is an extreme of a functional $$ J[y]=\int_a^b L(y(x), y'(x), x) \, dx\;, $$ one can constrain $y(x)$ by condition $$ C[y]=\int_a^b G(y(x), y'(x), x) \, dx=g $$ by the formalism of Lagrange multipliers. Is there a technique by which one can constrain function $y(x)$ or its derivative $y'(x)$ to have values in interval $[y_{min}, y_{max}]$ or $[y'_{min}, y'_{max}]$?
I am aware of possibility to define $G(y(x), y'(x), x) = 1$ for $y(x)$ or $y'(x)$ outside the interval and $G(y(x), y'(x), x) = 0$ inside and then apply Lagrange multipliers, but then the solution of my problem seems difficult to perform, so I am looking for other options.
Background: I am trying to find optimal trajectory of rocket with variable specific impulse described here. Unconstrained solution contains unlimited specific impulse and I would like to cap it by a maximum value. In the problem, the specific impulse corresponds to $y'(x)$.