The moment of inertia of an object depends on its axis of rotation. Consider a barbell consisting of two masses attached to the ends of a rod. The masses at the end can be considered point masses, and the rod can be assumed to have negligible weight. The moment of inertia of the barbell can be calculated using the mathematical definition of the moment of inertia once the system's rotation axis is decided. Suppose the point masses m are fixed at a distance R from the center of the rod, the moment of inertia about an axis passing through its center is equal to 2mR2 and about an axis at one of its ends, it is 4mR2. This suggests that it is twice as hard to rotate the barbell about the end than about its center.
The definition of the moment of inertia of a rigid body is derived from considering each element of mass at a fixed distance from the axis of rotation. However, for a rigid body built of continuous mass, each element is infinitesimal. Hence, the summation is replaced by the integral over infinitesimal mass elements.
In special cases, when the mass is distributed evenly throughout the object of interest, the mass element can be written as density multiplied by the element of length, area, or volume and other relevant constants. For example, imagine a thin uniform rod with mass uniformly distributed throughout its length. By relating the infinitesimal mass element with an infinitesimal length element via the constant linear mass density, its moment of inertia can be calculated. It is found that a uniform rod's moment of inertia about an axis fixed at its end is four times more than its moment of inertia about an axis passing through its center.