I think I'm losing something while I'm trying to understand how to prove the conservation law for the mass.
For example, Childress states (zipping passages at page 16):
Let us suppose that mass is being added or subtracted from space as a function $q(x, t)$. The conservation of mass in a fixed region $R$ can be expressed using Reynolds trasport theorem. Moreover, since \begin{equation} \frac{d}{dt} \int_R \rho \ dV = \int_R q \ dV \hspace{2cm}(1) \end{equation} we arrive to the divergence formula $$\frac{\partial \rho}{\partial t} + \vec\nabla\cdot (\rho \vec v) = q$$
Some questions:
Usually I see conservation of mass equation in the form $\frac{\partial \rho}{\partial t} + \vec\nabla\cdot (\rho \vec v) = 0$ so what that $q$ stands for?
Why does it hold equation $(1)$?
Other notes (for example this one at page 1) sometimes simply assume that $\frac{d}{dt} m = 0$ i.e. the mass is conserving. Wasn't our aim to prove this fact?
Edit: I'll write down what we have done in our course:
Introduction of notations: Let $B_0$ be a body that after a certain amount of time $t$ takes a different shape $B_t$. Supposing the change of shape is smooth enought into time, I used to call $M_t$ the deformation map which takes $B_0 \to B_t$.
Let's call with a $\sim$ an arbitrary volume, for example $\tilde{B}_0$ defines a part of volume of $B_0$. Then the conservation of mass says that $m(\tilde{B}_0) = m(\tilde{B}_t)$ for every time $t$ and every volume $\tilde{B}_0$.
Since $$m(\tilde{B}_0) = \int_{\tilde{B}_0} \rho(t,x)dV_0$$ we will see the map $M_t$ as a change of coordinates in multiple integrals: $$ \rho(0,x(0)) dV_0 = |J|\rho(t,x(t))dV_t \qquad (2)$$ where $|J|$ is the determinant of the jacobian of the trasformation, i.e. $J = \frac{dx(t)}{dx(0)}$
Taking the material derivative on both sides of $(2)$ we get $$0 = \dot{\rho}|J| + \rho |\dot{J}|$$ and isolating the $\dot{\rho}$: $$\dot{\rho} = -\dot{(\log|J|)}\rho$$
Then, using a cartesian form we arrive to the following equation: $$\frac{\partial\rho}{\partial t} + (\vec{v}\cdot \vec{\nabla})\rho = -tr(\dot{J})\rho = -(\vec{\nabla}\cdot \vec{v})\rho$$
In conclusion, taking all to one side: $$\frac{\partial\rho}{\partial t} + \vec{\nabla}\cdot (\vec{v}\rho) = 0$$