# Deriving the continuity equation for a perturbation from the continuity equation for the full density

I am attempting to derive the continuity equation for a density perturbation $$\delta$$, given the continuity equation for the full density $$\rho(\mathbb{x}, t)$$. This is in the context of cosmological perturbation theory, and specifically I am trying to get from equation $$9.15$$ of Peebles (1980) to the second equation of $$9.17$$ of the same. That is, I am trying to get from $$\frac{\partial \rho}{\partial t} + \frac{3\dot{a}}{a}\rho + \frac{1}{a}\nabla \cdot \rho \mathbb{v} = 0 \label{full} \tag{1}$$ to $$\frac{\partial \delta}{\partial t} + \frac{1}{a}\nabla \cdot (1 + \delta) \mathbb{v} = 0 \tag{2}$$

given that $$\rho = \bar{\rho}(t)(1+\delta)$$, where $$\bar{\rho}(t)$$ is the average density. Here, $$\mathbb{v}$$ is the peculiar velocity and we are in comoving coordinates. Simply plugging this into $$(\ref{full})$$ gives (if I have not made a mistake): $$\frac{\partial \bar{\rho}}{\partial t} + \frac{\partial \bar{\rho}}{\partial t} \delta + \frac{\partial \delta}{\partial t} \bar{\rho} + \frac{3\dot{a}}{a}\bar{\rho} + \frac{3\dot{a}}{a}\bar{\rho}\delta + \bar{\rho}\frac{1}{a}\nabla\cdot(1+\delta)\mathbb{v}=0$$ Doing a bit of factoring yields: $$\left( \frac{\partial \bar{\rho}}{\partial t} + \frac{3\dot{a}}{a}\bar{\rho} \right)(1+\delta) + \bar{\rho}\left(\frac{\partial \delta}{\partial t} + \frac{1}{a}\nabla \cdot (1 + \delta) \mathbb{v}\right) = 0 \label{final} \tag{3}$$ The last term in parentheses of $$(\ref{final})$$ is similar to what I want, but I am not sure how to eliminate the first term. I can't think of a justification of setting it to zero, nor can I ignore it on the grounds that I am only interested in the evolution of the perturbation since it is coupled to the perturbation through the $$(1+\delta)$$ factor. I have been stuck here for about a day, and any pointers in how to proceed would be greatly appreciated.

The key was to use the fact that $$\bar{\rho} \propto a^{-3}$$
as Peebles notes in $$9.2$$, and which makes intuitive sense as the mean density should decrease as the proper volume increases. Thus we can say that $$k = \bar{\rho}a^3$$ for some constant $$k$$. Now we differentiate both sides:
\begin{align} 0 &=\frac{\partial \bar{\rho}}{\partial t}a^3 + \bar{\rho}\cdot3a^2\dot{a} \\ -\bar{\rho}\cdot3a^2\dot{a} &= \frac{\partial \bar{\rho}}{\partial t}a^3 \\ -\frac{3\dot{a}}{a}\bar{\rho} &= \frac{\partial \bar{\rho}}{\partial t} \end{align} We see from the last line above that the first term in $$(3)$$ of the question will vanish, and we are left with just: $$\frac{\partial \delta}{\partial t} + \frac{1}{a}\nabla \cdot (1 + \delta) \mathbb{v} = 0$$ as desired.