Integral of the prime-counting function $\int_{0}^{+\infty} \frac{\pi(x)}{x^3-x} \, dx.$ How can this integral be calculated by elementary methods? $$\int_0^{+\infty} \frac{\pi(x)}{x^3-x} \,dx$$
 A: Here is a step by step way to approach the problem. I'll stick with just presenting the main ideas. 
The first thing to do is to check that the integral converges. First of all there is no problem at $x=0$ or $x=1$ since $\pi(x) = 0$ for $x < 2$ so we can raise the lower-limit of the integral to be $2$. From $\pi(x)\leq x$ the integrand is $\leq \frac{1}{x^2}$ and $\int_2^\infty \frac{{\rm d}x}{x^2}$ converges. 
The next thing we do is to split the integral over $[2,\infty)$ into a sum over integrals over intervals on the from $[p_n,p_{n+1})$ where $p_n$ is the $n$th prime. The reason to do this is that $\pi(x) = n$ (by definition) on these intervals so we get rid of this term at the expense of the integral now being expressed in terms of all the primes $p_n$ (which we will deal with later on). The integral becomes
$$\int_0^\infty\frac{\pi(x)}{x(x-1)(x+1)}{\rm d}x = \sum_{n=1}^\infty\int_{p_n}^{p_{n+1}}\frac{n}{x(x-1)(x+1)}{\rm d}x$$
This integral is easy to solve using a partial fraction decomposition and will give you a sum of logarithmic terms $\sum_{n=1}^\infty \log(a_n)$ where $a_n$ is some combination of $p_n$ and $p_{n+1}$. 
A sum of logarithms can be rewritten as the logarithm of a product $\log\left(\prod_{n=1}^\infty a_n\right)$. The reason to do this is that pretty much the only expressions containing all the primes that we know how to evaluate are products that are similar to the Euler product for the $\zeta$ function $\zeta(s) = \prod_{n=1}^\infty\frac{1}{1-\frac{1}{p_n^s}}$. The aim is to try to use this result.
The particular $a_n$ that you will find look something like (you will need to massage it a bit using logarithmic properties to get it on this form)
$$a_n = \left(\frac{1- \frac{1}{p_{n+1}^2}}{1 - \frac{1}{p_n^2}}\right)^{\frac{n}{2}}$$
The first term is almost telescoping, but not quite. We therefore rewrite it as
$$a_n = \frac{\left(1- \frac{1}{p_{n+1}^2}\right)^{\frac{(n+1)-1}{2}}}{\left(1 - \frac{1}{p_n^2}\right)^{\frac{n-1}{2}}}\cdot \frac{1}{\left(1- \frac{1}{p_n^2}\right)^{\frac{1}{2}}}$$
for which (in the product $\prod_{n=1}^\infty a_n$) the first factor above is now on the form $\frac{b_{n+1}}{b_n}$ and will therefore telescope: $\frac{b_2}{b_1}\cdot \frac{b_3}{b_2}\cdot \frac{b_4}{b_3}\cdots \frac{b_{N+1}}{b_N} = \frac{b_{N+1}}{b_1} \to \frac{1}{b_1}$ as $b_N \to 1$ as $N\to\infty$. The second factor can be directly related to $\sqrt{\zeta(2)}$ using the Euler product mentioned above. This will give you a simple closed form for the integral in terms of $\zeta(2) = \frac{\pi^2}{6}$. There are many details left to be filled in here, but all the ingredients you need are mentioned above.
