Let us consider an elementary length dx at a distance x from one end. It's mass =k.x.dx [k= proportionality constant ] Then centre of gravity of the rod‌xc is given by xc=
3
∫
0
kxdx.x
3
∫
0
kxdx
=
3
∫
0
x2dx
3
∫
0
xdx
=
x3
3
|03
x3
3
|03
or xc=
27∕3
9∕2
=2 ∴ Centre of gravity of the rod will be at distance of 2m from one end.