Solution (source code)

= Solution

Take the rotation axis as $z$. A slice of the uniform sphere at coordinate $z$ is a disc of radius $R(z)=\sqrt{a^2-z^2}$ and <mass> $dm=\rho\pi(a^2-z^2)\,dz$, where $\rho=3M/(4\pi a^3)$ is its <mass density>. Applying <8/a> to the slice gives
$$
dI=\frac12R(z)^2\,dm
=\frac{\rho\pi}{2}(a^2-z^2)^2\,dz.
$$
The slices' axes coincide, so no displaced-axis correction is needed. Integrating,
$$
\begin{aligned}
I&=\frac{\rho\pi}{2}\int_{-a}^a(a^4-2a^2z^2+z^4)\,dz\\
&=\frac{\rho\pi}{2}\left(2a^5-\frac43a^5+\frac25a^5\right)
=\frac{8\pi\rho a^5}{15}.
\end{aligned}
$$
Thus the <moment of inertia of a uniform solid sphere> is
$$
\boxed{I=\frac25Ma^2.}
$$
The sphere's <rotational symmetry> makes this valid about every central axis. A thin spherical shell would have a different <mass distribution> and a different <moment of inertia>.