[proofplan]
The map $\int_M$ is well-defined on cohomology by [Stokes' Theorem](/theorems/1530), which forces $\int_M d\beta = 0$ for any $(n-1)$-form $\beta$ on a compact manifold without boundary. Surjectivity is clean: any volume form produces a non-zero image. For injectivity, we prove a "local" lemma — a compactly supported function $f$ on $\mathbb{R}^n$ with total integral zero can be written as a divergence $\sum_i \partial_{x_i} u_i$ — and globalise it across connected chain of charts. The connectivity of $M$ guarantees the chain of charts exists, and orientation-preservation guarantees the local exactness glues into a global exactness. The upshot is that two top forms with the same integral differ by an exact form, which gives injectivity and thus the isomorphism.
[/proofplan]
[step:Verify $\int_M$ descends to a well-defined map on $H^n_{dR}(M)$]
Every $n$-form on the compact manifold $M$ has compact support (namely all of $M$), so $\Omega^n_c(M) = \Omega^n(M)$ and $\int_M$ is defined on all of $\Omega^n(M)$ by [Integration of Differential Forms](/theorems/1529). We show $\int_M$ annihilates exact forms. Let $\beta \in \Omega^{n-1}(M)$, hence $\beta \in \Omega^{n-1}_c(M)$ by compactness. Since $M$ is compact without boundary, $\partial M = \varnothing$. By [Stokes' Theorem](/theorems/1530),
\begin{align*}
\int_M d\beta = \int_{\partial M} \beta = \int_\varnothing \beta = 0.
\end{align*}
Thus the induced map
\begin{align*}
\int_M : H^n_{dR}(M) &\to \mathbb{R} \\
[\omega] &\mapsto \int_M \omega
\end{align*}
is well-defined and $\mathbb{R}$-linear (linearity descends from linearity on $\Omega^n(M)$).
[/step]
[step:Prove surjectivity using a choice-of-orientation volume form]
By orientability, $M$ admits a nowhere-vanishing top form $\omega_0 \in \Omega^n(M)$ compatible with the chosen orientation (by [Orientability via Transition Maps](/theorems/1527)). In local coordinates, $\omega_0$ is represented by a positive multiple of $dx_1 \wedge \cdots \wedge dx_n$, so
\begin{align*}
c_0 := \int_M \omega_0 > 0.
\end{align*}
(The integrand is positive in every chart of the oriented atlas, and the definition of $\int_M$ uses a partition of unity with non-negative weights summing to one, so the total is strictly positive.) For any $r \in \mathbb{R}$, the form $\frac{r}{c_0} \omega_0 \in \Omega^n(M)$ has $\int_M \frac{r}{c_0} \omega_0 = r$. Therefore $\int_M : H^n_{dR}(M) \to \mathbb{R}$ is surjective.
[/step]
[step:Prove a local divergence lemma on $\mathbb{R}^n$]
[claim:Divergence lemma on the open cube]
Let $f \in C_c^\infty(Q)$ where $Q = (-1, 1)^n$, with $\int_{\mathbb{R}^n} f \, d\mathcal{L}^n = 0$. Then there exist $u_1, \dots, u_n \in C_c^\infty(Q)$ such that
\begin{align*}
f = \sum_{i=1}^n \frac{\partial u_i}{\partial x_i}.
\end{align*}
[/claim]
[proof]
We induct on $n$.
Base case $n = 1$. Given $f \in C_c^\infty(-1, 1)$ with $\int_{-1}^{1} f \, d\mathcal{L}^1 = 0$, define
\begin{align*}
u_1 : \mathbb{R} &\to \mathbb{R} \\
x &\mapsto \int_{-\infty}^x f(t) \, d\mathcal{L}^1(t).
\end{align*}
By the fundamental theorem of calculus, $u_1'(x) = f(x)$ for all $x$. Compact support: for $x \le -1$, $u_1(x) = 0$ (integrand vanishes); for $x \ge 1$, $u_1(x) = \int_{-1}^{1} f \, d\mathcal{L}^1 = 0$. Thus $\operatorname{supp}(u_1) \subset [-1, 1]$, and since $u_1$ is smooth and vanishes in neighbourhoods of $\pm 1$, actually $u_1 \in C_c^\infty(-1, 1)$.
Inductive step. Fix $n \ge 2$ and assume the claim for dimension $n-1$. Pick $\chi \in C_c^\infty(-1, 1)$ with $\int_{-1}^{1} \chi \, d\mathcal{L}^1 = 1$ (a bump function, normalised). Define
\begin{align*}
g : \mathbb{R}^{n-1} &\to \mathbb{R} \\
(x_2, \dots, x_n) &\mapsto \int_{-1}^{1} f(t, x_2, \dots, x_n) \, d\mathcal{L}^1(t),
\end{align*}
a smooth function (differentiation under the integral is justified by compact support of $f$), compactly supported in $(-1, 1)^{n-1}$. Total integral:
\begin{align*}
\int_{\mathbb{R}^{n-1}} g \, d\mathcal{L}^{n-1} = \int_{\mathbb{R}^n} f \, d\mathcal{L}^n = 0,
\end{align*}
by Fubini. By the inductive hypothesis applied to $g$ on $(-1, 1)^{n-1}$, there exist $v_2, \dots, v_n \in C_c^\infty((-1, 1)^{n-1})$ with $g = \sum_{i=2}^n \partial_{x_i} v_i$. Now define
\begin{align*}
u_i(x_1, \dots, x_n) &:= \chi(x_1) \, v_i(x_2, \dots, x_n), \quad i = 2, \dots, n.
\end{align*}
Each $u_i \in C_c^\infty(Q)$. Their total divergence contribution is
\begin{align*}
\sum_{i=2}^n \frac{\partial u_i}{\partial x_i}(x_1, \dots, x_n) = \chi(x_1) \sum_{i=2}^n \frac{\partial v_i}{\partial x_i}(x_2, \dots, x_n) = \chi(x_1) g(x_2, \dots, x_n).
\end{align*}
The residual
\begin{align*}
h(x_1, \dots, x_n) := f(x_1, \dots, x_n) - \chi(x_1) g(x_2, \dots, x_n)
\end{align*}
is in $C_c^\infty(Q)$ with the "slice-zero" property
\begin{align*}
\int_{-1}^{1} h(t, x_2, \dots, x_n) \, d\mathcal{L}^1(t) &= \int_{-1}^{1} f(t, x_2, \dots, x_n) \, d\mathcal{L}^1(t) - \left( \int_{-1}^{1} \chi(t) \, d\mathcal{L}^1(t) \right) g(x_2, \dots, x_n) \\
&= g(x_2, \dots, x_n) - 1 \cdot g(x_2, \dots, x_n) = 0,
\end{align*}
for every $(x_2, \dots, x_n)$. Therefore the function
\begin{align*}
u_1(x_1, \dots, x_n) &:= \int_{-\infty}^{x_1} h(t, x_2, \dots, x_n) \, d\mathcal{L}^1(t)
\end{align*}
satisfies $\partial_{x_1} u_1 = h$ and, by the slice-zero identity, $u_1(x_1, x_2, \dots, x_n) = 0$ for $x_1 \ge 1$ (same argument as the base case applied slicewise). Compact support of $u_1$ in $Q$ follows. Summing,
\begin{align*}
\sum_{i=1}^n \frac{\partial u_i}{\partial x_i} = h + \chi(x_1) g = f.
\end{align*}
[/proof]
[guided]
The lemma is the crucial local "cohomology-killer" for top forms: on a contractible chart of $\mathbb{R}^n$, a top form with total integral zero is exact, and the primitive can be chosen compactly supported. The inductive normalisation is the core trick: splitting $f$ into a "tensor product" piece $\chi(x_1) g(x_2, \dots, x_n)$ (which captures the $x_1$-average of $f$) and a residual piece $h$ whose slice integrals all vanish. The tensor piece is handled by the $(n-1)$-dimensional lemma, and the residual piece has such strong cancellation that its naive $x_1$-antiderivative lands back at zero for large $x_1$ — giving the compact support needed to stay within $Q$. This separation is what lets the induction close.
[/guided]
[/step]
[step:Globalise: show compactly supported top forms with zero integral are exact]
[claim:Global zero-integral exactness]
Let $\omega \in \Omega^n(M)$ with $\int_M \omega = 0$. Then $\omega$ is exact.
[/claim]
[proof]
By the partition-of-unity definition of $\int_M$ and linearity, it suffices to show that any $\eta \in \Omega^n(M)$ supported in a single coordinate chart $U \cong \mathbb{R}^n$ with $\int_M \eta = 0$ is exact. A general $\omega$ can then be reduced to a sum of such $\eta$'s by partition of unity, and the zero-integral condition can be propagated across charts using connectedness.
Concretely, choose an oriented atlas $\{(U_k, \varphi_k)\}_{k=0}^N$ of $M$ with each $\varphi_k(U_k) = (-1, 1)^n$ and each consecutive pair $U_{k-1} \cap U_k \ne \varnothing$ (existence of such a finite chain follows from connectedness and compactness of $M$: the connected finite-cover graph is connected, and we pick any spanning path). Fix a reference form $\omega_0 \in \Omega^n(M)$ with $\operatorname{supp}(\omega_0) \subset U_0$ and $\int_M \omega_0 = 1$, obtained by pulling back a normalised bump top form on $(-1, 1)^n$.
Now let $\omega \in \Omega^n(M)$ with $\int_M \omega = 0$. By partition-of-unity, write $\omega = \sum_k \rho_k \omega$ with $\operatorname{supp}(\rho_k \omega) \subset U_k$. Since $\int_M \omega = 0$, choosing constants $c_k := \int_M \rho_k \omega$, we have $\sum_k c_k = 0$.
For each $k$, we show $\rho_k \omega - c_k \omega_0$ is exact. This decomposes into two moves:
Move 1: Reduce to the same chart. For each $k$, form the "telescoping" combinations
\begin{align*}
\tau_k := \rho_k \omega - c_k \omega_k,
\end{align*}
where $\omega_k$ is a fixed top form supported in $U_k$ with $\int_M \omega_k = 1$ (constructed via pullback of a bump on $(-1, 1)^n$). Then $\tau_k \in \Omega^n(M)$ is supported in $U_k$ and $\int_M \tau_k = c_k - c_k \cdot 1 = 0$. In the chart $\varphi_k$, $(\varphi_k^{-1})^*\tau_k = f_k \, dy_1 \wedge \cdots \wedge dy_n$ with $f_k \in C_c^\infty((-1,1)^n)$ and $\int_{\mathbb{R}^n} f_k \, d\mathcal{L}^n = 0$. By the divergence lemma of Step 3, there exist $u_{k,i} \in C_c^\infty((-1,1)^n)$ with $f_k = \sum_i \partial_{y_i} u_{k,i}$. Setting
\begin{align*}
\beta_k := \sum_{i=1}^n (-1)^{i-1} u_{k,i} \, dy_1 \wedge \cdots \wedge \widehat{dy_i} \wedge \cdots \wedge dy_n \in \Omega^{n-1}_c((-1,1)^n),
\end{align*}
a direct computation (as in the proof of [Stokes' Theorem](/theorems/1530), Step 2) gives $d\beta_k = f_k \, dy_1 \wedge \cdots \wedge dy_n = (\varphi_k^{-1})^*\tau_k$. Pulling back by $\varphi_k$ and extending by zero, $\tau_k = d(\varphi_k^*\beta_k)$, hence $\tau_k$ is exact on $M$.
Move 2: Chain the $\omega_k$ back to $\omega_0$. For consecutive $k, k+1$ with $U_k \cap U_{k+1} \ne \varnothing$, pick a top form $\sigma_k \in \Omega^n(M)$ supported in $U_k \cap U_{k+1}$ with $\int_M \sigma_k = 1$. Then $\omega_k - \sigma_k$ is supported in $U_k$, $\omega_{k+1} - \sigma_k$ is supported in $U_{k+1}$, both have integral $1 - 1 = 0$. By Move 1 applied to each, $\omega_k - \sigma_k$ and $\omega_{k+1} - \sigma_k$ are both exact. Subtracting, $\omega_k - \omega_{k+1}$ is exact. Chaining,
\begin{align*}
\omega_k - \omega_0 = (\omega_k - \omega_{k-1}) + \cdots + (\omega_1 - \omega_0)
\end{align*}
is a sum of exact forms, hence exact.
Combining: $\rho_k \omega = \tau_k + c_k \omega_k = \tau_k + c_k \omega_0 + c_k(\omega_k - \omega_0)$, where the first and third terms are exact. Summing over $k$,
\begin{align*}
\omega = \sum_k \rho_k \omega = \underbrace{\sum_k \tau_k + c_k(\omega_k - \omega_0)}_{\text{exact}} + \Big( \sum_k c_k \Big) \omega_0 = \text{exact} + 0 \cdot \omega_0 = \text{exact},
\end{align*}
using $\sum_k c_k = 0$. Thus $\omega$ is exact, completing the claim.
[/proof]
[/step]
[step:Conclude injectivity and the isomorphism]
Suppose $[\omega] \in H^n_{dR}(M)$ satisfies $\int_M \omega = 0$. By the claim in Step 4, $\omega$ is exact, so $[\omega] = 0$ in $H^n_{dR}(M)$. Thus $\int_M : H^n_{dR}(M) \to \mathbb{R}$ has trivial kernel, i.e., is injective. Combined with surjectivity from Step 2 and well-definedness from Step 1, it follows that
\begin{align*}
\int_M : H^n_{dR}(M) \xrightarrow{\;\sim\;} \mathbb{R}
\end{align*}
is an $\mathbb{R}$-linear isomorphism.
[/step]