Solution (source code)

= Solution

At fixed time write the azimuthal shift as $\delta=2AL_xt$ modulo $L_y$. Integrating a radial derivative over the box gives a boundary difference proportional to
$$
\int_0^{L_z}\int_0^{L_y}[Q(L_x,y,z)-Q(0,y,z)]\,dy\,dz
=\int_0^{L_z}\int_0^{L_y}[Q(0,y+\delta,z)-Q(0,y,z)]\,dy\,dz.
$$
The two integrals agree by translation invariance of an integral over a full azimuthal period. Hence $\langle\partial_xQ\rangle=0$. The ordinary periodic boundary conditions make the $y$ and $z$ boundary differences zero as well. Finally,
$$
\int_0^{L_y}x\partial_yQ\,dy=x[Q(x,L_y,z)-Q(x,0,z)]=0
$$
for every $x,z$. Thus the <volume averages in a shearing box> satisfy
$$
\boxed{\langle\partial_xQ\rangle=\langle\partial_yQ\rangle
=\langle x\partial_yQ\rangle=\langle\partial_zQ\rangle=0}.
$$
For smooth shearing-periodic extensions, spatial derivatives and products inherit the same <shearing-periodic boundary condition>. Their divergence therefore has zero <volume average>, and integration by parts is available without a residual boundary flux. Time differentiation of an average over this fixed physical box commutes with integration, even though the radial identification shifts with time.