4. A rod of length L is placed on the x-axis from x=0 to x=L. Find the mass of the rod and the center of mass if the density of the rod varies directly as the distance from the x=0 endpoint of the rod.