Moment of inertia integral has mass, not radius differential? We've been learning about the derivation for moment of inertia as:
$$\int r^2 dm$$
However, for me, this looks like it's a bit backwards. As a first year calc student, I see the differential in the integration as almost being the "independent" variable and the function inside as being the "dependent" variable (when we usually do integration, we have something like $\int f(x) dx$, so I have developed this intuition).
However, going with this idea, it would then seem like radius is somehow a function of mass. I would think it would be the other way around, as in, I input radius and then the function gives me the differential mass at a given radius. Can you please give me intuition on why we are splitting up the object into differential masses and not differential distances from the axis of rotation?
 A: Suppose you have a single point mass $m$ at a distance $r$, then the moment of inertia is of course just:
$$ I = mr^2 $$
But suppose now our mass is an extended object not a point mass, so the above equation doesn't apply. We could get an approximation for $I$ by splitting the mass up into $n$ smaller masses $m_i$ with centres of mass at $r_i$:
$$\begin{align}
 I &\approx m_0r_0^2 + m_1r_1^2 + \text{...} + m_nr_n^2 \\
   &\approx \sum_{i~=~0}^n m_i r_i^2
\end{align}$$
To make this exactly we increase the splitting up into an infinite number of infinitesimally small masses $dm$, and the sum turns into an integral:
$$ I = \int~\mathrm dm\,r^2 $$
And that's what the equation you give means. But in practice we wouldn't express $r$ as a function of $m$ and integrate with respect to $\mathrm dm$. Instead we note that $\mathrm dm = \rho~\mathrm dV$, where $\mathrm dV$ is the infinitesimal volume of our infinitesimal mass. Suppose we are using Cartesian coordinates with the axis of rotation along the $z$ axis, then our volume element is $\mathrm dV = \mathrm dx\,\mathrm dy\,\mathrm dz$ and our integral becomes:
$$ I = \int \int \int r(x,y)^2 \rho(x,y,z)~\mathrm dx\,\mathrm dy\,\mathrm dz $$
where $r$ is the distance from the axis:
$$ r^2 = x^2 + y^2 $$
But writing $\displaystyle \int r^2~\mathrm dm$ is a lot shorter and means the same thing.
A: The integral in the question is an acceptable definition; when we write,
$$I = \int dm \, r^2$$
we mean here that $r$ is the distance a point of the object is from the axis of rotation, as a function of mass. An equivalent definition of $I$ would be,
$$I = \int_V dV \, \rho \, r^2$$
where again $r$ is the distance from the axis, but this time as a function of the position of the point.

Illustrative Example
Consider a rod of infinitesimal thickness and length $\ell$ in the $xy$-plane, say, resting on the $x$ axis from the origin to $x= \ell$, and we are rotating it about the $z$-axis. Then, the mass of a point a distance $x$ from the origin will be, $m(x) = \lambda x$, where $\lambda$ is the linear density. Inverting this means,
$$r^2_{\mathrm{axis}} = \frac{m^2}{\lambda^2}$$
and using the first definition of $I$, by integrating over all masses, we have,
$$I = \int_0^{\lambda \ell} dm \, \frac{m^2}{\lambda^2} = \frac{1}{3}\lambda \ell^3 = \frac{1}{3}M\ell^2$$
where $M = \lambda \ell$ is the total mass. Now, proceeding with the second definition, note the density is $\rho(x,y) = \lambda \delta(y)\mathbb{1}_{[0,\ell]}( x)$ and that the distance from the axis is given by $r^2_{\mathrm{axis}} = x^2 + y^2$. Integrating,
$$\int_V dy dx \, \rho (x^2 + y^2) = \left[ \frac{1}{3}\lambda x^3\right]^{\ell}_0 = \frac{1}{3}\lambda \ell^3 = \frac{1}{3}M\ell^2.$$
From this example, you can see why the definitions are equivalent, but we often use the second, particularly because expressing the distance from the axis as a function of mass is not always as simple, and it is rather odd to think of them relating in that way.
