Consider a system of the form
\begin{aligned}
\dot{x} = g_1(x)u^1 + g_2(x)u^2 \,,
\end{aligned}
with \dim(x)=3 and the OCP eq:opt_problem, with the cost functional eq:cost_functional and the associated terminal and running costs eq:terminal_cost and eq:running_cost. An optimal solution candidate is given by
\begin{aligned}
u^1 =
\begin{cases}
\operatorname{sgn}(u^1_{\text{sing}})\,u^1_{\max}, & |u^1_{\text{sing}}| \geq u^1_{\max},\\
u^1_{\text{sing}}, & \text{otherwise}
\end{cases}
\end{aligned}
\begin{aligned}
u^2 =
\begin{cases}
\operatorname{sgn}(\dot{\xi}_2)\,u^2_{\max}, & \dot{\xi}_2 \neq 0\,,\\
\operatorname{sgn}(u^2_{\text{sing}})\,u^2_{\max} &|u^2_{\text{sing}}| \geq u^2_{\max}\,\text{and}\, \dot{\xi}_2 = 0\\
u^2_{\text{sing}}, & \text{otherwise,}
\end{cases}
\end{aligned}
with
\scalebox{0.92}{\mbox{\ensuremath{\displaystyle \begin{aligned}
u^1_{\text{sing}} &= \frac{\Big[\dot{y}_d^iM_{ij} + e^i\bar{Q}_{ij}\Big]\mathrm{L}_{g_1}\varphi^j}{A_{11}} \quad
u^2_{\text{sing}} = \frac{A_{11}b_2-A_{21}b_1}{(A_{12}A_{21}-A_{11}A_{22})u^1}
\end{aligned}}}}
where
\scalebox{0.92}{\mbox{\ensuremath{\displaystyle \begin{aligned}
A_{11} &= \mathrm{L}_{g_1}\varphi^iM_{ij}\mathrm{L}_{g_1}\varphi^j \qquad \qquad
A_{12} = \mathrm{L}_{[g_1,g_2]}\varphi^iM_{ij}\mathrm{L}_{g_1}\varphi^j \\
A_{21} &= \mathrm{L}_{g_1}\varphi^iM_{ij}\mathrm{L}_{[g_1,g_2]}\varphi^j \qquad \,\,
A_{22} = \mathrm{L}_{[g_1,g_2]}\varphi^iM_{ij}\mathrm{L}_{[g_1,g_2]}\varphi^j \\
b_1 &= ((\ddot{y}_d^i - \mathrm{L}_{g_1}^2\varphi^i(u^1)^2)M_{ij} - e^iQ_{ij})\mathrm{L}_{g_1}\varphi^j\\
b_2 &= ((\ddot{y}_d^i - \mathrm{L}_{g_1}^2\varphi^i(u^1)^2)M_{ij} - e^iQ_{ij})\mathrm{L}_{[g_1,g_2]}\varphi^j\,
\end{aligned}}}}
and Q_{ij} = \bar{Q}_{il}M^{lm}\bar{Q}_{mj} providing u^1 \neq 0, and eq:system_th is x-flat.