Q:

Derivation of Boltzmann equation in Kolb and Turner's The Early Universe

In the homogeneous and isotropic FRW Universe, the collisionless Boltzmann equation is given by $$ E\frac{\partial f}{ \partial t}-\frac{\dot{a}}{a}|\textbf{p}|^2\frac{\partial f}{\partial E}=0\tag{1}$$ where the phase space distribution $f$ is a function of the particle's energy $E$ and time $t$. See page 116 of The Early Universe by E. Kolb and M. Turner. The number density of the particle species at any time is given by $$n(t)=\frac{g}{(2\pi)^3}~\int d^3\textbf{p} f(E,t).\tag{2}$$ In Kolb and Turner's book, it is mentioned that by using (2) and doing an integration by parts, Eq.(1) can be reduced to $$\frac{dn}{dt}+3\frac{\dot{a}}{a}n=0.\tag{3}$$
How do we derive Eq.(3)?
My attempt
Taking derivatives of (2) w.r.t $t$ and $E$, we find, $$\frac{dn}{dt}=\frac{g}{(2\pi)^3}\int d^3\textbf{p}~\frac{\partial f}{\partial t},\tag{4}$$
$$\frac{dn}{dE}=\frac{g}{(2\pi)^3}\int d^3\textbf{p}~\frac{\partial f}{\partial E}\tag{5}.$$ Eq.(4)  trivially gives the first term of Eq.(3) upon integration by $d\Pi=\frac{g}{(2\pi)^3}\frac{d^3\textbf{p}}{2E}$. But the second term becomes $$-\frac{\dot{a}}{a}\int \frac{|\textbf{p}|^2}{2E}\frac{\partial f}{\partial E}\frac{g~d^3\textbf{p}}{(2\pi)^3}.$$
Any help?

A:

Rewrite $(1)$ as
$$\frac{\partial f}{ \partial t}-\frac{\dot{a}}{a}\frac{|\textbf{p}|^2}{E}\frac{\partial f}{\partial E}=0\tag{1}$$
Now integrate with respect to $d^3\textbf{p}$:
$$\frac{dn}{dt}-\frac{\dot{a}}{a}\frac{g}{(2\pi)^3} \int d^3\textbf{p}\frac{|\textbf{p}|^2}{E}\frac{\partial f}{\partial E}=0$$
We must express the second integral in terms of $n$. The integrand is rotationally symmetric so
$$\int d^3\textbf{p}\frac{|\textbf{p}|^2}{E}\frac{\partial f}{\partial E}=4\pi\int d\mathrm{p} \frac{p^4}{E}\frac{\partial f}{\partial E}=4\pi\int d\mathrm{p}\, p^3\frac{\partial f}{\partial p}\\
$$
where in the last equality we used the chain rule with the dispersion relation $E = \sqrt{p^2+m^2}$. Now integrating by parts:
$$4\pi\int d\mathrm{p}\, p^3\frac{\partial f}{\partial p} = -3 \times 4\pi\int d\mathrm{p}\, p^2 f = -3 \int d^3\textbf{p} f = -3n \frac{(2\pi)^3}{g}$$
Putting this back in you get $(2)$.

