The Gauss Theorem and the Equations of Compatibility