The density of a linear rod of length 'L' varies as p = A+Bx where x is the distance from the left end. Then the position of the centre of mass from the left end is