  For every nonholonomic manifold, i.e., manifold with nonintegrable
distribution, the analog of the Riemann tensor is introduced. It is calculated
here for the contact and Engel structures: for the contact structure it
vanishes (another proof of Darboux's canonical form); for the Engel
distribution the target space of the tensor is of dimension 2. In particular,
the Lie algebra preserving the Engel distribution is described.
  The tensors introduced are interpreted as modifications of the Spencer
cohomology and, as such, provide with a new way to solve partial differential
equations. Goldschmidt's criteria for formal integrability (vanishing of
certain Spencer cohomology) are only applicable to ``one half'' of all
differential equations, the ones whose symmetries are induced by point
transformations. Lie's theorem says that the ``other half'' consists of
differential equations whose symmetries are induced by contact transformations.
Therefore, we can now extend Goldschmidt's criteria for formal integrability to
all differential equations.
