
The solution to this problem exactly the same as that in Problem 3.28, except that we now have a cylinder instead of a sphere - i.e. using superposition principle. The cylinder with the cavity is same as the superposition of a solid cylinder with charge density
and a smaller cylinder
corresponding to the cavity of density.First let us compute the electric field at a distance r from the axis inside a solid uniformly charged cylinder. Similar to in problem 3.28 we consider a cylindrical Gaussian surface of radius r and a very large length L about the axis of the cylinder. The total charge in the cylinder will be,

Then from Gauss's Law we have,


If we consider
as a planar vector in the horizontal plane from the axis as shown in figure 2, then,
Let
be the planar vector drawn from the axis of the cylinder to the axis of the cavity, then as in Problem 3.28, the net electric field is given by,











