The variation of density of a solid cylindrical rod of cross-sectional area \( a \) and length \( L \) is \( \rho=\rho_0 \frac{x^2}{L^2} \), where \( x \) is the distance from one end. The position of its centre of mass from \( x=0 \) is 
Variable density rods: Use \( x_{cm} = \frac{\int x\rho dx}{\int \rho dx} \).