The charge q enclosed by the Gaussian surface is the positive nuclear
charge and the negative charge within the sphere of radius r,
i e , 
3
4
3
r
q
Z e
ρ
π
=
+
Substituting for the charge density r  obtained earlier, we have
3
3
r
q
Z e
Z e
R
=
−
Gauss’s law then gives,
2
3
0
1
( )
;
4
Z e
r
E r
r
R
r
R
ε
 
 
=
−
<
 
 
 
 
π
The electric field is directed radially outward (ii) r > R:  In this case, the total charge enclosed by the Gaussian
spherical surface is zero since the atom is neutral