  In this paper we set up the foundations around the notions of formal
differentiation and formal integration in the context of commutative Hopf
algebroids and Lie-Rinehart algebras. Specifically, we construct a
contravariant functor from the category of commutative Hopf algebroids with a
fixed base algebra to that of Lie-Rinehart algebras over the same algebra, the
differentiation functor, which can be seen as an algebraic counterpart to the
differentiation process from Lie groupoids to Lie algebroids. The other way
around, we provide two interrelated contravariant functors form the category of
Lie-Rinehart algebras to that of commutative Hopf algebroids, the integration
functors. One of them yields a contravariant adjunction together with the
differentiation functor. Under mild conditions, essentially on the base
algebra, the other integration functor only induces an adjunction at the level
of Galois Hopf algebroids. By employing the differentiation functor, we also
analyse the geometric separability of a given morphism of Hopf algebroids.
Several examples and applications are presented along the exposition.
