I am reading this article and I am having trouble understanding a calculation there.
In it, this following equation is obtained:
$$ \frac{\partial}{\partial t} \int p_i n d \tau + \int p_i \left( \frac{\partial n}{\partial \textbf{x}} \frac{\partial \epsilon}{\partial \textbf{p}} - \frac{\partial n}{\partial \textbf{p}} \frac{\partial \epsilon}{\partial \textbf{x}}\right) d \tau = 0 .$$
where $\epsilon$ and p are the energy and momentum of the quasiparticles, and,
$$ d \tau = g \frac{d^3 p}{(2 \pi)^3} .$$
with g the degeneracy of each state.
This equation was next rewritten, by algebraic manipulation and integration by parts, in the form,
$$\frac{\partial}{\partial t} \int p_i n d \tau + \frac{\partial}{\partial \textbf{x}} \int p_i \frac{\partial \epsilon}{\partial \textbf{p}} n d \tau + \frac{\partial}{\partial x_i}\int n \epsilon d \tau - \int \epsilon \frac{\partial n }{\partial x_i} d \tau =0 .$$
My question is how was this second form obtained? I can't follow the calculation.