There is a similar Phys.SE question here, but I still didn't get the idea. The problem is:
Write down the equations for one-dimensional motion of an ideal fluid in terms of the variables $a$ and $t$, where $a$ (called a Lagrangian variable) is the $x$ coordinate of a fluid particle at some instant $t=t_0$.
$x$ is clearly a function of $a$ and $t$, and so $x=x(a,t).$ One of the equations of motion is the equation of continuity: $$\frac{\partial\rho}{\partial t}+\nabla\cdot\rho\mathbf v= 0$$
I can't derive the solution, which was supposed to be $$\rho\frac{\partial x}{\partial a}=\rho_0$$
Where $ρ_0$ is the density at a at $t_0$.
This is what I've done so far: I have that $\frac{d\rho}{dt}=0$, and (I suppose) $$d\rho=\frac{\partial\rho}{\partial t}dt+\frac{\partial\rho}{\partial a}da$$
as well as
$$dx=\frac{\partial x}{\partial t}dt+\frac{\partial x}{\partial a}da$$
Aparently the main problem for me is that I don't know how to get to $\rho_0$...