The question is basically the title. Given an open subset $U$ of $\mathbb{R}^n$, prove that $\omega$ is an exact differential $1$-form if only if for every smooth closed curve $\gamma:[a,b]\to U $, $\gamma\in C^\infty$
$\int_{\gamma}\omega=0$
The first implication is a mere consequence of the definition of the integral for a 1-form on a curve and the fact that $\omega=df$ where $d$ is the differential operator. I don't really know how to prove the other implication and I could not find any hint neither from the book I am studying nor from the lessons provided by my university.
Any suggestions?