$$\boxed{I = \iiint_S r^2 dm} \tag 1$$$$\boxed{I = \iiint_\mathcal{V} r^2 dm} \tag 1$$
where $S$$\mathcal{V}$ is space in which the volume that object is definedoccupies in 3D. Now the only thing you have to do is to represent the infinitesimally small mass $dm$ as a function of distance $r$. For objects whose density $\rho$ is constant (homogeneous objects), the mass can be expressed as
$$\boxed{I = \rho \iiint_S r^2 dV} \tag 2$$$$\boxed{I = \rho \iiint_\mathcal{V} r^2 dV} \tag 2$$
$$\boxed{I = \sigma \iint_S r^2 dA} \tag 3$$$$\boxed{I = \sigma \iint_\mathcal{A} r^2 dA} \tag 3$$
The integrationwhere $\mathcal{A}$ is usually donethe area that object occupies in 2D. The double integrals are solved either in Cartesian coordinates or polar coordinates, whichever is more suitable for a specific problem. Except for these two, the triple integrals can also be solved in spherical coordinates, but I will focus here only on double integrals.
$$\boxed{I = \sigma \iint_S (x^2 + y^2) dx dy} \tag 4$$$$\boxed{I = \sigma \iint_\mathcal{A} (x^2 + y^2) dx dy} \tag 4$$
$$\boxed{I = \sigma \iint_S r^2 \cdot r dr d\theta} \tag 5$$$$\boxed{I = \sigma \iint_\mathcal{A} r^2 \cdot r dr d\theta} \tag 5$$