Infinitesimal methods in control theory: Deterministic and stochastic