Solution (source code)

= Solution

The <displacement> follows a material point from its reference position to its current position:
$$
\boxed{\mathbf u(\mathbf X,t)=\mathbf x(\mathbf X,t)-\mathbf X.}
$$
The <deformation gradient> is the <Jacobian matrix> $F=\partial\mathbf x/\partial\mathbf X=I+\nabla_X\mathbf u$, and the volume Jacobian is
$$
\boxed{J=\det F,\qquad dV=J\,dV_0.}
$$
For an orientation-preserving physical <deformation>, $J>0$ measures the local volume expansion factor. <Incompressibility> requires $J=1$; <conservation of mass> gives $\rho(\mathbf x,t)J=\rho_0(\mathbf X)$. For small <displacement> <gradients>, $J=1+\nabla_X\cdot\mathbf u+O(|\nabla_X\mathbf u|^2)$. If a spatial representation is desired, the same <displacement> is $\mathbf u(\mathbf x,t)=\mathbf x-\mathbf X(\mathbf x,t)$.