# Continuity equation for compressible fluid

A question is given as

Consider a fluid of density $\rho(x, y, z, t)$ which moves with velocity $v(x, y, z, t)$ without sources or sink. Show that $\nabla \cdot \vec J + \frac{\partial \rho }{\partial t} = 0 ;$ where $\vec J = \rho \vec v \hspace{0.5 cm}$ ( $\vec v$ being velocity of fluid and $\rho$ density).

In the solution it assumes, $- \nabla \cdot \vec J$ is the change in $\vec J$ within the volume element which should be equal to $\frac{\partial \rho}{\partial t}$ (why equal?). I don't understand this part and I doubt if this question is correct. I think the question should be $$\rho (\nabla \cdot \vec v) + \frac{\partial \rho}{\partial t} = 0$$ Is the question correct? If it's correct help me to understand the solution (if it's right) or please provide me correct answer. Thank you!!

The continuity equation without sink and sources reads

$$\frac{\partial \rho }{\partial t} + \nabla \cdot (\rho\vec v) ~=~ 0.$$

Hint on how to derive it:

1. Establish first the integral form of the continuity equation for an arbitrary (sufficiently regular) 3D spatial integration region.

2. Next use the definition of the 3D divergence to argue the differential form of the continuity equation.

The continuity equation can be rewritten with the help of a material derivative $\frac{D \rho }{D t}$ as

$$\frac{D \rho }{D t} + \rho \nabla \cdot \vec v ~=~ 0.$$

Thus for an incompressible fluid $\nabla \cdot \vec v = 0$, the density $\rho$ of a certain fluid parcel does not change as a function of time.