The text is somewhat confusing (or at least the parts you have posted are without their surrounding context).
There are two ways of describing fluid flows:
- The more widely used Eulerian specification describes the fluid by the instantaneous velocity \mathbf{v} of the fluid element which at time t is at position \mathbf{x}. As time changes, different fluid elements will occupy this position. The independent variables are \mathbf{x} and t.
- The Lagrangian specification, used in the post in question, describes the fluid by the position \mathbf{x} at time t of the fluid element originally at position \mathbf{X}. The independent variables are \mathbf{X} and t.
The two specifications are related by <br />
\mathbf{v}(\mathbf{x}(\mathbf{X},t),t) = \left.\frac{\partial \mathbf{x}}{\partial t}\right|_{(\mathbf{X},t)}.<br />
The material derivative <br />
\frac{D}{Dt} = \frac{\partial}{\partial t}+ \mathbf{v} \cdot \nabla is relevant to the Eulerian specification, in which
partial differentiation with respect to time is at a fixed position occupied by successive different fluid elements. Finding the rate of change with respect to time experienced by a particular fluid element requires the addition of the advective \mathbf{v} \cdot \nabla term. (To be clear, the spatial derivative is with respect to \mathbf{x}.) But in the Lagrangian specification, which the text is using here, a particular fluid element is labelled by its initial position \mathbf{X}, and
partial differentiation with respect to time
holding \mathbf{X} constant does "follow the fluid" without the need for an advective term.
The complication here is that when the author writes \theta = \nabla \cdot \mathbf{v} they apparently intend differentiation not with respect to the initial position \mathbf{X} but with respect to the current position \mathbf{x}. Allowing for this and using the normal partial time derivative yields the result (at least in the 2D case, which is the only case I could be bothered to check).
Starting with
@Mark44's expression for J you can take the partial derivative with respect to time and then simplify some terms using <br />
\frac{\partial^2 x_i}{\partial X_j\,\partial t} = \frac{\partial v_i}{\partial X_j} since in the Lagrangian specificattion the velocity field is just the partial derivative of the current position with respect to time. You can then use the chain rule <br />
\frac{\partial v_i}{\partial X_j} = \sum_k \frac{\partial v_i}{\partial x_k} \frac{\partial x_k}{\partial X_j} and you will find some terms will cancel, giving a result equal to <br />
J \theta = J \sum_i \frac{\partial v_i}{\partial x_i}.