Let $A$ be a path-connected set of $\mathbb{R}^2$ and let $w\in\Omega^1(A)$ be a differential form of degree 1 $$ \omega = a(x,y)dx+b(x,y)dy. $$ Let's assume that $\tilde \gamma$ is any piecewise $C^1$ curve made by a sequence of line segments such that in each segment, only one coordinate varies, i.e., segments are parallel to one or the other coordinate axis.
From the knowledge that $\int_{\tilde \gamma} w=0$
for every closed polygonal $\tilde \gamma$ of this kind, can we conclude that the integral over every $C^1$ curve $\gamma$ is zero and then that $w$ is exact?
Here are my thoughts. I am inclined to think that the result should hold because the local difference between the integral over a small segment of extrema $(x_1,y_1)$ and $(x_2,y_2)$ and that over the two segments of extrema $(x_1,y_1)$, $(x_2,y_1)$ and $(x_2,y_1)$, $(x_2,y_2)$ is second order in $dx=x_2-x_1$ and $dy=y_2-y_1$. Therefore, if $\tilde \gamma_{2n}$ is a polygonal line as defined above, where the extrema of every pair of $2n$ segments coincide with the curve $\gamma$, in the limit of $n\rightarrow \infty$, I would expect $$ \lim_{n \rightarrow \infty}\int_{\gamma_{2n}}w = \int_{\gamma} w. $$ Is this reasoning correct? Is there a more direct way to prove or disprove it?