Solution (source code)

= Solution

For a scalar fluid property $f(\mathbf x,t)$, the <Eulerian time derivative> $\partial_t f$ measures change at a fixed <Eulerian coordinate>. The <material derivative>, also called the Lagrangian time derivative, measures change while following one <fluid element>. If its <Lagrangian trajectory> is $\mathbf X(\mathbf a,t)$, where $\mathbf a$ is its fixed <Lagrangian coordinate>, then $\partial_t\mathbf X=\mathbf u(\mathbf X,t)$.

The <chain rule> therefore gives
$$
\boxed{\frac{Df}{Dt}=\frac d{dt}f(\mathbf X(\mathbf a,t),t)=\frac{\partial f}{\partial t}+\mathbf u\cdot\nabla f.}
$$
The last term accounts for entering a region where the property differs. For example, a spatially varying but time-independent <velocity field> has zero <Eulerian time derivative>, while a moving <fluid element> can have nonzero <material acceleration>. The same formula applies componentwise to a <vector field>.