The centre of mass of a continuous body

For mass spread along a body, slice it into pieces $dm$ and turn the sum into an integral, $x_{\text{cm}} = \frac{\int x\,dm}{\int dm}$ with $dm = \lambda\,dx$, so a rod that gets heavier towards one end balances closer to that end.

From Physics 1.