Riemann was able to establish the following link between the Riemann zeta function and the weighted prime counting function $J(x)$. $$\ln(\zeta(s))=s\int_1^\infty J(x)x^{-s-1}dx$$ Using the Mellin inverse transform, he then obtained the following: $$J(x)=\frac{1}{2\pi i}\int_{c-i\infty}^{c+i\infty}\frac{\ln(\zeta(s))}{s} x^{-s}ds$$ The problem with the above equation is that it evaluates $\zeta(s)$ at complex values. However, he was able to surmount that problem by using the Zeta functional equation, which states $$\pi^{-s / 2} \Gamma \left({\frac s 2}\right) \zeta \left({s}\right) = - \frac 1 {s \left({1 - s}\right)} + \int_1^\infty \left({x^{s / 2 - 1} + x^{- \left({s + 1}\right) / 2} }\right) \omega \left({x}\right)dx$$ I understand how this formula is obtained, but cannot grasp this next step. From combining the functional equation and the result from the inverse Mellin transform, he obtains $$J(x)=Li(x)-\sum_\rho Li(x^\rho)-\ln(2)+\int_x^\infty\frac{dt}{t(t^2-1)\ln(t)}$$ How did the functional equation result in this simplification? How did Riemann simplify the complex integral? a step by step explanation from the Mellin integral to the final result above would be very helpful!
NOTE: I am not very familiar with integration over the complex plane, but very willing to learn.