Proving the Virial theorem 
Consider the expectation in the canonical ensemble defined by
  $$\left\langle x_i\frac{\partial \mathcal{H}}{\partial x_j} \right\rangle=\frac{1}{Z}\int d\Gamma x_i\frac{\partial \mathcal{H}}{\partial x_j}e^{-\beta\mathcal{H}},$$
  where $$d\Gamma=\prod_{i}^Nd\Gamma_i=\prod_{i}^N d^3p_id^3q_i.$$
  Integrating the numerator  over $x_j$ by parts we obtain
  $$\left\langle x_i\frac{\partial \mathcal{H}}{\partial x_j} \right\rangle=\frac{1}{Z\beta}\int \prod_{i \neq j} d\Gamma_i \left(-[x_ie^{-\beta\mathcal{H}}]_{x_j^-}^{x_j^+} +\left(\frac{\partial x_i}{\partial x_j}\right) e^{-\beta \mathcal{H}}\right). $$
  From here apparently we get 
  $$\left\langle x_i\frac{\partial \mathcal{H}}{\partial x_j} \right\rangle=\delta_{ij}k_BT.$$ 

I cannot see how this holds. So I tried to explain myself as follows. The first term must go to zero so,
$$\left\langle x_i\frac{\partial \mathcal{H}}{\partial x_j} \right\rangle=\frac{1}{Z\beta}\int \prod_{i \neq j} d\Gamma_i \left(\frac{\partial x_i}{\partial x_j} e^{-\beta \mathcal{H}}\right) $$
and so
$$\left\langle x_i\frac{\partial \mathcal{H}}{\partial x_j} \right\rangle=\delta_{ij}k_BT \frac{1}{Z}\int \prod_{i \neq j} d\Gamma_i e^{-\beta \mathcal{H}} $$
but in classical statistical mechanics we have that
$$Z=\frac{1}{h_0^{3N}N!}\int d^{3N}qd^{3N}p \exp(-\beta\mathcal{H}(\mathbf{q},\mathbf{p}))$$
so I doubt that 
$$\frac{1}{Z}\int \prod_{i \neq j} d\Gamma_i e^{-\beta \mathcal{H}}=1$$
Moreover I cannot see why we did not include $\frac{1}{h_0^{3N}N!}$ earlier as I thought that it always has to be included in classical statistical mechanics.
 A: 
Integrating the numerator  over $x_j$ by parts we obtain
$$\left\langle x_i\frac{\partial \mathcal{H}}{\partial x_j} \right\rangle=\frac{1}{Z\beta}\int \prod_{i \neq j} d\Gamma_i \left(-[x_ie^{-\beta\mathcal{H}}]_{x_j^-}^{x_j^+} +\left(\frac{\partial x_i}{\partial x_j}\right) e^{-\beta \mathcal{H}}\right). $$

In the rhs there is a double mistake. The variable $x_j$ is either $q_j$ or $p_j$. Thus there is not an integration on all coordinates but $\Gamma_j$ which should appear on the rhs. Instead, one should see integration over all coordinate but $x_j$. Moreover, integration by parts does not give a formula with an integral over all coordinates but one. It gives two terms, one without one integration, and the second which is again an integral over the whole phase space, although of a different function.
The correct formula should be written as follows:
$$\left\langle x_i\frac{\partial \mathcal{H}}{\partial x_j} \right\rangle=\frac{1}{Z\beta}\int \prod_{i,without~x_j} d\Gamma_i \left(-[x_ie^{-\beta\mathcal{H}}]_{x_j^-}^{x_j^+} \right) +
\frac{1}{Z\beta}\int \prod_{i} d\Gamma_i \left(\frac{\partial x_i}{\partial x_j} e^{-\beta \mathcal{H}}\right). $$
From which the result follows.
As far as the $\frac{1}{h_0^{3N}N!}$ factor, it is just a matter of taste to write it or not since it should appear both at the numerator and denominator of the formula for the average.
