## 2 Optimal Trajectory Formulation
### Final Formulation  
The necessary optimality conditions (15)-(17) state that the optimal of (4) is constituted by a set of optimal arcs that join the via-points and satisfy (15) in each interval. An explicit formula of these optimal arcs may be easily written by introducing the set \(J_{0}=[-1,1]\), the vector \(\boldsymbol{\tau}\in\mathbb{R}^{N}\) with components \(\tau_{i}=t_{i+1}-t_{i}\), and the family of linear dilations \(s_{i}:J_{i}\longrightarrow J_{0}\) defined by:  
\[s_{i}(t)=2\,\frac{t-t_{i}}{\tau_{i}}-1. \tag{18}\]  
By applying the transformation (18) to (15), we obtain that at each interval \(J_{i}\), its solution is given by the solution of:  
\[\frac{\alpha\tau_{i}^{4}}{16(1-\alpha)}\frac{\mathrm{d}^{2}\mathbf{q}}{ \mathrm{d}s^{2}}+\frac{\mathrm{d}^{6}\mathbf{q}}{\mathrm{d}s^{6}}=0 \tag{19}\]  
If follows that the optimal arcs that join the via-points and satisfy the Euler-Lagrange equations at the interior of each interval \(J_{i}\) can be written in the nominal interval \(J_{0}\) as a linear combination of the general solutions of (19). Following the traditional approach for solving ordinary linear differential equations [29], we consider a guest solution of the form:  
\[\mathbf{q}(s)=\mathbf{a}e^{\beta s}, \tag{20}\]  
where \(\mathbf{a}\) is an arbitrary column vector and \(\beta\) an unknown scalar to be found. We can confirm that the general solution of (19) is constituted by a linear combination of functions of the type (20) for which:  
\[\beta^{6}+\frac{\alpha\tau_{i}^{4}}{16(1-\alpha)}\beta^{2}=0. \tag{21}\]  
After substituting the solutions of (21) into (20) and selecting the linear combinations that have only the real part [29], we have that the general solution of (19) is:  
\[\mathbf{q}(s)=\sum_{i=0}^{5}\mathbf{a}_{i}B_{i}(s), \tag{22}\]  
where:  
\[B_{0}(\tau_{i},s) =e^{k_{i}s}\cos\left(k_{i}s\right) B_{1}(\tau_{i},s) =e^{-k_{i}s}\cos\left(k_{i}s\right)\] \[B_{2}(\tau_{i},s) =e^{-k_{i}s}\sin\left(k_{i}s\right) B_{3}(\tau_{i},s) =e^{k_{i}s}\sin\left(k_{i}s\right) \tag{23}\] \[B_{4}(\tau_{i},s) =s B_{5}(\tau_{i},s) =1,\]  
and:  
\[k_{i}=\frac{\tau_{i}\sqrt{2}}{4}\sqrt[4]{\frac{\alpha}{1-\alpha}}. \tag{24}\]Using the general expression (22), we can uniquely represent the \(i\)-th component at the interval \(J_{j}\) of any extremal of (4) using a vector \(\mathbf{y}_{i}^{j}\in\mathbb{R}^{6}\) and the length of the interval \(\tau_{j}\) as:  
\[q_{i}(t)=\left(\mathbf{y}_{i}^{j}\right)^{\top}\mathbf{B}\big{(}\tau_{j},s_{j}( t)\big{)}\text{ if }t\in J_{j}. \tag{25}\]  
and (25) represents the general formula. It is therefore possible to achieve a uniform representation of the extremals of (4) in the whole execution interval \(T\) with a vector \(\mathbf{y}=\left[\left(\mathbf{y}_{1}^{1}\right)^{\top},\ldots,\left(\mathbf{y }_{n}^{N}\right)^{\top}\right]^{\top}\) of dimension \(n_{p}=6 nN\) and the vector \(\boldsymbol{\tau}\). Using this notation, we rewrite (4) as:  
\[\frac{\alpha\tau_{i}^{4}}{16(1-\alpha)}\frac{\mathrm{d}^{2}\mathbf{q}}{ \mathrm{d}s^{2}}+\frac{\mathrm{d}^{6}\mathbf{q}}{\mathrm{d}s^{6}}=0 \tag{19}\]0  
where \(\mathbf{Q}(\boldsymbol{\tau})\) is a \(6 nN\times 6 nN\) block diagonal matrix with \(6\times 6\) blocks \(\mathbf{Q}^{\prime}(\boldsymbol{\tau})\) of the form:  
\[\frac{\alpha\tau_{i}^{4}}{16(1-\alpha)}\frac{\mathrm{d}^{2}\mathbf{q}}{ \mathrm{d}s^{2}}+\frac{\mathrm{d}^{6}\mathbf{q}}{\mathrm{d}s^{6}}=0 \tag{19}\]1  
where \(k=(j\mod 6n)+1\). However, we can prove that the representation of the extremals of (4) using the pair \((\mathbf{y},\boldsymbol{\tau})\) is redundant. In fact, Constraints (2) and (16) may be written as:  
\[\frac{\alpha\tau_{i}^{4}}{16(1-\alpha)}\frac{\mathrm{d}^{2}\mathbf{q}}{ \mathrm{d}s^{2}}+\frac{\mathrm{d}^{6}\mathbf{q}}{\mathrm{d}s^{6}}=0 \tag{19}\]2  
where \(\mathbf{b}\) is a vector containing the via-points and the boundary conditions in (2). Thanks to (28), we can describe the problem of the optimization of (4) as an optimization problem in \(N\) real variables contained in the vector \(\boldsymbol{\tau}\).