On the dynamical equations of conditional probability density functions, with applications to optimal stochastic control theory