The bounty for the best work out of Greg's answer, especially the "solving for $\pi^*(x;q,a)$ in terms of all $\Pi^*$ functions (tedious but possible)" part is over. Since Raymond's contributions might be very helpful to recall the necessary math, upvoting his answers is highly appreciated...
I posted my attempt of a workout here. Comments welcome...
Original question:
I have two representations of $\pi(x)$:
-
The Prime Counting Function $\pi(x)$ is given $$ \pi(x) = \operatorname{R}(x^1) - \sum_{\rho}\operatorname{R}(x^{\rho}) \tag{1} $$ with $ \operatorname{R}(z) = \sum_{n=1}^{\infty} \frac{ \mu (n)}{n} \operatorname{li}(z^{1/n})$ and $\rho$ running over all the zeros of $\zeta$ function.
-
This formula, while widely believed to be correct, has not yet been proved. $$ \pi(x) \approx \int\limits_2^x{\frac{dt}{\ln t}} - \frac{\sqrt x}{\ln x}\left( 1 + 2\sum_{\gamma} \ \ \frac{\sin(\gamma\ln x)}{\gamma}\right) \tag{2}, $$ with $\gamma=\text{Im}({\rho})$ being imaginary part of the roots of the $\zeta$ function.
Now I have two questions:
- Does the truth of $(2)$ depend on Riemann's Hypothesis or is it "just" what Wikipedia says, that The amplitude of the "noisy" part is heuristically about $\sqrt x/\ln x$?
- How to show the equivalence between $(1)$ and $(2)$? The integral logarithm is easily found in both representations, but how do the $\rho$-parts fit together? How do I get $\sin$s from $\text{li}(z^{1/n})$s? Does this invoke Gram's series: $$ \operatorname{R}(z) = \sum_{n=1}^{\infty} \frac{ \mu (n)}{n} \operatorname{li}(z^{1/n}) = 1 + \sum_{k=1}^\infty \frac{(\ln z)^k}{k! k \zeta(k+1)} ? $$ We can rewrite $\displaystyle \frac{\sin(\gamma\ln x)}{\gamma}=\frac{x^{i\gamma}-x^{-i\gamma}}{i\gamma}$ and I remember that I've seen a similar expression at Wikipedia: $$ \psi_0(x) = x - \sum_\rho \frac{x^\rho}{\rho} - \ln 2\pi - \frac12 \ln(1-x^{-2}) , $$ But could this help, if at all? ($\psi_0(x)$ is the normalization of the Chebyshev function, see here)


Let's start with the nice paper 'Prime Number Races' of Granville and Martin from your comments. It contains the sentence :
$$ \tag{1}\boxed{\displaystyle\frac{\int\limits_2^x{\frac{dt}{\ln t}}-\pi(x)}{\sqrt x/\ln x} \approx 1 + 2\sum_{\gamma} \ \ \frac{\sin(\gamma\ln x)}{\gamma}} $$
I can only conjecture that the formula referenced in their last sentence is your formula $(1)$ (I don't know a proof of convergence of this formula either) derived from Riemann's explicit formula (proved by von Mangoldt) and not the approximate formula I reproduce above equivalent to your $(2)$ . Note that they add that this approximation is valid 'when $x$ is large'.
Let's add that this approximation doesn't include the trivial zeros from your other thread.
Concerning the $\displaystyle \frac{\sin(\gamma\ln x)}{\gamma}$ term it is a good approximation of Riesel's approximation $(2.30)$ from his fine book 'Prime Numbers and Computer Methods for Factorization' : $$\tag{2}\frac{\cos(\gamma\ln x-\arg \rho)}{|\rho|},\quad\text{with}\ \ \rho=\frac 12+i\gamma$$ since $\ \gamma\gg 1 $ we have indeed $\ |\rho|\approx \gamma\ $ and $\ \arg\,\rho\approx \frac{\pi}2$
(note that $\gamma > 14.13\ $ so that $\ 1<\frac {|\rho|}{\gamma}<1.00063$)
Riesel's method is to approximate the oscillating term (see the next page from Riesel's book) : $$\tag{3}\operatorname{R}(x^{\rho}) = \sum_{n=1}^{\infty} \frac{ \mu (n)}{n}\operatorname{li}(x^{\rho/n})$$ with the first term : $$\tag{4}\operatorname{R}(x^{\rho}) \approx\left[\operatorname{li}(x^{\rho})=\operatorname{li}(e^{\rho\;\ln x})=\operatorname{Ei}(\rho\;\ln x)\right]$$ and to use the asymptotic expansion for $\operatorname{Ei}$ : $$\tag{5}\operatorname{Ei}(z)\sim \frac{e^z}{z}\left(1+\frac {1!}z+\frac{2!}{z^2}+\cdots\right)$$ to get : $$\operatorname{Ei}\left(\left(\frac 12+i\gamma\right)\;\ln x\right)\approx \frac{x^{1/2+i\gamma}}{(1/2+i\gamma)\;\ln x}$$ so that combining the two 'mirror' zeros : $$\operatorname{Ei}\left(\left(\frac 12+i\gamma\right)+\;\ln x\right)+\operatorname{Ei}\left(\left(\frac 12-i\gamma\right)+\;\ln x\right)\approx \frac{\sqrt{x}}{\ln x}\left(\frac{e^{i\gamma\ln x}}{1/2+i\gamma}+\frac{e^{-i\gamma\ln x}}{1/2-i\gamma}\right)$$ $$\approx\frac{\sqrt{x}}{\ln x}\frac{e^{i\gamma\ln x-i\arg{\rho}}+e^{-i\gamma\ln x+i\arg{\rho}}}{|\rho|}\quad\text{since}\ \ \rho=\frac 12+i\gamma$$ we get Riesel's approximation : $$\tag{6}\operatorname{R}(x^{\rho})+\operatorname{R}(x^{\overline{\rho}})\approx\frac{2\;\sqrt{x}\;\cos(\gamma\ln x-\arg{\rho})}{|\rho|\;\ln x}$$ while $\operatorname{R}(x)$ was approximated by (using $(3), (4), (5)$) : $$\tag{7}\operatorname{R}(x)\approx \operatorname{li}(x)-\frac 12\operatorname{li}\bigl(x^{1/2}\bigr)\quad \text{with}\ \operatorname{li}\bigl(x^{1/2}\bigr)\approx \frac{2\sqrt{x}}{\ln x}$$ this allows too to get better approximations if wished ($\operatorname{R}(x)\approx \operatorname{li}(x)-\frac 12\operatorname{li}\bigl(x^{1/2}\bigr)-\frac 13\operatorname{li}\bigl(x^{1/3}\bigr) $ for example, adding the trivial zeros contribution and so on...)
Now to answer your questions :
Hoping this clarified things,