= Solution
An <orientation> of a smooth $n$-dimensional manifold can be specified by a nowhere-vanishing smooth $n$-form $\omega$: an ordered tangent basis is positive precisely when $\omega$ evaluates positively on it. Multiplication by a positive <smooth function> preserves the <orientation>. This is the differential-form formulation of the <equivalent formulations of orientability of a smooth manifold>.
Use the standard convention that the <compact> connected manifold is nonempty and has no boundary. Choose a positive <volume form> $\omega$ for its <orientation>. It is a <closed differential form>, because there are no nonzero $(n+1)$-forms. For $n>0$, compactness makes its integral finite, and positivity on a coordinate neighborhood together with nonnegativity elsewhere gives
$$
\int_M\omega>0.
$$
If $\omega=d\eta$, the <Generalized Stokes theorem> would give $\int_M\omega=\int_{\partial M}\eta=0$, a contradiction. Therefore
$$
\boxed{[\omega]\ne0\text{ in }H^n_{\mathrm{dR}}(M).}
$$
For $n=0$, a nonempty connected manifold is a point, and $H^0_{\mathrm{dR}}(M)=\mathbb R$ directly. The boundary hypothesis matters: a closed interval is an oriented <compact> connected <manifold with boundary> with $H^1_{\mathrm{dR}}=0$. Thus the result is about ordinary boundaryless manifolds, not an unrestricted version including boundary.
Back to article page