Let $M$ be a smooth manifold of dimension $n$, and let $\omega$ be a differential $p$-form on $M$. Then we have the following theorem:
$\omega$ is exact if and only if $\oint_c\omega=0$ for all $p$-cycles $c$ on $M$.
(A $p$-cycle is a closed $p$-chain.)
For lack of a better word, I'll call the second condition, about how $\omega$ behaves on $p$-cycles, "the vanishing condition." (Some people call it conservativity, but others use "conservative" to mean "exact," so I will avoid this term.)
The "only if" part of this theorem is easy: it follows directly from Stokes's theorem. The converse is much more difficult. It is my understanding that the converse is equivalent to the injectivity part of de Rham's theorem. (This is how it is presented in several books, at least, including Frankel's The Geometry of Physics.)
However, the converse is very easy in the special case $p=1$, so easy that it is included in many introductory books on differential geometry, such as O'Neill's. In this case, the vanishing condition implies "path independence": $\int_c\omega=\int_d\omega$ if $c$ and $d$ are 1-chains (i.e. curves) with the same endpoints. This allows us to make a direct integration argument: we write down a $0$-form (i.e. a function) $f$ that will be a potential for $\omega$, namely $$f(x)=\int_c\omega$$ where $c$ is any 1-chain starting at an arbitrarily chosen but fixed point in $M$ and ending at $x$. Path independence guarantees $f$ is well-defined. It is then straightforward to verify that $\omega=df$, and exactness follows.
Here's my question: is there a similar constructive argument to be given when $p>1$, and if not, is there anything interesting to say about why not (besides things get harder in higher dimensions)? The first difficulty we'll face is that when $p>1$, we're no longer after a function, but a $(p-1)$-form. Still, the argument for $p=1$ is so easy that it is surprising to learn that the general theorem is very difficult and highly non-trivial. Why should $p>1$ require such a startling jump in difficulty? When I first started thinking about this issue, I guessed that the most you'd have to do is be a little cleverer about how to do the integration in a "p-chain-independent" (instead of "path independent") way; I didn't anticipate I'd have to give up this direct approach and wade through an incredible amount of complexity.
As far as I know, the two standard approaches to de Rham's theorem are via sheaf theory (as given in Warner's or Morita's books) or a complicated induction argument on open sets (due to Bredon). I haven't read these proofs in detail, and I admit to not really understanding them, but as far as I can tell they aren't constructive: they don't write down a potential for $\omega$ like we do for $p=1$. But maybe I'm wrong about that.
Perhaps the Poincaré Lemma will be helpful here—that is certainly a place where one can find very similar constructive integration arguments, and I know it is used in the proofs of de Rham's theorem—but it is at least not directly relevant, because the theorem above says nothing about contractibility.