"Is there a way to calculate the inertia of an object when an object is moving linearly or is that just the mass?"
Moment of inertia or just "inertia". If you mean just inertia, avoid that term: it is ambiguous. If you mean moment of inertia, even linearly moving objects have a moment of inertia. No natural center point exists, but one can be defined, and then you use mr^2, same as for a rotating or revolving object.
"If it's just the mass, why can't you just use the mass at the COM to find the moment of inertia?"
Because the parts of the object will not all be at the same distance from the center point.
"Integrate r^2 dm. I would pull dm outside the integral and integrate r^2 as r^3/3, leaving me with dmr^3/3."
You seem to be getting thrown off by integrals with mixed variables. These are tricky and were poorly covered in my calculus class. I learned about them mostly through physics.
You can't pull any arbitrary factor out of an integral, only a constant one. Second, if you are left with integral of r^2, that's meaningless. You have to have a d-something to have a meaningful integral. The integral of r^2 dr is r^3/3, but without the dr it's undefined. Lastly, as I think you recognized, if you do it your way you leave the dm left over and don't know how to determine its value.
In order to do an integral, you need to be able to determine the value of everything inside in terms of the variable that comes after the d. You need to either rewrite r in terms of m, or rewrite dm in terms of dr. Yes, you can write equations for differential factors by themselves. Here is a fairly rich example. Let's find the moment of inertia of a cone around its axis of symmetry. The cone will have radius R, height H, and uniform density p. The moment of inertia is int(r^2 dm), as it is for everything. What's going to change is the value of dm.
The first thing to understand is the physical meaning of dr and dm. dr refers to a thin slice of space between radius r and r + dr. In two dimensions, that's a thin ring. In three dimensions, it's a thin cylindrical shell. dm is the mass enclosed within that space. The volume of that space can be calculated as the area of the cylinder times the thickness, which is dr. We need to know the radius and height of the cylinder. The radius is just the integrand, r. The height is some portion of the total height of the cylinder that decreases as we move away from the center.
(R - r)/R = h/H
h = H(R - r)/R
= H - (H/R)r
V = pi r^2 h dr
= (pi r^2 H - pi r^3 (H/R))dr
To find the mass simply multiply by density. dm = (pi pH r^2 - pi pH/R r^3) dr. Now you can replace dm in the integral.
int(r^2 (pi pH r^2 - pi pH/R r^3) dr)
See that we still have a d-something term, so it's a legitimate integral. Now split it up into two integrals and extract CONSTANT factors.
int(r^2 pi pH r^2 dr) - int(r^2 pi pH/R r^3 dr)
= pi pH int(r^4 dr) - pi pH/R int (r^5 dr)
= pi pH r^5/5 - pi pH/R r^6/6
The range of the integral is 0 to R, and it 0 it evaluates to 0, so just substitute R for r.
pi pH R^5/5 - pi pH/R R^6/6
= pi pH R^5/5 - pi pH R^5/6
= pi pH R^5 (1/5 - 1/6)
= (1/30) pi pH R^5