Given a density function $p(t, \boldsymbol{x})$, where $t$ is time and the vector $\boldsymbol{x}$ represents a point in $n$ dimensional space, a hyperbolic PDE describing the time evolution of the density function may be written as

$$\partial_{t} p = \text{(source - sink)} - \nabla_{\boldsymbol{x}} \cdot [p \boldsymbol{v}],$$

where $\partial_{t} p \equiv \partial p / \partial t$ is the partial derivative of the density function with respect to time $t$, $\nabla_{\boldsymbol{x}} \equiv \partial / \partial \boldsymbol{x}^{\text{T}} \equiv (\partial_{x_{1}},...,\partial_{x_{n}}) $ is the gradient operator, and $\boldsymbol{v} \equiv d\boldsymbol{x} / dt$ is the velocity vector field. There are several ways to derive this PDE, but the one I'm most familiar with proceeds via the divergence theorem.

I'm interested in how this equation is related to the total derivative of $p(t, \boldsymbol{x})$ with respect to time $t$. This is given by

$$\frac{dp}{dt} = \frac{\partial p}{\partial t} \frac{dt}{dt} + \frac{\partial p}{\partial \boldsymbol{x}^{\text{T}}} \cdot \frac{d \boldsymbol{x}}{dt}.$$

After simplifying, and rearranging, we obtain

$$\frac{\partial p}{\partial t} = \frac{dp}{dt} - \frac{\partial p}{\partial \boldsymbol{x}^{\text{T}}} \cdot \frac{d \boldsymbol{x}}{dt}.$$

By the product rule, however, we can re-write the second term on the RHS as

$$\frac{\partial p}{\partial \boldsymbol{x}^{\text{T}}} \cdot \frac{d \boldsymbol{x}}{dt} = \frac{\partial}{\partial \boldsymbol{x}^{\text{T}}} \cdot \left(p \frac{d \boldsymbol{x}}{dt}\right) - p \frac{\partial}{\partial \boldsymbol{x}^{\text{T}}} \cdot \frac{d \boldsymbol{x}}{dt}$$

Substituting back in and switching notation using the definition of the gradient and velocity vector field above, we have

$$\partial_{t} p = \frac{dp}{dt} + p \nabla_{\boldsymbol{x}} \cdot \boldsymbol{v} - \nabla_{\boldsymbol{x}} \cdot [p \boldsymbol{v}].$$

This is obviously similar to the PDE we started with. I know I've played fast and loose with notation a bit, but does this make any sense? Is it useful?