Solution (source code)

= Solution

Let $\mathbf r$ be position relative to the <center of mass>, and let the new origin have vector $\mathbf c$ relative to it. The <inertia tensor> about this origin is
$$
(I_{\mathbf c})_{ij}=\int\bigl(|\mathbf r-\mathbf c|^2\delta_{ij}-(r_i-c_i)(r_j-c_j)\bigr)\,dm.
$$
Expanding and using $\int\mathbf r\,dm=0$ proves the tensor form of the <parallel axis theorem>:
$$
\boxed{I_{\mathbf c}=I_0+M\bigl(|\mathbf c|^2I-\mathbf c\mathbf c^T\bigr).}
$$
For a uniform cube of side $L$ and mass $M$, centered coordinate <integrals> give $I_0=(ML^2/6)I$. The displacement to a vertex is $(L/2,L/2,L/2)$ up to signs. Using axes along its incident edges gives
$$
\boxed{I_{\rm vertex}=ML^2\begin{pmatrix}2/3&-1/4&-1/4\\-1/4&2/3&-1/4\\-1/4&-1/4&2/3\end{pmatrix}.}
$$
The <principal moments of inertia> are $\boxed{ML^2/6,\ 11ML^2/12,\ 11ML^2/12}$. The first <principal axis> is the body diagonal through the vertex; every direction perpendicular to it has the repeated moment.