The mass properties of an object are found using a volume integralvolume integral.
The general procedure is a mathematical summation of the volume of the solid. There are several steps needed to be taken to get the final result and they are outlined below: (caution, calculus ahead)
Volume - The solid is parametrized in a way the volume can be summed by $$V = \int {\rm d}V$$
There are various common ${\rm d}V$ expressions depending on the geometry, such as ${\rm d}V = {\rm d}x\, {\rm d}y\, {\rm d z}$ or ${\rm d}V = r\,{\rm d}r\,{\rm d}\theta\,{\rm d}z$.
There are various common ${\rm d}V$ expressions depending on the geometry, such as ${\rm d}V = {\rm d}x\, {\rm d}y\, {\rm d z}$ or ${\rm d}V = r\,{\rm d}r\,{\rm d}\theta\,{\rm d}z$.For the most general case if the interior points of the solid can be expressed in terms of a vector with three parameters $\vec{\rm pos}(u,v,w)$ then the volume differential is $${\rm d}V = \left| \frac{\partial \vec{\rm pos}}{\partial u} \cdot (\frac{\partial \vec{\rm pos}}{\partial v} \times \frac{\partial \vec{\rm pos}}{\partial w}) \right| {\rm d}u\,{\rm d}v\,{\rm d}w$$
Here $\cdot$ is the vector inner product, and $\times$ the vector cross product.
For the most general case if the interior points of the solid can be expressed in terms of a vector with three parameters $\vec{\rm pos}(u,v,w)$ then the volume differential is $${\rm d}V = \left| \frac{\partial \vec{\rm pos}}{\partial u} \cdot (\frac{\partial \vec{\rm pos}}{\partial v} \times \frac{\partial \vec{\rm pos}}{\partial w}) \right| {\rm d}u\,{\rm d}v\,{\rm d}w$$ Here $\cdot$ is the vector inner product, and $\times$ the vector cross product.- Volume Element in Wikipedia has more details on how ${\rm d}V$ is defined for solids.
Mass - The volume integral is summed over the density function $$ m = \int \rho\,{\rm d}V$$ If density is assumed to be constant, then the above is usually flipped to set $\rho = m/V$ in the equations below.
Center of Mass - The volume integral is summed over the position function $$ \vec{\rm com} = \frac{1}{m} \int (\vec{\rm pos})\,\rho {\rm d}V$$
Mass moment of inertia (tensor) about origin - The MMOI of the body about the origin is evaluated with the volume integral summing the MMOI of each particle in the solid $$ \mathrm{I}_O = \int ( \vec{\rm pos} \cdot \vec{\rm pos} - \vec{\rm pos} \otimes \vec{\rm pos}) \, \rho\,{\rm d}V$$ Here $\cdot$ is the vector inner product, and $\otimes$ the vector outer product.
an alternate form of the above is $$ \mathrm{I}_O = \int \begin{vmatrix} z^2+y^2 & -x y & -x z \\ -x y & x^2+z^2 & - y z \\ -x z & -y z & x^2+y^2 \end{vmatrix} \, \rho\,{\rm d}V$$
for the case with uniform density, usually, MMOI is expressed in terms of a known mass, which is done by taking the density out of the integral $$ \mathrm{I}_O = \frac{m}{V} \int ( \vec{\rm pos} \cdot \vec{\rm pos} - \vec{\rm pos} \otimes \vec{\rm pos}) \,{\rm d}V$$
Mass moment of inertia (tensor) about the center of mass - Finally the parallel axis theorem must be applied to transform the MMOI about the origin $\mathrm{I}_O$ to the MMOI about the center of mass $\mathrm{I}_C$ $$\mathrm{I}_C = \mathrm{I}_O - m ( \vec{\rm com} \cdot \vec{\rm com} - \vec{\rm com} \otimes \vec{\rm com})$$
The above describes MMOI in the most general approach possible, in order to be able to apply it to various scenarios.