Solution (source code)

= Solution

For $i\ne j$, the inertia component is $I_{ij}=-\rho\int_V x_ix_j\,dV$. Reflecting just one of these coordinates preserves the cylinder and its uniform density but changes the integrand's sign. <Odd-integrand cancellation by reflection> therefore makes every off-diagonal entry zero. Rotations about the axis also give $I_{11}=I_{22}$.

Using <cylindrical coordinates> $x_1=r\cos\theta$, $x_2=r\sin\theta$, $x_3=z$, with $dV=r\,dr\,d\theta\,dz$, the required integrals are
$$
\begin{aligned}
\int_Vx_2^2\,dV&=4\left(\int_0^1r^3\,dr\right)\left(\int_0^{2\pi}\sin^2\theta\,d\theta\right)=\pi,\\
\int_Vz^2\,dV&=\left(\int_{-2}^{2}z^2\,dz\right)\left(\int_0^1r\,dr\right)\left(\int_0^{2\pi}d\theta\right)=\frac{16\pi}{3},\\
\int_V(x_1^2+x_2^2)\,dV&=4\left(\int_0^1r^3\,dr\right)2\pi=2\pi.
\end{aligned}
$$
Thus the <inertia tensor> is
$$
\boxed{I=\rho\pi\operatorname{diag}\left(\frac{19}{3},\frac{19}{3},2\right).}
$$
The mass is $M=4\pi\rho$, so these entries are also $19M/12,19M/12,M/2$, respectively.