How to compute the solutions of $d\alpha = \omega$ for a given exact form $\omega$? Let $\omega \in \Omega^k(\mathbb R^n)$ be an exact form. How can I compute all the forms $\alpha \in \Omega^{k-1}(\mathbb R^n)$ such that $\omega = d\alpha$? I am mostly interested in the case $k = n$, but an answer for general $k$ would be greatly appreciated.
(Assume all forms to be smooth. I'm not interested in any merely $C^r$ nonsense.)
 A: Let $k \geq 2$, $\omega \in \Omega^k(\Bbb{R}^n)$ be an exact form, and denote $\text{prim}(\omega) := \{\beta \in \Omega^{k-1}(\Bbb{R}^n)| \, \, d\beta = \omega\}$; this is the set of primitives of the form $\omega$. As long as you can find one form $\alpha$ such that $d\alpha = \omega$, then we can show that
\begin{align}
\text{prim}(\omega) = \{\alpha + d\phi| \, \, \phi\in \Omega^{k-2}(\Bbb{R}^n)\} \tag{$*$}
\end{align}
In other words the set of primitives is precisely all the forms which differ from $\alpha$ by an exact form.
To prove this, note that in $(*)$, the inclusion $\supseteq$ is clear because $d^2 = 0$. For the inclusion $\subseteq$, suppose $\beta \in \text{prim}(\omega)$. Then, $d\beta = \omega = d \alpha$. Hence, $d(\beta-\alpha) = 0$. By Poincare's lemma (since $\Bbb{R}^n$ is star-shaped with respect to the origin) $\beta-\alpha$ is exact. Hence, $\beta = \alpha + d\phi$ for some $\phi\in \Omega^{k-2}(\Bbb{R}^n)$.
Now, of course, if $k =1$, we have to interpret this slightly differently; in this case, $d(\beta- \alpha) = 0$ (where $\beta,\alpha$ are $0$-forms, i.e real-valued functions) implies that $\beta - \alpha = \text{constant function}$

As for finding a particular primitive $\alpha$, there is an integral expression for it. This is the analogue of finding primitives in single variable calculus: given a form $f\,dx \in \Omega^1(\Bbb{R})$, we define the function $F(x) := \int_0^x f(u)\, du$, then $dF = f\, dx$ (by the fundamental theorem of calculus), though there may not be a simpler way to express the integral in terms of nice elementary functions. Every other primitive differs from $F$ by a constant.
Anyway, here's an explicit expression (taken from Spivak's Calculus on Manifolds, from the Proof of Poincare's Lemma, with modified notation), we first express the form $\omega$ as
\begin{align}
\omega &= \sum_{I}\omega_{i_1\dots i_k} \, dx^{i_1} \wedge \dots \wedge dx^{i_k},
\end{align}
where the sum on $I = (i_1, \dots, i_k)$ is being taken over all injective subsets of $\{1, \dots, n\}$, of length $k$ (for example, take them to be all increasing), and then we define the form $\alpha$ pointwise as
\begin{align}
\alpha(x) := \sum_{I}\sum_{\mu=1}^k (-1)^{\mu-1} \left(\int_0^1 t^{k-1}\omega_{i_1\dots i_k}(tx)\, dt\right)\cdot x^{i_{\mu}} \, (dx^{i_1} \wedge \dots \widehat{dx^{i_{\mu}}}\wedge \dots \wedge dx^{i_k})(x)
\end{align}
(be careful to distinguish the point $x\in \Bbb{R}^n$ from the form $dx^i$). A pretty tedious calculation, which I don't feel like doing will show that $d\alpha = \omega$ (because $d\omega = 0$).
