  We study the variation of a smooth volume form along extremals of a
variational problem with nonholonomic constraints and an action-like
Lagrangian. We introduce a new invariant describing the interaction of the
volume with the dynamics and we study its basic properties. We then show how
this invariant, together with curvature-like invariants of the dynamics, appear
in the expansion of the volume at regular points of the exponential map. This
generalizes the well-known expansion of the Riemannian volume in terms of Ricci
curvature to a wide class of geometric structures, including all sub-Riemannian
manifolds.
