My question is how to properly define integrals of some compact variables (functions) that are defined on a circle. Let me explain my puzzle with one concrete example (which comes from a physics problem, a particle moving on a circle).
Setup: Let $\alpha\in[0,2\pi]$ parametrize the unit circle, on which we have two real variables/functions $A(\alpha), B(\alpha)$ with the identification rules, $A\simeq A+2\pi$, $B \simeq B+2\pi$. Namely, $A$ and $B$ are both compact variables, or equivalently, $A,B: [0,2\pi] \rightarrow \mathbb{R}/2\pi\mathbb{Z}$.
Integral we're interested is the following one $$ \exp\left(\frac{i}{2\pi} \int_{S^1} d\alpha A(\alpha) \frac{dB(\alpha)}{d\alpha} \right) $$ In particular, we want to study the situation where $A,B$ have some non-trivial winding. There seem to be two ways to define $\int_{S^1} d\alpha$:
A naive way is to define the integral simply as an integral on the interval $[0,2\pi]$ $$ \exp\left(\frac{i}{2\pi} \int_{S^1} d\alpha A(\alpha) \frac{dB(\alpha)}{d\alpha} \right) \equiv \exp\left(\frac{i}{2\pi} \int_0^{2\pi} d\alpha A(\alpha) \frac{dB(\alpha)}{d\alpha} \right) $$ with a constraint $A(2\pi) = A(0) + 2\pi n, B(2\pi) = B(0) + 2\pi m$ to make sure they live on a circle. Such definition works well when $A(\alpha)$ is a constant. However, when $A(\alpha)$ has nonzero winding and $B(\alpha)$ is a constant, such a naive definition gives vanishing result, which is contradicting to the following one.
This reference (Eq 2.4 - 2.6) gives a different definition using patches. To be concrete, let us cover the unit circle $S^1$ with two patches $$ U_1 = (-\epsilon, \pi + \epsilon) \\ U_2 = (\pi -\epsilon, 2\pi + \epsilon) $$ In each patch, we choose a lift $A_i,B_i:U_i \rightarrow \mathbb{R}$. On the two intersections regions, the lifts are related as $$ (\pi-\epsilon,\pi+\epsilon) : A_1 = A_{2} + 2\pi n_{\pi},\quad B_1 = B_{2} + 2\pi m_{\pi} $$ $$ (2\pi-\epsilon,2\pi+\epsilon) : A_2 = A_{1} + 2\pi n_{2\pi},\quad B_2 = B_{1} + 2\pi m_{2\pi} $$ The integral is then defined to be (I drop $d\alpha$ to save some space) $$ \exp\left[\frac{i}{2\pi} \int_0^{\pi} A_1(\alpha) \frac{dB_1(\alpha)}{d\alpha} + \frac{i}{2\pi}\int_{\pi}^{2\pi} A_2(\alpha) \frac{dB_2(\alpha)}{d\alpha} - i n_{\pi} B(\pi) - i n_{2\pi} B(2\pi) \right] $$ When $A(\alpha)$ has a nonzero winding, e.g. $n$, and $B(\alpha)=B$ is a constant, the above definition yields a non-vanishing result $$ \exp\left(-i n B \right) $$
The second definition is better to me because $A,B$ are on a more symmetric footing in the sense that $A,B$ detects the winding of each other. This problem is concrete but the reference explains the definition in a more general context using differential cohomology, which is too abstract for me to understand.
I have seen that people also introduce patches and gluing conditions when discussing fiber bundles. I'm wondering whether one can help motivate the second definition using some more basic notions than differential cohomology or point out some relevant references.