Let's say that a total charge Q is distributed non-uniformly throughout an insulating sphere of radius R. Trying to solve for the field everywhere can then become very difficult, unless the charge distribution depends only on r (i.e., it is still spherically symmetric).
How much charge is enclosed by a gaussian sphere of radius r < R if the charge per unit volume inside an insulating sphere is given by ρ(r) = cr?
The answer can be found by integrating over spherical shells. The volume of a shell of radius r and thickness dr is the surface area multiplied by the thickness:
dV = 4πr2 dr
The charge enclosed by such a shell is:
dqenc = ρ dV = cr dV
Integrating from 0 to r gives:
What is c if the total charge on the sphere is Q? The enclosed charge is equal to Q when r = R, so:
qenc = Q = πc R4.
Two plots are shown on the graph above. One represents the charge enclosed by a gaussian sphere of radius r in the case of a uniform charge distribution, while the other represents the charge enclosed when the charge per unit volume inside the insulating sphere is ρ(r) = cr? Which plot is which?
This particular non-uniform distribution has less charge in the center and more concentrated toward the outside of the sphere than the uniform distribution has. Therefore the blue plot must be for the non-uniform distribution.