Let $e(\beta) = e^{2 \pi i \beta}$. I am reading an article, where the author defines the following sum $$ S(N) = \sum_{0 \leq x \leq N, x \equiv g (mod \ q)} \Lambda(x) e(f(x) \alpha), $$ where $f$ is a polynomial in one variable over $\mathbb{Z}$, $\alpha$ is a real number and $\Lambda$ is a von-Mangdoldt function.
Then the author says that $$ S(N) = \int_0^N e(f(z) \alpha) \ d \Psi(z), $$ where $$ \Psi(v) = \sum_{t \leq v, t \equiv g (mod \ q)} \Lambda(t). $$ I know the definition of Riemann-Stieltjes integral, but I am having trouble showing this. I would appreciate any assistance. Thank you very much!
Recall that for generic Riemann-Stieltjes integration, when you have something like $$ \int_0^N f(t) dg(t),$$ you are summing together partial sums of the form $$ \sum f(\xi_i) [g(x_{i+1}) - g(x_{i})]$$ behind the scenes, as it were. In other words, we are multiplying values of $f$ by changes in $g$ locally.
Let us consider a simplified integral, $$ \int_0^N f(t) d \lfloor t \rfloor.$$ The say to think about when $g = \lfloor \cdot \rfloor$ changes here. At each integer, $\lfloor t \rfloor$ changes by $1$. So at $1$, the integral contributes $f(1) \cdot (\lfloor 1 \rfloor - \lfloor 1 - \epsilon \rfloor) = f(1)$. Similarly, newt $2$ the integral contributes $f(2)$. So $$ \int_0^N f(t) d\lfloor t \rfloor = \sum_{n = 1}^N f(n).$$
In this question, your $g$ changes value at integers $t \equiv g \pmod q$, at which point it grows by $\Lambda(t)$. This is why the integral is equal to that sum.