Optimal trajectory of rocket with variable specific impulse and constant power I am trying to derive trajectory of rocket with variable specific impulse and given power of engines $P$ that minimizes the total time. The specific impulse is given as time-variable effective exhaust velocity $v_{eff}(t)$. There is no gravitational field. The rocket starts with zero velocity and at the end of the maneuver must have again zero velocity.
The equations of motion
$$
\begin{align}
\ddot{x}\,=\frac{F(t)}{m(t)},\;
\dot{m}=-\frac{2P}{v_{eff}(t)^2},\;
F(t)=-\dot{m}\,v_{eff}(t)=\frac{2P}{v_{eff}(t)}
\end{align}
$$
can be written as functions of current rocket mass
$$
\frac{dt}{dm}=-\frac{v_{eff}(m)^2}{2P}\;,
\frac{dv}{dm}=-\frac{v_{eff}(m)}{m}\;,
\frac{dx}{dm}=-v\frac{v_{eff}(m)^2}{2P}\;.
$$
In this form, the equations are separable and one can write solution 
$$
\begin{align}
t(m)&=\int^{m_{0}}_{m}\frac{v_{eff}(m)^2}{2P}dm\\
v(m)&=\int^{m_{0}}_{m}\frac{v_{eff}(m)}{m}dm\\
x(m)&=\int^{m_{0}}_{m}v(m)\frac{v_{eff}(m)^2}{2P}dm
\\
\end{align}
$$
for any $v_{eff}(m)$. $m_0$ is the initial mass of the rocket.
I would like to find $v_{eff}(m)$ so that 


*

*$v(m_{end})$ is zero (the rocket stopped at its destination)

*$x(m_{end})$ is fixed constant during minimization

*$t(m_{end})$ is minimal.


Normally, I would write Euler-Lagrange equation with Lagrange multipliers for conditions 1 and 2, as both the functions are under the same integral as $t(m)$, but since $v(m)$ is present under the integral for $x(m)$, it does not conform to the formalism as I know it. Any advise how to proceed?
 A: At the end, the problem just needed another few days of thinking. I think I do have a solution and I will share it, maybe it will be interesting for somebody else.
The functional to minimize using Lagrange multipliers for velocity and position is
$$
F(v_{eff}, m)=\int_{m_{end}}^{m_0}\frac{v_{eff}^2}{2P}+\lambda_1 \frac{v_{eff}}{m} + \lambda_2 v(m)\frac{v_{eff}^2}{2P}\;dm\;.
$$
If we notice that $v_{eff}(m)=-m \,v'(m)$, it can be rewritten in terms of $v(m)$ as
$$
F(v,v', m)=\int_{m_{end}}^{m_0}\frac{m^2v'^2}{2P}-\lambda_1 \frac{m v'}{m} + \lambda_2 v\frac{m^2v'^2}{2P}dm
$$
and then the Euler-Lagrange equation reads
$$
\lambda_2 \frac{m^2 v'(m)^2}{2P} - 
  \frac{d}{dm}\left[
      \frac{M^2 v'(m)}{P} - \lambda_1 + \lambda_2 \frac{m^2 v'(m) v(m)}{P} 
  \right] = 0\;.
$$
The equation has solution
$$
v(m)=\frac{1}{\lambda_2}-\frac{{[ m (m_0+m_{end})-2 m_0 m_{end}]^{2/3}} }{\lambda_2(m (m_0-m_{end}))^{2/3}}
$$
from which we can calculate
$$
\begin{align}
v_{eff}(m)&=-\frac{4 m_0 m_{end} (m (m_0+m_{end})-2 m_0 m_{end})}{3 \lambda_2 \left[m (m_0-m_{end}) (m
   (m_0+m_{end})-2 m_0 m_{end})^2\right]^{2/3}}\;,\\
t(m_{end})-t(m_0)&=\frac{8 m_0 m_{end}}{3 \lambda_2^2 (m_0- m_{end}) P}\;,\\
x(m_{end})-x(m_0)&=\frac{16 m_0 m_{end}}{9 \lambda_2^3 (m_0-m_{end}) P}\;.
\end{align}
$$
Curiously, the $\lambda_2$ has very simple relation to average velocity: $\lambda_2=2/(3\bar{v})$. Maximum velocity is reached at $m=\frac{2m_0 m_{end}}{m_0+m_{end}}$.
The discussion is a bit more complicated by the fact that the rocket does have maximal achievable $v_{eff}$ and that the rocket can turn its engines off at point of maximum velocity, which effectively extends the distance traveled and the $x$ therefore does no uniquely define the trajectory. But this is beyond the scope of variational problem I asked about.  


