# Poisson's equation and charge density distribution (electromagnetism)

1. Sep 29, 2016

### JulienB

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

Hi everybody! I'm preparing for an exam of electromagnetism, and I am struggling with the last question of this problem (hopefully the two first ones are correctly solved):

Given potential: $\phi(\vec{r}) = k \frac{q}{r} e^{-r/R}$ with $r=\sqrt{x^2 + y^2 + z^2}$ and $R =$const.)
Calculate:
1. The electric field $\vec{E} (\vec{r})$ for $r>0$.
2. The charge $Q(r)$ enclosed in a sphere of radius $r>0$ having the null-point as center.
3. The charge density $\rho (\vec{r})$ for $r>0$.

2. Relevant equations

1. Eletric field: $\vec{E} = -\nabla \phi$.
2. Gauss' law: $\frac{Q(r)}{\epsilon_0} = \oint_A \vec{E} \cdot d\vec{A}$.
3. Poisson's equation: $\Delta \phi = \frac{\rho (\vec{r})}{\epsilon_0}$ or something else?

3. The attempt at a solution

For 1) I simply calculated the partial derivatives for $x$, $y$, $z$ of $\phi(r)$ and got:

$\vec{E} (\vec{r}) = kqe^{-r/R} \bigg(\frac{1}{R r^2} + \frac{1}{r^3}\bigg) \vec{r}$

Not such a straight forward derivative, so hopefully that is correct.

2) I used Gauss' law like that:

$\frac{Q(r)}{\epsilon_0} = \oint_A \vec{E} d\vec{A} = \vec{E} \cdot \vec{A}$

because I assume that the electric field is perpendicular to any sphere centered on the null-point. Is that a correct assumption? Then follows:

$Q(r) = \epsilon_0 \vec{E} \cdot \hat{n} A = \epsilon_0 k q e^{-r/R} \bigg(\frac{1}{R r^2} + \frac{1}{r^3}\bigg) r \cdot 4\pi r^2$
$= q e^{-r/R} \bigg(\frac{r}{R} + 1\bigg)$

And now question 3 is a big problem to me... I tried with Poisson's equation, and after a monster derivative I arrived to:

$\Delta \phi = \nabla^2 \phi = - \nabla \vec{E} = \frac{\rho (\vec{r})}{\epsilon_0}$
$= kq e^{-r/R} \bigg(\frac{xr}{R^2} - \frac{x^2 + 2x}{R r^4} - \frac{3x^2}{r^5} + \frac{1}{r^3}\bigg)$ (for the $x$-component)

Now that was quite a derivative, and I don't have so much time during the exam... Could there be another way? Another problem I have is that when I add the components together and rearrange for $\rho$ I get:

$\rho (x,y,z) = k \epsilon_0 q e^{-r/R} \Bigg(\frac{r(x+y+z)}{R^2} - \frac{(x^2+y^2+z^2) + 2(x+y+z)}{R r^4} - \frac{3(x^2+y^2+z^2)}{r^5} + \frac{3}{r^3}\Bigg)$
$= k \epsilon_0 q e^{-r/R} \Bigg(\frac{r(x+y+z)}{R^2} - \frac{r^2 + 2(x+y+z)}{R r^4} - \frac{3r^2}{r^5} + \frac{3}{r^3}\Bigg)$
$= k \epsilon_0 q e^{-r/R} \Bigg(\frac{r(x+y+z)}{R^2} - \frac{1}{R r^2} - \frac{2(x+y+z)}{R r^4}\Bigg)$

I don't manage to get rid of the $x,y,z$ in order to write the charge density for $\vec{r}$... Any idea?

Any suggestion for how to solve such problems would be greatly appreciated. Thank you a lot in advance for your answers.

Julien.

2. Sep 29, 2016

### TSny

You will save a lot of time if you work in spherical coordinates rather than Cartesian. See http://isites.harvard.edu/fs/docs/icb.topic970148.files/Spherical_coord.pdf

Your result for (1) looks correct. Try getting that result using the formula for gradient in spherical coordinates.

Your result for (2) also looks correct.

For (3) use the formula for divergence in spherical coordinates. However, something interesting is going on at r = 0. You'll need to treat that case separately. (Edit: but I just noticed that you are not asked for ρ at r = 0.)

3. Sep 30, 2016

### rude man

For (3) you could also use the result you derived in (2) by realizing that ρ(r) = [Q(r + dr) - Q(r)] divided by the volume of a shell of thickness dr, thus avoiding the dreaded Poisson equation ... ... I presume that Q(r + dr) - Q(r) is suggestive somehow!

4. Oct 2, 2016

### JulienB

Hi @rude man and @TSny and thanks for your answers. Sorry I took so long to answer.

So something strange has happened. I've asked Mathematica to solve the Poisson equation with cartesian coordinates, and this came out:

$\rho (r) = k \cdot q \cdot \epsilon_0 \frac{e^{-r/R}}{R^2 r}$

which with $r = R$ gives

$\rho(R) = k \cdot q \cdot \epsilon_0 \frac{1}{R^3}$

When doing the same with spherical coordinates, I got:

$\rho(R) = 3 \cdot k \cdot \epsilon_0 \cdot q \frac{1}{R^3}$

which is the same as if I took the formula suggested by @rude man :

$\rho = Q/V = 3 \cdot k \cdot \epsilon_0 \cdot q \frac{1}{R^3}$

So two questions come directly to my mind after such results: somehow the result is different when I use cartesian coordinates or spherical coordinates (by a factor of 3). I am sure it is a calculation mistake (probably related to the components), but the student I am working with and myself have been searching for a couple of hours for the mistake and couldn't find it. Moreover, the result I wrote above comes from Mathematica! Any idea about what could have gone wrong?

The second one is that in such a problem, we are only given a potential. I would say that the general formulation of the equation given by @rude man is $\rho = dQ/dV$ which transforms to $\rho = Q/V$ only if the charge is homogeneously distributed. Obviously the formula works in this case, and we were wondering how can that be justified? This is an old exam problem, and we have around 20 mins to solve each problem. I can hardly see myself managing to differentiate the whole thing with cartesian and spherical coordinates, then check if this works with the other equation. And if I don't, maybe the result is wrong or incomplete without a justification. Any tip about how to tackle such problems real fast? :)

Julien.

5. Oct 2, 2016

### TSny

Mathematica's result for spherical coordinates looks correct.

I'm not sure what you mean when you say the formula works in this case.
In your problem $\rho$ is not uniform, it varies with r. So, $\rho = Q/V$ will only give an average value of $\rho$ in the volume $V$.

You just need to use the spherical coordinate expressions for the gradient and the divergence. See link in post #2. Since the potential $\phi$ depends only on the spherical coordinate $r$, these expressions simplify. You can get the answers without very much work.

6. Oct 2, 2016

### JulienB

Sorry, I think what I wrote was a bit confused. I meant: could I have used $\rho(\vec{r}) = q(\vec{r})/V(\vec{r})$ instead of the Poisson's equation? And I guess the answer is no, since the charge density is not uniform. So the Poisson's equation is the only way to go in the present case (I will have a look at what rude man suggested).

Julien.

7. Oct 2, 2016

### TSny

That's right.

Instead of setting up the Poisson equation, consider getting $\rho$ from $\vec{E}$.

8. Oct 2, 2016

### rude man

Julien, I believe you computed E(r) wrong. I got
E(r) =(2kq/rR)exp(-r/R) r
with r the unit vector.
(This is another example why checking dimensions is so important. Your expression for E is dimensionally incorrect.)
From there, compute Q(r) as you did using Gauss' law.
Finally, avoiding Poisson if you want to, use my previous hint.
If you post your results I would be happy to compare with mine.

Like tsny I strongly advise working with spherical rather than cartesian coordinates. Descartes was an s.o.b. anyway - he cut his live dog's stomach open to see if the dog's soul would emanate from it!

Last edited: Oct 2, 2016
9. Oct 2, 2016

### rude man

Try to follow my reasoning, which results in
ρ(r) = dQ(r) divided by the differential shell volume, so
ρ(r) = dQ(r)/4πr2dr = (1/4πr2) dQ/dr.
Since Q = Q(r) you can't just go ρ = Q/V.
See my post #8 also! You started with the wrong E.

BTW kε0 = 1/4π.

Last edited: Oct 2, 2016
10. Oct 2, 2016

### TSny

I get Julien's result for $\vec{E}$. Namely, $\vec{E} (\vec{r}) = kqe^{-r/R} \bigg(\frac{1}{R r^2} + \frac{1}{r^3}\bigg) \vec{r}$
Note that $\vec{r}$ at the end of his expression is the position vector with magnitude $r$, rather than a unit vector.

Your method for getting $\rho(r)$ from $Q(r)$ is nice.

11. Oct 2, 2016

### rude man

Yes, you're both right. I messed up doing dΦ/dr. Sorry Julien. (I won't apologize to tsny since he's used to my making mistakes by now ). Another senior moment. And his E is dimensionally correct since r is not the unit vector in his expression. Most embarrassing.

Last edited: Oct 3, 2016