Integration is just the addition of scalar quantities. If for example,a chain is kept at a table such that it's some part is on the table and some is not i.e. hanging in airĀ and if we want to calculate the potential energy of the chain that is slipping from the table, then we would consider a small part of chain and calculate potential energy for that small part and integrate it to get the potential energy of the whole chain. Also , if the object is linear ,then it's mass is taken as mass per unit length,if it is planar or laminar, then it's mass is taken as mass per unit area and if it is 3-dimensional, it's mass is taken as mass per unit volume.