Note that the result is the same as if the charge were concentrated in a line along the axis.
Consider a gaussian cylinder of radius r and length L. The charge enclosed by the cylinder is given by
and the flux through the tube wall is given by
There is no flux contribution from the endcaps. By Gauss's law, the electric field is then proportional to the distance from the center and to the charge density:
Outside the cylinder a "line of charge" result is obtained.
Using the result for a sheet of charge
along with the superposition principle, yields
directed outward, outside the sheets.
Inside the sheets the electric field is zero.
a) To find the total charge on the sphere, integrate over the charge density with spherical shells, from 0 to R, as shown:
b) Consider a gaussian sphere of radius r, centered in the charged sphere. Then the charge enclosed is given by: