Centre of mass by integration
For a rod whose density changes along it, the mass-weighted average becomes an integral, $x_{cm} = \frac{1}{M}\int x\,\lambda(x)\,dx$, which pulls the centre of mass towards the heavier end.
From AP Physics C: Mechanics.