To drive Riemann explicit formula for counting of primes $$J(x)=li(x)-\sum_{ρ}li(x^ρ )-log(2)+\int_x^∞\frac{dt}{t(t^2-1) log(t) }\qquad (1)$$
One can start from Von Mangoldt formula $$ψ(x)=x -\sum_{ρ}\frac{x^ρ}{ρ}-\frac{1}{2}log(1-\frac{1}{x^2})-log(2π) \qquad (2) $$ knowing that $dψ=log(x) dJ$ we can find J'(x) as
$$J'(x) =\frac{dJ(x)}{dx}=\frac{1}{log(x)}\frac{dψ}{dx}$$ $$J'(x)=\frac{1}{log(x)}-\frac{1}{log(x)}\sum_{ρ}x^{ρ-1}-\frac{1}{x(x^2-1) log(x) }$$ And now integrating from 0 to x we get $$J(x)=\int_0^x\frac{dt}{log(t)}-\sum_{ρ}\int_0^x\frac{t^{ρ-1}}{log(t)}dt-\int_0^x\frac{dt}{t(t^2-1) log(t) }$$ which yields $$J(x)=li(x)-\sum_{ρ}li(x^ρ )-\int_0^x\frac{dt}{t(t^2-1) log(t) }\qquad (3)$$ And now comparing eq (3) to eq (1) we see that the first two terms match fine but not the third one! What did go wrong in the derivation?
According to the definitions, $J(x)$ and $\psi(x)$ satisfies the following identies: $$ J(x)=\sum_{p^k\le x}\frac1k=\sum_{p^k\le x}{\log p\over\log p^k} =\sum_{1.5<n\le x}{\Lambda(n)\over\log n} \\ \psi(x)=\sum_{p^k\le x}\log p=\sum_{n\le x}\Lambda(n) $$
where $\Lambda(n)=[n=p^k]\log p$ is von Mangolt function. Now, using Abel's summation formula, we have $$ \begin{aligned} J(x) &=\left.\psi(t)\over\log t\right|_{1.5}^x-\int_{1.5}^x\psi(t)\mathrm d\left(1\over\log t\right) \\ &={\psi(x)\over\log x}-{\psi(1.5)\over\log(1.5)}+\int_{1.5}^x{\psi(t)\over t\log^2t} \end{aligned} $$ Since $\psi(x)\equiv0$ for all $x<2$, we can simplify this into $$ J(x)={\psi(x)\over\log x}+\int_2^x{\psi(x)\over t\log^2t}\mathrm dt $$ Now, plugging the explicit formula for $\psi(x)$ sh