Consider a non-conducting sphere of radius R. The sphere has a radially varying non-uniform charge density. Therefore, it has spherically symmetric charge distribution. Since the charge density is non-uniform, consider an infinitesimal spherical shell of thickness 'dr' within the sphere. The charge enclosed in the shell is the product of the charge density and the volume of the shell. To determine the electric field at a point P, outside the charge distribution, consider a Gaussian surface of radius r'. Here, the region between the Gaussian surface and the sphere is devoid of charge carriers. So, the net charge enclosed by the Gaussian surface is obtained by integrating the charge enclosed in the shell over the sphere's radius. Substituting the net charge in the electric field equation gives the field at a point outside the sphere. Similarly, for a point inside the charge distribution, the net charge enclosed is the integral of the charge enclosed in the Gaussian surface. Substituting the net charge in the field equation gives the electric field at a point inside the sphere.