  In optimal control problems of control-affine systems, whose solutions are
bang-bang or singular type, verification of optimality using the
Hamilton-Jacobi-Bellman (HJB) equation involves the computation of partial
derivatives of switching times and switching states with respect to initial
conditions (time and state). In this paper, we establish a formula for the
partial derivatives of ordinary differential equations (ODE) flows with respect
to initial conditions, which is more suitable for using in HJB equation than
such provided by the classical theory of ODE. We apply the obtained results to
the sensitivity analysis of hitting time and state of a reachable set, that in
an optimal control problem can represent a switching locus.
