Let $\mathbf{R}$ be the rotation matrix that transforms the reference frame $K$ to $K'$ and $\mathbf{I}$ be the inertia tensor of $K$, $\mathbf{I'}$ be the inertia tensor of $K$. I am asked to show $$\mathbf{I'}=\mathbf{R}\mathbf{I}\mathbf{R^T}$$ Namely the components of the moment of inertia tensor $I_{ij}$ in the two references frames are related by $I'_{ij}=\sum_{k,\ell}R_{ik}R_{j\ell}I_{k\ell}$. Below is my attempt:
As the first step we write the expressions of $\mathbf{I}'$ and $\mathbf{I}$, they are \begin{equation*} \mathbf{I}'= \begin{pmatrix} I_{x_1'x_1'} & I_{x_1'x_2'} & I_{x_1'x_3'}\\ I_{x_2'x_1'} & I_{x_2'x_2'} & I_{x_2'x_3'}\\ I_{x_3'x_1'} & I_{x_3'x_2'} & I_{x_3'x_3'} \end{pmatrix} = \begin{pmatrix} \int x_2'^2+x_3'^2 & -\int x_1'x_2' & -\int x_3'x_1'\\ -\int x_1'x_2' & \int x_3'^2+x_1'^2 & -\int x_2'x_3'\\ -\int x_3'x_1' & -\int x_2'x_3' & \int x_1'^2 +x_2'^2 \end{pmatrix} \end{equation*} \begin{equation*} \mathbf{I}= \begin{pmatrix} I_{x_1x_1} & I_{x_1x_2} & I_{x_1x_3}\\ I_{x_2x_1} & I_{x_2x_2} & I_{x_2x_3}\\ I_{x_3x_1} & I_{x_3x_2} & I_{x_3x_3} \end{pmatrix} = \begin{pmatrix} \int x_2^2+x_3^2 & -\int x_1x_2 & -\int x_3x_1\\ -\int x_1x_2 & \int x_3^2+x_1^2 & -\int x_2x_3\\ -\int x_3x_1 & -\int x_2x_3 & \int x_1^2 +x_2^2 \end{pmatrix} \end{equation*} We try find the expression of $x_{i}'x_{j}'$ with $i\neq j$. Since \begin{equation*} x_i'=\sum_{k}R_{ik}x_k \end{equation*} \begin{equation*} x_{j}'=\sum_{\ell}R_{j\ell}x_{\ell} \end{equation*} We have \begin{equation*} x_i'x_j'=\sum_{k,\ell}R_{ik}R_{j\ell}x_kx_{\ell} \end{equation*} \begin{equation*} \Downarrow \end{equation*} \begin{equation*} I_{x_i'x_j'}=-\int\sum_{k,\ell}R_{ik}R_{j\ell}x_{k}x_{\ell}=-\sum_{k,\ell}R_{ik}R_{j\ell}\int x_{k}x_{\ell}=\sum_{k,\ell}R_{ik}R_{j\ell}I_{k\ell} \end{equation*} \begin{equation*} \Downarrow \end{equation*} \begin{equation*} I'_{ij}=\sum_{k,\ell}R_{ik}R_{j\ell}I_{k\ell} \end{equation*} However, my method only works for $i\neq j$. I have no idea how to deal with the case where $i=j$, i.e the diagonal elements. Are there some instructions?