# Homework Help: Electric field inside a cavity

1. Oct 28, 2012

### sloane729

1. The problem statement, all variables and given/known data
If I have a solid sphere of radius R and charge density $+\rho \, C/m^3$ and I then remove a smaller sphere of radius $b$ and is a distance $a$ from the center of the larger sphere, what is the electric field inside the cavity?
I get an answer which I think is right. I've look at the math over and over and can't quite figure out what the teacher did.

2. Relevant equations
Gauss' Law:
$$\oint \vec{E} \cdot d\vec{S} = \frac{q_{encl}}{\epsilon_0}$$

3. The attempt at a solution
I know this is a classic problem using the superposition principle.
First I apply GL to the large sphere at a distance $r<R$ from the center and get an electric field
$$\vec{E} = \frac{ \rho }{3 \epsilon_0} \vec{r}$$

Then I do the same except with a charge density of $-\rho \, C/m^3$ so
$$\vec{E'} = - \frac{\rho }{3 \epsilon_0} \vec{r'} = -\frac{\rho}{3 \epsilon_0} (\vec{r} - \vec{a})$$

Now I just sum the two fields
\begin{align} \vec{E} + \vec{E'} & = \frac{ \rho }{3 \epsilon_0} \vec{r} -\frac{\rho}{3 \epsilon_0} (\vec{r} - \vec{a}) \\ &= \frac{ \rho }{3 \epsilon_0} \vec{r} -\frac{\rho}{3 \epsilon_0} \vec{r} +\frac{\rho}{3 \epsilon_0} \vec{a} \\ &=\frac{\rho}{3 \epsilon_0} \vec{a} \end{align}

This is my solution which is supposedly wrong.

2. Oct 28, 2012

### ehild

Your solution is correct. See, for example http://jkwiens.com/2007/10/24/answe...nonconducting-sphere-with-a-spherical-cavity/