# Energy of a Charged Sphere

1. Sep 19, 2009

### p3rry

Hi everybody...

this is my first topic here.
I'm solving problems for the phd test here in my university. Here's my question:

I have to calculate the energy of charging a sphere (radius = R) with a uniform charge density "rho".

I can use 2 formulas:

the first is the integral over the space of rho(x)V(x), where V(x) is the electric potential
the second is the integral over the space of epsilon0*|E(x)|^2 where E(x) is the electric field

(there's a 1/2 coefficient for each formula)

If I calculate the 2 integrals I get different results, with the second method I get 2 times the result of the first one. I think it may be explained with the integration constant of V(x), but I'd like to be able to get the same result with this equivalent formulas.

Thank you very much. Bye

Claudio

2. Sep 19, 2009

### saunderson

3. Sep 20, 2009

### p3rry

Thank you very much, there's a straightforward solution of the problem.
But I still have a question. Why if I try to calculate the resultant energy by using equation (587) that's
$$W=\frac{1}{2}\int \rho V(r) \mathrm{d}^{3} r$$
I can't get the same energy I get with (594)
$$W=\frac{\epsilon_{0}}{2}\int |E|^{2}\mathrm{d}^{3} r$$
?

I think I'm making a mistake in the calculation of the potential V(r) but I cannot find it out...

Last edited: Sep 20, 2009
4. Sep 21, 2009

### diazona

Hm, well maybe if you show what you did we can point out where the mistake might be...

5. Sep 22, 2009

### non-hermitian

First, we calculate the potential for this situation. Inside of the solid sphere, which is the only region that matters for calculating $$\int d^{3}x \rho V(x)$$, the potential at radius $$r$$ is the same as that for a point charge with charge $$\frac{4}{3} \pi r^3 \rho$$. So, we get

$$\int d^{3}x \rho V(x) = \int d^{3}x \rho \left(\frac{1}{4 \pi \epsilon_{0}} \frac{\frac{4}{3} \pi r^3 \rho}{r^2} \right) = \int_{0}^{\infty} dr 4 \pi r^2 \rho \left(\frac{1}{4 \pi \epsilon_{0}} \frac{\frac{4}{3} \pi r^3 \rho}{r^2} \right) = \int dr \frac{4 \pi r^4 \rho^2}{3 \epsilon_{0}} = \frac{4 \pi R^5 \rho^2}{15 \epsilon_{0}}$$.

Now we calculate the electric field everywhere. The field is pointed radially outward everywhere. Inside of the sphere, the electric field at a distance $$r$$ is the same as that of a point charge with charge $$\frac{4}{3} \pi r^3 \rho$$, so we see that the magnitude of the electric field inside is given by

$$E_{\text{inside}} = \frac{1}{4 \pi \epsilon_{0}} \frac{\frac{4}{3} \pi r^3 \rho}{r^2}$$

Outside of the sphere, the electric field looks like that of a point charge with charge $$\frac{4}{3} \pi R^2 \rho$$, so we see that

$$E_{\text{outside}} = \frac{1}{4 \pi \epsilon_{0}} \frac{\frac{4}{3} \pi R^3 \rho}{r^2}$$.

We break our integral into an integration over the outside of the sphere and one over the inside of the sphere. This yields

$$\frac{1}{2} \epsilon_{0} \int d^{3}x E^2 = \frac{1}{2} \epsilon_{0} \left( \int_{0}^{R} dr 4 \pi r^2 \left[\frac{1}{4 \pi \epsilon_{0}} \frac{\frac{4}{3} \pi r^3 \rho}{r^2} \right]^2 + \int_{R}^{\infty} dr 4 \pi r^2 \left[\frac{1}{4 \pi \epsilon_{0}} \frac{\frac{4}{3} \pi R^3 \rho}{r^2} \right]^2 \right) =\frac{2 \pi R^5 \rho^2}{45 \epsilon_{0}} + \frac{2 \pi R^5 \rho^2}{9 \epsilon_{0}} = \frac{4 \pi R^5 \rho^2}{15 \epsilon_{0}}$$

The two ways of doing it give you the same answer.

6. Oct 1, 2009

### p3rry

You don't get the same answer, because in the first way the energy is:
$$W=\frac{1}{2}\int \mathrm{d}^{3}r V(r)$$
that is half what you get with the electric field way.

Maybe there's something wrong in the value of V(r) that I use in the integration (the same that you show in your calculations). Thank You

Claudio

7. Oct 1, 2009

### non-hermitian

You're right-- I see it now. The value for $$V(r)$$ inside of the sphere should instead be

$$V(r) = \frac{Q}{8 \pi \epsilon_{0} R} \left(3 - \left(\frac{r}{R}\right)^2 \right)$$

where

$$Q = \frac{4}{3} \pi R^3 \rho$$

which will give you the right answer when you correctly include the factor of $$\frac{1}{2}$$ in the integral over the potential.