of simplification.

The partial derivative of the value function in and the partial derivative of the total cost with respect to the switching time $t_j$ can be derived as $$\begin{aligned}
\partial_{t_j}V(z,\vx) =& \partial_{t_j}s(z) + \delta\!\vx^\top \partial_{t_j}\vs(z) + \frac{1}{2}\delta\!\vx^\top \partial_{t_j}\vS(z) \delta\!\vx  - \partial_{t_j}\bar{\vx}^\top \vs(z) \notag \\
& - \frac{1}{2} \partial_{t_j}\bar{\vx}^\top \vS(z) \delta\!\vx - \frac{1}{2} \delta\!\vx^\top \vS(z) \partial_{t_j}\bar{\vx}   \\
\partial_{t_j}\tilde{J} =& \partial_{t_j}s(0),\end{aligned}$$ where $z$ is defined by , $\partial_{t_j}$ is the partial derivative operator with respect to switching time $t_j$. Then $\partial_{t_j}\bar{\vx}$ and $\partial_{t_j}\bar{\vu}$ are respectively the state and input sensitivity to switching time $t_j$ which are calculated by the following differential equation $$\begin{aligned}
\frac{d (\partial_{t_j}\bar{\vx})}{dz} =& ( \delta_{i,j} - \delta_{i-1,j} ) \vf_i(\bar{\vx}(z),\bar{\vu}(z)) \notag \\
& + (t_{i}-t_{i-1}) \left( \vA_i(z) \partial_{t_j}\bar{\vx} + \vB_i(z) \partial_{t_j}\bar{\vu} \right)  \label{eq:state_sensitivity} \\
\partial_{t_j}\bar{\vu}(z,\partial_{t_j}\bar{\vx}) &= -\vL(z) \partial_{t_j}\bar{\vx} + \partial_{t_j}\vL(z) \delta\bar{\vx} + \partial_{t_j}\vl(z) ,
\label{eq:input_sensitivity}\end{aligned}$$ with the initial condition $\partial_{t_j}\bar{\vx}(0) = \mathbf{0}$ and the transversality condition $\partial_{t_j}\bar{\vx}(i^-) = \partial_{t_j}\bar{\vx}(i^+)$. $\delta_{i,j}$ is the Kronecker delta which is one if the variables are equal, and zero otherwise. Furthermore, $\partial_{t_j}\vS(z)$, $\partial_{t_j}\vs(z)$, and $\partial_{t_j}s(z)$ can be calculated from the following set of linear differential equations $$\begin{aligned}
-\frac{d (\partial_{t_j}\vS(z))}{dz}  &= ( \delta_{i,j} - \delta_{i-1,j} ) \vW(z) + (t_{i}-t_{i-1}) \partial_{t_j}\!\vW(z)  \label{eq:riccati_nablaSm}  \\
-\frac{d (\partial_{t_j}\vs(z))}{dz}  &= 