By Gauss' Law a spherically symmetric charge distribution willcontribute an electric field only outside an imaginary spherical surface drawn at a radiusr within the charge distribution. Any charge outside this imaginary surface does not contributeto the electric field within the surface. Also, the electric field outside such an imaginarysurface is the same as though all of the charge within the surface was concentrated at the center ofthe sphere.

So \(\displaystyle{E}={\frac{{{k}{Q}}}{{{r}^{{2}}}}}\) at a distance r from the center of the spherewhere Q the total charge contained within a spherical surface of radius r is \(\displaystyle{Q}={\frac{{{4}}}{{{3}}}}\cdot\pi\cdot{r}^{{3}}\)

Also, you can write \(\displaystyle{q}={Q}\cdot{\frac{{{4}}}{{{3}}}}\cdot\pi\cdot{\frac{{{r}^{{3}}}}{{{\frac{{{4}}}{{{3}}}}\cdot\pi\cdot{R}^{{3}}}}}={Q}{\frac{{{r}^{{3}}}}{{{R}^{{3}}}}}\) where Q is total charge on the sphere and q is the charge within an imaginary surfaceof radius r. Also, you can write the electric field as \(\displaystyle{E}={\frac{{{Q}{e}}}{{{4}\pi\epsilon_{{0}}{R}^{{3}}}}}\) where Q is total charge, r the distancefrom center of the sphere, and R is the radius of the spherical charge distribution.

Note that r > R you simply have \(\displaystyle{E}={\frac{{{Q}}}{{{4}\pi\epsilon_{{0}}{r}^{{2}}}}}\) where r is distance to center of sphere. Also, note that since the force within the sphere isproportional r, a charged particle released at any point within the tunnel would simple oscillate with simpleharmonic motion with the amplitude that it had when released.

So \(\displaystyle{E}={\frac{{{k}{Q}}}{{{r}^{{2}}}}}\) at a distance r from the center of the spherewhere Q the total charge contained within a spherical surface of radius r is \(\displaystyle{Q}={\frac{{{4}}}{{{3}}}}\cdot\pi\cdot{r}^{{3}}\)

Also, you can write \(\displaystyle{q}={Q}\cdot{\frac{{{4}}}{{{3}}}}\cdot\pi\cdot{\frac{{{r}^{{3}}}}{{{\frac{{{4}}}{{{3}}}}\cdot\pi\cdot{R}^{{3}}}}}={Q}{\frac{{{r}^{{3}}}}{{{R}^{{3}}}}}\) where Q is total charge on the sphere and q is the charge within an imaginary surfaceof radius r. Also, you can write the electric field as \(\displaystyle{E}={\frac{{{Q}{e}}}{{{4}\pi\epsilon_{{0}}{R}^{{3}}}}}\) where Q is total charge, r the distancefrom center of the sphere, and R is the radius of the spherical charge distribution.

Note that r > R you simply have \(\displaystyle{E}={\frac{{{Q}}}{{{4}\pi\epsilon_{{0}}{r}^{{2}}}}}\) where r is distance to center of sphere. Also, note that since the force within the sphere isproportional r, a charged particle released at any point within the tunnel would simple oscillate with simpleharmonic motion with the amplitude that it had when released.