# Homework Help: Electric field and potential of a sphere

1. Sep 24, 2009

### fluidistic

1. The problem statement, all variables and given/known data

A sphere of radius $$a$$ has a distribution of charge $$\rho (r)=Cr$$ where $$C$$ is a constant.
1)Calculate the electric field in all points of space.
2)Calculate the electric potential outside the sphere.

2. Relevant equations

To figure out.

3. The attempt at a solution
I got all wrong, I'd like to know where are my mistakes.
1) The electric field is radial. To calculate it outside the sphere I first calculate the total charge $$Q$$ of the sphere : $$Q= \int _0^a \rho (r) dr = \int _0 ^a Crdr= \frac{Ca^2}{2}$$.
Now I imagine a sphere (Gaussian surface) of radius $$r>a$$ and I have that $$\Phi=\frac{Q_{\text{enclosed}}}{\varepsilon _0} = \oint \vec E d \vec A=EA=E4 \pi r^2$$ but we already saw that $$Q_{\text{enclosed}}= \frac{Ca^2}{2}$$, thus $$E4 \pi r^2 = \frac{Ca^2}{2 \varepsilon _0} \Rightarrow E= \frac{Ca^2}{8 \pi \varepsilon _0 r^2}$$, $$r>a$$. (wrong result)

Now I calculate the electric field inside the sphere : $$\Phi=\oint \vec E d \vec A = 4 \pi r^2 E = \frac{Cr^2}{2 \varepsilon _0} \Rightarrow E= \frac{C}{8 \pi \varepsilon _0}$$ for $$r<a$$. (wrong result, as you can see I got that the electric field inside the sphere does not depend on $$r$$... impossible!)

2)$$E=- \nabla \varphi$$.
Thus $$\varphi (r)=- \int _a ^r E(r)dr = - \int _a ^r \frac{Ca^2}{8 \pi \varepsilon _0 r^2}dr=\frac{Ca^2}{8 \pi \varepsilon _0} \left [ \frac{1}{r}- \frac{1}{a} \right ]$$, with $$r>a$$ where $$r$$ is the distance between the center of the sphere and the considered point outside the sphere.
Which is also wrong.

2. Sep 24, 2009

### latrocinia

the total charge on the sphere is the surface of the sphere times the charge density so:

Qtot = rho * 4 pi r^2

so in the limit of space the electric field is just :

E = 1/ (4*pi *eta) * Qtot / r^2

however for points close to the sphere this is more complicated and you need some integration.

the electric field inside the sphere however is not a function of r because it is 0 everywhere inside the sphere.

from gauss's law we know that the electric flux = Qinclosed / eta = (integral) E dA

when we draw imaginary spheres inside the sphere, the Q inclosed is zero because all the charge is on the sphere, while we are in it. So because the area of the imaginary sphere is non zero, the electric field HAS to be zero to conform to gauss's law.

Qinclosed = 0 -> electric flux = 0 / eta = 0 = E * A (A is non-zero) -> E = 0

3. Sep 24, 2009

### fluidistic

I don't think so. I haven't been clear. The sphere is not empty as the exercise points out that $$\rho (r)=Cr$$. Hence $$Q$$ is not worth $$4 \pi a^2 \rho$$. Furthermore the electric field inside the sphere is not null.

4. Sep 24, 2009

### TwoTruths

First off, something seems off about your calculation of the total charge. A sphere is a three dimensional object, and to calculate the total charge, you will need the volume. Thus, the integral must be three dimensional, whereas yours is one dimensional.

Why is the electric field at all points in space outside of the sphere not simply the same electric field formula for a point charge?

Take a Gaussian surface of radius r > a. The flux inside is equal to E*SA = Q_inside / eps_0. Q_inside is simply the total charge of the sphere. Change eps_0 into the Coulomb's constant equivalent, and you can see the behavior I mentioned above.

I would help with the inside the sphere, but I'm working on my own homework at the moment. xD Sorry. Here's a little bit of help: E should be directly proportional to r in your final formula.

5. Sep 24, 2009

### fluidistic

Oh thanks... you're right. Hopefully my only error was with calculating the total charge of the sphere. I hope my reasoning is right otherwise.

6. Sep 24, 2009

### fluidistic

I used calculus III to calculate the total charge of the sphere, which gave me $$Q=C \int _0^{2\pi} \int _0^{\pi} \int _0^a r^3 \sin (\phi) d r d\phi d\theta =\pi a^4 C$$.
I guess I'm almost done for the exercise.
Thanks a lot.

7. Sep 25, 2009

### TwoTruths

Good work on figuring out the triple integral btw. =)

8. Sep 25, 2009

### Staff: Mentor

Good! But take advantage of radial symmetry to get the answer quicker (with calculus I) by viewing the sphere as composed of concentric shells:

$$Q = \int _0^a 4\pi r^2 \rho(r) dr = 4\pi C \int _0^a r^3 dr = \pi a^4 C$$

9. Oct 11, 2009

### nyt00

so if you knew the electric field, how can you derive the charge of the enclosed sphere

10. Oct 11, 2009

### nyt00

i was thinking using gauss law for next flux = q(enclosed)/eta