How is this equation justified for a prime counting function? I seem to have trouble with how LHS=RHS. Apologies if this turns out to be too elementary. I found this in the book 'The theory of zeta functions' by E.C Titchmarsh and D.R Heath-Brown
$\sum_{n=2}^{\infty}\pi(n) \int_{n}^{n+1}\frac{s}{x(x^s -1)}dx=s\int_{2}^{\infty}\frac{\pi(x)}{x(x^s -1)}dx$
Here $s$ is a complex number and $\pi(x)$ is a prime counting function.
 A: *

*$s$ is a constant in the first integral and can be pulled out. 

*$\pi(n)$ is a constant in the first integral, and can be pulled in. 


This gives 
$$
LHS = \sum_{n=2}^\infty s \int_n^{n+1} \frac{\pi(n)}{x(x^s - 1)} dx
$$
I'm assuming that for $x$ not an integer, the authors use $\pi(x)$ to denote $\pi(floor(x))$, so we can replace $\pi(n)$ in the integral from $n$ to $n+1$ with $\pi(x)$, and it'll be wrong only at $x = n+1$, which is a single point and contributes nothing to the integral. So now the LHS is
\begin{align}
LHS 
&= \sum_{n=2}^\infty s \int_n^{n+1} \frac{\pi(x)}{x(x^s - 1)} dx \\
&= s \left( \int_2^{3} \frac{\pi(x)}{x(x^s - 1)} dx 
+ \int_3^{4} \frac{\pi(x)}{x(x^s - 1)} dx 
+ \ldots
\right)
\end{align}
Now write out that sum for the first few values of $n$ as I've done above. There's an integral from $2$ to $3$; an integral from $3$ to $4$, and so on. The integrands are all the same, so you can pull them together into a single integral from $2$ to $\infty$. And you're done...
N.B.: I should be a little clearer about that last step. The left hand side denotes the sum of an infinite series; that sum is defined to be the limit of the partial sums. The partial sum of the first $k$ terms is a finite sum of adjacent integrals, and can be converted to something of the form
$$
s \left( \int_2^{3} \frac{\pi(x)}{x(x^s - 1)} dx 
+ \int_3^{4} \frac{\pi(x)}{x(x^s - 1)} dx 
+ \ldots
+ \int_{k+1}^{k+2} \frac{\pi(x)}{x(x^s - 1)} dx 
\right) \\= 
s\int_2^{k+2} \frac{\pi(x)}{x(x^s - 1)} dx 
$$
The limit of this, as $k \to \infty$, is exactly the definition of $s \int_2^\infty \ldots$. We can then conclude that these things are equal, provided that we know that either side converges. The proof of convergence requires a bit more work, and I don't think it's what was confusing you here, so I'm not going to try to address it. 
