The trajectory of an object moving in the plane $(x,z)$ is expressed by \begin{align} \dot{x} &= 1-\frac{\psi^2}{2} + \frac{3\alpha}{4z^2} \, \psi \, , \\ \dot{z} &= \psi - \frac{3\alpha}{8z^2} \left( 1 - 3\psi^2 \right) \, , \end{align} where $\dot{f} := \mathrm{d} f/\mathrm{d} t$ denotes the derivative with respect to time and $\alpha \in \mathbb{R}$ is a fixed parameter. In addition, $\psi \in \mathbb{R}$ is a parameter representing the angle of inclination of the moving object with respect to the horizontal direction.
The goal is to obtain an optimal trajectory from point $\mathbf{r}_A = (0,1)$ to $\mathbf{r}_B = (1,1)$ using the standard Euler Largange formalism.
Using the fact that $\dot{z} = z^\prime \dot{x}$, where $z^\prime := \mathrm{d} z/\mathrm{d} x$, the Lagrangian of the system can be written as $$ \mathcal{L} := \frac{1}{\left|\dot{x}\right|} \, . $$
Then, solving the classical Euler-Lagrange equation \begin{equation} \frac{\mathrm{d}}{\mathrm{d} x} \frac{\partial \mathcal{L}}{\partial z^\prime} - \frac{\partial \mathcal{L}}{\partial z} = 0 \end{equation} (which is a second-order ODE) subject to the boundary conditions leads to the desired trajectory.
However, using this approach does now seem trivial since $\psi$ cannot easily be eliminated from the above equations for $\dot{x}$ and $\dot{z}$.
i was wondering whether there exists an approach that help to deal with such optimization problems involving a parameterization of the equations of trajectory. Any help is highly appreciated.
Thank you.