Let $\omega$ be a differential form. Stokes' theorem states that for any manifold $\Omega$:
$$ \int_{\partial \Omega}\omega = \int_\Omega d\omega$$
where $d$ is the exterior derivative.
I would like to use Stokes' theorem to prove that a given differential $1$-form $\varphi$ is exact whenever its integral over a closed curve is zero.
My idea is to let $\Omega$ be a closed curve. Then $\partial \Omega = \varnothing$ and therefore $\int_{\partial \Omega}\omega =0$. By Stokes' theorem then $ \int_\Omega d\omega=0$.
The problem I have now is that this shows that the integral over a closed curve of $d \omega$ is zero but this doesn't seem to help. Hence:
How can I use Stokes' theorem to find a differential $0$-form $\psi$ with $d \psi = \varphi$?
I do not know if this fact can be proved by Stokes theorem, anyway I will give a proof here.
The following trick is common in complex analysis/ differential geometry: Given a one form $\omega$ so that the integral over any smooth closed loop is zero. By approximation, we can assume that the same is also true for piecewise smooth closed loops.
Let's assume $\Omega$ is connected (if not just restrict everything to each connected components). Let $x_0$ be arbitrary and define $f: \Omega \to \mathbb R$, where
$$ f(x) = \int_\gamma \omega , $$
where $\gamma$ is any piece-wise smooth curve joining $x_0$ and $x$. The definition is independent of $\gamma$ chosen, because of the condition on $\omega$.
Now we want to show $df = \omega$. Let $x\in \Omega$ and $\gamma_0$ be a curve connecting $x_0$ and $x$. Then for all $y$ close to $x$, we have
$$f(y) = f(x) + \int_{\gamma_y} \omega,$$
where $\gamma_y$ is any curve joining $x$ and $y$.
Now assume we are in a local coordinate $y = (y^1, \cdots y^n)$ so that $x$ is identified to the origin. Write in this coordinate
$$\omega = w_1(y) dy^1 + \cdots + w_n(y) dy^n .$$
Now we show $\frac{\partial f}{\partial y^i }(0) = w_i(0)$ for $i=1, \cdots, n$.
$$\frac{\partial f}{\partial y^i} (0) = \frac{d}{dt}\bigg|_{t=0} \frac{f(te_i) - f(0)}{t}$$
To calculate $f(te_i)$, we $\gamma (s) = s(te_i)$.
$$f(te_i) = \int_0^1 \langle \gamma'(s) , \omega (\gamma(s)) \rangle ds = t\int_0^1 \omega_i (ste_i) ds = t \omega_i (s_t te_i),$$
where $s_t \in [0,1]$ by mean value theorem. Thus
$$\frac{\partial f}{\partial y^i} (0) = \lim_{t\to 0} \omega_i (s_t te_i) = w_i(0).$$
Thus $df = \omega$ at $x$. As $x\in \Omega$ is arbitrary, we have $df = \omega$ on $\Omega$.