# Volume Charge Distribution

1. Jun 26, 2015

### roam

1. The problem statement, all variables and given/known data
A sphere of radius R has a volume charge distribution $\rho(r)$ given by:

$\rho(r)= \rho_0 \left( \frac{r}{R_0} \right) \ \ for \ 0 <r<R$
$\rho(r)=0 \ \ elsewhere$

Where $\rho_0$ is a constant. Use Gauss's law to find E field outside the sphere.

2. Relevant equations

Integral form of Gauss's law

3. The attempt at a solution

I am not sure how to find the enclosed charge. Here's what I did:

$\int \rho \ dV = \int (0) (r^2 \ sin \theta dr d \theta d\phi)$

$\int^R_0 (0) . r^2 dr \int^\pi_0 sin \theta \ d \theta \int^{2 \pi}_0 d \phi = C 4 \pi$

Did I do the integration correctly?

I'm not sure what to do with the constant, I tried to find $E_{in}$ and use boundary conditions:

$\frac{\rho_0}{R} \int r.r^2 \ sin \theta dr d \theta d \phi = \frac{\rho_0 r^4 \pi}{R_0} \implies E_{in} = \frac{\rho_0 r^2}{\epsilon_0 R_0}$

At the boundary R:

$4\pi C = \frac{\rho_0 R}{\epsilon_0} \implies C=\frac{\rho_0 R}{4 \pi \epsilon_0} \implies Q_{enc} = \frac{\rho_0 R}{\epsilon_0}$

So this gives:

$\oint E_{out} da= |E| 4 \pi r^2= \frac{\rho_0 R}{\epsilon_0^2} \implies \therefore E_{out} = \frac{\rho_0 R}{4 \pi \epsilon_0^2 r^2}$

It doesn't look right. Am I using the correct method here to solve the problem? Any explanation would be appreciated.

2. Jun 26, 2015

### SammyS

Staff Emeritus
The density inside the sphere is not zero.

3. Jun 26, 2015

### stedwards

C seems to be on the wrong side of your equation for the integral. Is C the total charge?

For the integral, the area of a thin spherical shell is $4 \pi r^2$. It's volume is $4 \pi r^2 dr$. The charge within the volume element, $\rho(r) = \frac{r}{R_0}\rho_0$. The charge within the shell is $4 \pi r^2 \rho dr$.

4. Jun 26, 2015

### roam

C is a constant of integration. And this is a solid sphere, not a shell.

5. Jun 26, 2015

### roam

No, as calculated it, density inside is not 0. But we are looking for density outside.

So do you mean the density outside is the sum density inside plus density outside:

$\frac{\rho_0}{R} \int^R_0 r.r^2 \ sin \theta dr d \theta d \phi + \frac{\rho_R}{r} \int^R_0 r.r^2 \ sin \theta dr d \theta d \phi$

$\frac{\rho_0 r^4 \pi}{R}+ 4 \pi C$

But then it's not possible to solve for C with the boundary conditions in my previous post.

6. Jun 26, 2015

### Nathanael

There is no "constant of integration" for definite integrals.

I believe he was suggesting that you integrate over spherical shells to find the charge in the whole volume. This makes the integral a little nicer because it takes advantage of the fact that the charge-density is constant for each shell. But, if you want, you can use a triple integral over spherical coordinates. (Both methods become identical after you calculate the $d \theta d \phi$ integrals.)

Why are you looking for the density outside of R? It's already given that it's zero.

These should be triple integrals, but I'll take that to be a typo.

What are these integrals supposed to mean? You are trying to calculate the enclosed charge, right? Your first integral is reasonable but your second one makes no sense to me at all. Can you explain it?

Also I have a question about the problem statement; does R0=R?

7. Jun 26, 2015

### roam

Yes $R_0 =R$ radius of sphere.

I chose the integral for $\theta$ to run from 0 to pi, so the integral $\int^\pi_0 \ sin \theta d\theta$ becomes 2. The phi integral runs from 0 to $2 \pi$ which gives just $2 \pi$. I thought this is what we have to do in spherical. What is wrong?

Because I need an expression for $\rho$ to place in the equation for $E_{out}$.

EDIT: So do you mean I must take the limits of the first integral to be between 0 and R? (i.e. over the entire sphere)

That gives $\rho_{enclosed} = \frac{\pi \rho_0 R^3}{4}$

Last edited: Jun 26, 2015
8. Jun 26, 2015

### Nathanael

That's right, but I was saying you should've written it as a triple integral: $\frac{\rho_0}{R} \int\limits^R_0\int_0\limits^{2\pi}\int_0\limits^{\pi} r.r^2 \ sin \theta d \theta d \phi dr$
The way you wrote it just doesn't make any sense but anyway you have the right idea so it's not important.

Can you please explain these integrals: (Especially the second one)

9. Jun 26, 2015

### Nathanael

By $\rho_{enclosed}$ you mean $Q_{enclosed}$? It's not quite right, but almost. Show the integral that gives you that answer.

(It's hard to follow your methods because you're not really explaining yourself.)

10. Jun 26, 2015

### roam

Sorry, I was in a rush. Here's what I meant:

$Q_{enc} = \int^R_0 \frac{\rho r}{R_0} . r^2 dr . \int^\pi_0 sin \theta \ d \theta . \int^{2 \pi}_0 d \phi = \frac{\pi \rho_0 R^3}{4}$

Why is it not correct? I found the entire contribution due to the whole sphere, as you mentioned there are no charge densities outside it.

11. Jun 26, 2015

### Nathanael

The integral is correct but that's not what I get when I calculate it. (My answer is different by a factor of 4.)

12. Jun 26, 2015

### roam

How?

Well, the $\phi$ and $\theta$ components become $4 \pi$ together. The r component is:

$\frac{\rho}{R} \int_0^R r.r^2 = \frac{\rho}{R} \left[ \frac{r^4}{4} \right]^R_0 = \frac{\rho R^3}{4} \implies Q_{enc} =\frac{\rho R^3 . 4 \pi}{4} =\pi \rho R^3$

13. Jun 26, 2015

### roam

Alrigh, I got it (I think). Thank you so much for your help.

14. Jun 26, 2015

### stedwards

No, $4 \pi r^2 dr$ is a volume, there is no constant of integration and $Q={\int_0}^{R_0} 4\pi r^2 \rho(r) dr$ is the total charge, or do it the hard way using angles.