If we define $$f(x) = 1 + \frac{\cos\big(\pi\frac{\Gamma(x) + 1}{x}\big)}{2 - \cos(2\pi{x})}$$ how would one go about evaluating
$$ \int\_1^R \frac{1}{x} \log{f(xe^{i\alpha})} dx$$ for some parameter angle $\alpha$ and an arbitrarily large $R$? I know I'm supposed to show some progress but I really have no idea how to do this - I posted this on math.stackexchange and got no responses.


Edit: [Here](https://math.stackexchange.com/questions/1621528/integral-involving-the-gamma-function) is a link to my Stack Exchange question.


Edit: We can assume $\alpha$ to be small.



Integral involving the gamma function
I understand that the OP is after the imaginary part of the integral in the small-$\alpha$ limit. To evaluate this limit, I note that [Wilson's theorem](https://en.wikipedia.org/wiki/Wilson%27s_theorem) implies that, for real positive $x$, the function
$$f(x) = 1 + \frac{\cos\big(\pi\frac{\Gamma(x) + 1}{x}\big)}{2 - \cos(2\pi{x})}=0\;\;{\rm iff}\;x\;\text{is a prime integer},$$ 
so the imaginary part of $\log f(x+i0^+)$ is a step function of $x$, increasing by $\pi$ at each prime, as the logarithm winds through its branches:
$$\lim\_{\alpha\downarrow 0}\,{\rm Im}\,\log f(xe^{i\alpha})=\pi\times\text{number of primes smaller than}\; x.$$
The integral then evaluates in the desired limit to
$$\lim\_{\alpha\downarrow 0}\,{\rm Im}\,\int\_1^R \frac{1}{x}\log f(xe^{i\alpha})\,dx=\sum\_{{\rm primes}\, p<R}\pi\log(R/p).$$


I am surprised to conclude that this integral sums over primes, but I guess that was the context in which it appeared, am I right? [I took the liberty of adding the "prime-numbers" tag to the question.]


