Solution (source code)

= Solution

Apply the <continuity equation> and integrate by parts, with the stated vanishing boundary terms and finite moments. The <second mass moment tensor> satisfies
$$
\dot I_{ij}=\int\rho(u_ix_j+x_iu_j)\,d\tau,
$$
and differentiation again gives
$$
\ddot I_{ij}=2\int\rho u_iu_j\,d\tau+\int\rho(x_iD_tu_j+x_jD_tu_i)\,d\tau.
$$
Insert the stress-<divergence> equation from part (a). The two force integrals become
$$
\int(x_i\partial_kT_{jk}+x_j\partial_kT_{ik})\,d\tau=-\int(T_{ji}+T_{ij})\,d\tau=-2\mathcal T_{ij}.
$$
The first term is $4K_{ij}$. Hence the <magnetized-fluid tensor virial theorem> is
$$
\boxed{\frac12\ddot I_{ij}=2K_{ij}-\mathcal T_{ij}.}
$$
Here $\mathcal T$ is the volume-integrated stress, whose sign differs from some gravitational potential-energy tensor conventions. The derivation also requires the advective mass-moment surface terms to vanish; this is automatic for an isolated sufficiently decaying configuration.