A long cylinder contains uniformly distributed charge density ρ. The electric field at a point P inside the cylinder at a distance x from the axis is :
Consider a Gaussian cylinder of radius x and length l.
By Gauss's law the field inside cylinder , E.2πxl=Qenϵ0=ρ.πx2lϵ0
⇒E=ρx2ϵ0