Let $E$ be a rod of length $L$ and radius $r_1$. The rod is rotating about one end, the moment of inertia is given by the definition:
$$I=\iiint_{E} r^2 dm$$
Where $r$ is the distance from the axis of rotation, and $m$ is referring to mass. But assuming constant density, density is $\frac{dm}{dV}=\delta=\text{const}$ and so $dm=\delta dV$ so we have,
$$I=\iiint_{E} r^2 \delta dV$$
$$=\delta \iiint_{E} r^2 dV$$
Let the rod be around the $z$ axis and start at $z=0$ then to $z=L$, define the $z=0$ end to be the one we are rotating about. Then we have:
$$I=\delta \iiint_{E} z^2 dV$$
Now we switch to polar, do not confuse the $r$ here below to the previous $r$ in the formula for moment of inertia.
$$=\delta \int_{0}^{2\pi} \int_{0}^{r_1} \int_{0}^{L} r z^2 dz dr d\theta$$
$$=(\delta)(2\pi)(\frac{r_1^2}{2})(\frac{L^3}{3})$$
$$=\frac{\delta (\pi r_1^2 L)}{3}L^2$$
$$=\frac{(\delta)(V(E))}{3}L^2$$
Here $V(E)$ denotes the volume of $E$ and note volume•density=mass for constant density.
$$=\frac{M}{3}L^2$$
This result does not agree with the formula you are using.