for this LQ extremal subproblem can be derived by solving the following Riccati equations [@bryson75] $$\begin{aligned}
& -\frac{d\vS(z)}{dz}  = (t_{i}-t_{i-1}) \vW(z), \hspace{3mm}   \vS(i^-)=\vS(i^+), \hspace{2mm} \vS(I)=\vQ_{f} \label{eq:riccati_Sm}  \\
& -\frac{d\vs(z)}{dz}  = (t_{i}-t_{i-1}) \vw(z), \hspace{5mm}   \vs(i^-)=\vs(i^+), \hspace{2mm} \vs(I)=\vq_{f} \label{eq:riccati_Sv} \\
& -\frac{ds(z)}{dz}    = (t_{i}-t_{i-1}) w(z),  \hspace{5mm}   s(i^-)=s(i^+), \hspace{2mm} s(I)=q_{f}   \label{eq:riccati_s} ,\end{aligned}$$ where $\vS(z)$ and $\vW(z)$ are in $\mathbb{R}^{^{n_x \times n_x}}$, $\vs(z)$ and $\vw(z)$ are in $\mathbb{R}^{^{n_x}}$, $s(z)$ and $w(z)$ are in $\mathbb{R}$. These matrices are defined as $$\begin{aligned}
&\vW(z) = \vQ(z) + \vA(z)\!^\top \vS(z) + \vS(z) \vA(z) - \vL(z)\!^\top \vR(z) \; \vL(z) \label{eq:riccati_Sm_o}  \\
& \vw(z)  = \vq(z) + \vA(z)^\top \vs(z) - \vL(z)^\top \vR(z) \; \vl(z) \label{eq:riccati_Sv_o}  \\
& w(z) = q(z) - 0.5\alpha (2-\alpha)\; \vl(z)^\top \vR(z) \; \vl(z)  \label{eq:riccati_s_o} \\
&\vl(z) = - \vR(z)^{-1} \big( \vr(z) + \vB(z)^\top \vs(z) \big) \label{eq:optimal_control_l}\\
&\vL(z) = - \vR(z)^{-1} \big( \vP(z)^\top + \vB(z)^\top \vS(z) \big) . \label{eq:optimal_control_L} \end{aligned}$$ The updated optimal control law, the value function, and the total cost are defined as $$\begin{aligned}
& \vu(z,\vx) = \bar{\vu}(z) + \alpha \vl(z) + \vL(z) \delta\vx \label{eq:slq_policy}\\
& V(z,\vx) = s(z) + \delta\!\vx^\top \vs(z) + \frac{1}{2}\delta\!\vx^\top \vS(z) \delta\!\vx  \label{eq:value_function} \\
& \tilde{J} = V(0,\vx_0) = s(0),\end{aligned}$$ where $z$ is defined in . $\alpha \in [0,1]$ is the 