# Electric Potential by Integrating Poisson's Equation

sportfreak801

## Homework Statement

A spherical distribution of charge is characterized by a constant charge density $$\rho$$ for r<= R. For radii greater than R, the charge density is zero. Find the potential $$\varphi$$ (r) by integrating Poisson's equation.

## Homework Equations

$$\nabla^2(\varphi)=-\frac{\rho}{\epsilon_{0}}$$

## The Attempt at a Solution

I tried taking the triple integral of poison's equation using spherical coordinates to find the potential, u, and found

$$\int_V\nabla^2(\varphi) r^2 \sin(\theta) dr d\theta d\phi$$

$$\int\int\int_{0}^{\pi}\nabla^2(\varphi) r^2 \sin(\theta) d\phi dr d\theta$$

Plugging in the known value for $$\nabla^2(\varphi)$$ the equation becomes

$$\int\int\int_{0}^{\pi}-\frac{\rho}{\epsilon_{0}} r^2 \sin(\theta) d\phi dr d\theta$$

The integral from 0 to $$\pi$$ of d$$\phi$$ equals $$\pi$$. And since $$\rho$$ is constant throughout the sphere, the equation becomes:

$$\frac{-\pi*\rho}{\epsilon_0}\int_{r}^{R}\int_{0}^{\pi} r^2 \sin(\theta) d\theta dr$$

The integral with respect to d$$\theta$$ is 2. The equation now becomes:

$$\frac{-2*\pi*\rho}{\epsilon_0}\int_{r}^{R} r^2 dr$$

Evaluating the integral with respect to dr yields

$$\frac{-2*\pi*\rho}{\epsilon_0}(\frac{R^3}{3} - \frac{r^3}{3})$$

Thus, I find the answer to be

$$\varphi = \frac{-2*\pi*\rho}{3*\epsilon_0}(R^3 - r^3)$$

I don't think this is correct because the electric potential is a function of 1/r and not r^3.
Any help or clarification would be greatly appreciated. Thanks in advance!

Last edited:

sportfreak801
After going through the problem again, I believe I found an answer just not the one I was looking for:

I tried taking the triple integral of the laplacian instead of just taking the double integral with respect to dr dr.

$$\int\int\nabla^2(\varphi) dr dr$$

$$\int\int\frac{\rho}{\epsilon_0} dr dr$$

$$\frac{\rho}{\epsilon_0}\int\int dr dr$$

$$\frac{\rho}{\epsilon_0}(\frac{r^2}{2})$$
for r from 0 to R

$$\varphi(r) = \frac{\rho*R^2}{2*\epsilon_0}$$

Homework Helper
Gold Member
After going through the problem again, I believe I found an answer just not the one I was looking for:

I tried taking the triple integral of the laplacian instead of just taking the double integral with respect to dr dr.

$$\int\int\nabla^2(\varphi) dr dr$$

$$\int\int\frac{\rho}{\epsilon_0} dr dr$$

$$\frac{\rho}{\epsilon_0}\int\int dr dr$$

$$\frac{\rho}{\epsilon_0}(\frac{r^2}{2})$$
for r from 0 to R

$$\varphi(r) = \frac{\rho*R^2}{2*\epsilon_0}$$

No, stop guessing. There is no rule in vector calculus that tells you $\int\int\nabla^2\varphi drdr=\varphi$, nor is there any rule that tells you $\int\int\int\nabla^2\varphi r^2\sin\theta dr d\theta d\phi=\varphi$

Use what you actually know about the Laplacian...What is the Laplacian of $\varphi(r,\theta,\phi)$ in spherical coordinates? What happens to that differential equation if $\varphi$ has no angular dependence? Can you think of a symmetry argument for why $\varphi$ only depends on $r$ for this problem?

sportfreak801
The Laplacian of $$\varphi(r,\theta,\phi) [/itex] is [tex] \frac{1}{r^2}\frac{d}{d\theta}(r^2\frac{d\varphi}{dr})+\frac{1}{r^2\sin(\theta)}\frac{d}{d\theta}(sin(\theta)\frac{d\varphi}{d\theta})+\frac{1}{r^2\sin^2(\theta)}\frac{d^2\varphi}{d\phi^2} [/itex] And by spherical symmetry we know that $\varphi(r,\theta,\phi)$ has no angular dependence. Thus the Laplacian of $\varphi(r,\theta,\phi)$ equals [tex] \frac{1}{r^2}\frac{d}{dr}(r^2\frac{d\varphi}{dr})$$

Which becomes

$$\frac{-\rho}{\epsilon_0} = \frac{1}{r^2}\frac{d^2\varphi}{dr^2}+\frac{2}{r}\frac{d\varphi}{dr}$$

Let $\varphi'$ = $\frac{d\varphi}{dr}$

$$\frac{-\rho}{\epsilon_0} = \frac{1}{r^2}\varphi'' + \frac{2}{r}\varphi'$$

Then I just solve the second order differential equation for $\varphi$?

Homework Helper
Gold Member
Yup, but it is easiest to solve if you write it in the form

$$\frac{1}{r^2}\frac{d}{dr}(r^2\frac{d\varphi}{dr})=-\frac{\rho}{\epsilon_0}$$

What do you get if you multiply both sides of the equation by $r^2$ and then (indefinite integral) integrate over $r$?

sportfreak801
$$\int\frac{d}{dr}(r^2\frac{d\varphi}{dr})=-\frac{\rho}{\epsilon_0}r^2$$

By the chain rule:

$$\varphi(r^2\frac{d^2\varphi}{dr^2} + 2r\frac{d\varphi}{dr}) = -\frac{\rho}{\epsilon_0}r^2$$

Homework Helper
Gold Member
Don't bother using the chain rule, the fundamental theorem of calculus tells you that $\int\left(\frac{d}{dr}f(r)\right)dr=f(r)+\text{constant}$, just use that to evaluate the integral on the LHS.

As for the RHS, if to integrate one side of an equation with respect to [irex]r[/itex], you must also integrate the other side.

sportfreak801
$\int\left(\frac{d}{dr}f(r)\right)dr=f(r)+\text{con stant}$

So $f(r) = r^2\frac{d\varphi}{dr}$

$$\int(\frac{d}{dr}(r^2\frac{d\varphi}{dr}))dr =-\int(\frac{\rho}{\epsilon_0}r^2)dr$$

$$r^2\frac{d\varphi}{dr} + C = -\frac{\rho}{3*\epsilon_0}(r + C)$$

Dividing by $r^2$ yields

$$\frac{d\varphi}{dr} = -\frac{\rho}{\epsilon_0}(\frac{r}{3} + C)$$

then taking the integral of both sides with respect to dr

$$\int\frac{d\varphi}{dr} = -\int(\frac{\rho}{3*\epsilon_0}({r} + C)) dr$$

$$\varphi = -\frac{\rho}{3*\epsilon_0}(\frac{r^2}{2} + Cr)$$

Homework Helper
Gold Member
$\int\left(\frac{d}{dr}f(r)\right)dr=f(r)+\text{con stant}$

So $f(r) = r^2\frac{d\varphi}{dr}$

$$\int(\frac{d}{dr}(r^2\frac{d\varphi}{dr}))dr =-\int(\frac{\rho}{\epsilon_0}r^2)dr$$

Good $$r^2\frac{d\varphi}{dr} + C = -\frac{\rho}{3*\epsilon_0}(r + C)$$

I assume this is a typo and you meant $r^2\frac{d\varphi}{dr} + C_1 = -\frac{\rho}{3*\epsilon_0}r^3+C_2 [/tex] If so, you can combine [itex]C_2$ and $C_1$ into a single constant by defining $C\equiv C_2-C_1$ and you get

$$r^2\frac{d\varphi}{dr} = -\frac{\rho}{3*\epsilon_0}r^3+C$$

Dividing by $r^2$ yields

$$\frac{d\varphi}{dr} = -\frac{\rho}{\epsilon_0}(\frac{r}{3} + C)$$

No, it doesn't. It yields

$$\frac{d\varphi}{dr} = -\frac{\rho}{\epsilon_0}\frac{r}{3} + \frac{C}{r^2}$$

sportfreak801
$$\frac{d\varphi}{dr} = -\frac{\rho}{\epsilon_0}\frac{r}{3} + \frac{C}{r^2}$$

Then I integrate both sides with respect to r

$$\int\frac{d\varphi}{dr} = \int(-\frac{\rho}{\epsilon_0}\frac{r}{3} + \frac{C}{r^2})dr$$

$$\varphi = -\frac{\rho}{\epsilon_0}\int\frac{r}{3}dr + C\int\frac{1}{r^2}dr$$

$$\varphi = -\frac{\rho}{\epsilon_0}\frac{r^2}{6} + D_1 -\frac{C}{r} +D_2$$

$D = D_1 + D_2$

$$\varphi = -\frac{\rho}{\epsilon_0}\frac{r^2}{6} -\frac{C}{r} + D$$

Homework Helper
Gold Member
$$\varphi = -\frac{\rho}{\epsilon_0}\frac{r^2}{6} -\frac{C}{r} + D$$

Okay, that gives you the general form of the potential inside the spere of radius $R$...what about outside the sphere where the charge density is zero? What does your differential equation become there?

sportfreak801
$\rho = 0$ outside of the sphere, so the differential equation becomes

$$\varphi = -\frac{C}{r} + D$$

Homework Helper
Gold Member
$\rho = 0$ outside of the sphere, so the differential equation becomes

$$\varphi = -\frac{C}{r} + D$$

No, your differential equation becomes $\nabla^2\varphi=0$...try solving it the same way you did before. You will not end up with $\varphi = -\frac{C}{r} + D$.

sportfreak801
$$0 = \frac{1}{r^2}\frac{d}{dr}(r^2 \frac{d\varphi}{dr})$$

$$\int0dr=\int(\frac{1}{r^2}\frac{d}{dr}(r^2\frac{d\varphi}{dr})dr$$

$$C = r^2\frac{d\varphi}{dr}$$

$$\frac{C}{r^2} = \frac{d\varphi}{dr}$$

$$\int(\frac{C}{r^2})dr = \int\frac{d\varphi}{dr}$$

$$-\frac{C}{r} + D = \varphi(r)$$

As a side note, I am supposed to check my solution for the potential derived from Poisson's equation using:

$$\varphi(r) = \frac{1}{4\pi\epsilon_0}\int\frac{dq'}{|r - r'|}$$

Last edited:
Homework Helper
Gold Member
Oops, I guess you do get $-\frac{C}{r} + D = \varphi(r)$ after all Anyways, you probably should call your constants something other than $C$ and $D$ since there is no reason to assume that they have the same value as the constants you have in your expression for the potential inside the sphere. That leaves you with something like

$$\varphi(r)=\left\{\begin{array}{lr}-\frac{\rho}{\epsilon_0}\frac{r^2}{6} -\frac{C}{r} + D ,& r\leq R \\ -\frac{\alpha}{r} + \beta ,& r\geq R \end{array}\right.$$

Now, you have 4 unknown constants to determine...You can determine on of them by choosing your reference point to be at infinity (i.e. choose $\varphi(r\to\infty)=0$)...how about the rest of the constants? Does $\varphi(r)$ have to be continuous evryhwre? How about finite? How about smooth? Why or why not?

sportfreak801
So if we choose $\varphi(r\to\infty)=0$ then we know that $\beta = 0$.

Also, we know that the potential is continuous everywhere, so at r = R

$$-\frac{\rho}{\epsilon_0}\frac{R^2}{6} -\frac{C}{R} + D = -\frac{\alpha}{R}$$

Multiply both sides by -R and we find
$$\frac{\rho}{\epsilon_0}\frac{R^3}{6} +C - DR = \alpha$$

Taking the first derivative with respect to r

$$0 - D = 0$$

$$0 = D$$

$$\frac{\rho}{\epsilon_0}\frac{R^3}{6} +C - 0 = \alpha$$

$$\frac{\rho}{\epsilon_0}\frac{R^3}{6} +C = \alpha$$

Homework Helper
Gold Member
So if we choose $\varphi(r\to\infty)=0$ then we know that $\beta = 0$.

Good.
Also, we know that the potential is continuous everywhere, so at r = R

$$-\frac{\rho}{\epsilon_0}\frac{R^2}{6} -\frac{C}{R} + D = -\frac{\alpha}{R}$$

Multiply both sides by -R and we find
$$\frac{\rho}{\epsilon_0}\frac{R^3}{6} +C - DR = \alpha$$

Good. (But do you know why the potential is continuous everywhere?)

Taking the first derivative with respect to r

$$0 - D = 0$$
$$0 = D$$

I have no idea what you are doing here. Care to explain?

sportfreak801
I know that the potential is continuous because if it were discontinuous at a point then the electric field would be infinite at that point and would require an infinite amount of energy. Regarding the second part, I was attempting to differentiate the equation with respect to r; however, I switched halfway through the equation from treating R as a constant to treating R as a variable.

Homework Helper
Gold Member
I know that the potential is continuous because if it were discontinuous at a point then the electric field would be infinite at that point and would require an infinite amount of energy.

Right. Regarding the second part, I was attempting to differentiate the equation with respect to r; however, I switched halfway through the equation from treating R as a constant to treating R as a variable.

Okay, I see. But why are you trying to differentiate it at all? $R$ is a constant, not a variable.

You still need two more equations to determine the remaining two constants. Consider whether or not the potential should be finite everywhere, and whether or not there will be any discontinuities in the electric field $\textbf{E}=-\mathbf{\nabla}\varphi$.

sportfreak801
The Electric field $\textbf{E}=-\mathbf{\nabla}\varphi$ is discontinuous when the electric field passes through the charged surface of the sphere.

Homework Helper
Gold Member
The Electric field $\textbf{E}=-\mathbf{\nabla}\varphi$ is discontinuous when the electric field passes through the charged surface of the sphere.

Sure, the volume charge density switches from zero to $\rho$ when you cross the surface, but does that really mean that there is a non-zero surface charge density? The electric field is only discontinuous when it crosses a surface charge density. There is a subtle distinction between a surface with a non-zero surface charge density and a surface that bounds two different volume charge densities.

sportfreak801
So then the Electric Field is continuous everywhere. Also, the electric potential is finite everywhere.

$\textbf{E}=-\mathbf{\nabla}\varphi$

So I take the $-\mathbf{\nabla}\varphi$ in spherical coordinates knowing that the Electric field is independent of $\theta$ and $\phi$.

Homework Helper
Gold Member
Also, the electric potential is finite everywhere.

Right, the only place that the potential is allowed to be infinite/undefined is at the location of a point charge.

So, what must $C$ be for $\varphi$ to be finite at the origin?

So then the Electric Field is continuous everywhere.

$\textbf{E}=-\mathbf{\nabla}\varphi$

So I take the $-\mathbf{\nabla}\varphi$ in spherical coordinates knowing that the Electric field is independent of $\theta$ and $\phi$.

Right, so the gradient of the potential must be continuous everywhere, including at $r=R$

sportfreak801
$C = 0$

So if the gradient of the potential must be continuous everywhere then

$$-\mathbf{\nabla}((-\frac{\rho}{\epsilon_0}\frac{R^2}{6}) + D)= -\mathbf{\nabla}(-\frac{\alpha}{R})$$

Homework Helper
Gold Member
$C = 0$

Right.

So if the gradient of the potential must be continuous everywhere then

$$-\mathbf{\nabla}((-\frac{\rho}{\epsilon_0}\frac{R^2}{6}) + D)= -\mathbf{\nabla}(-\frac{\alpha}{R})$$

Not quite. To calculate the gradient of a function at some point, you first take the gradient and then substitute in the point.

$$-\left.\left[\mathbf{\nabla}((-\frac{\rho}{\epsilon_0}\frac{r^2}{6}) + D)\right]\right|_{r=R}= \left.\left[-\mathbf{\nabla}(-\frac{\alpha}{r})\right]\right|_{r=R}$$

sportfreak801
$$-\mathbf{\nabla}((-\frac{\rho}{\epsilon_0}\frac{r^2}{6}) + D)= -\mathbf{\nabla}(-\frac{\alpha}{r})$$

$$-\frac{d}{dr}((-\frac{\rho}{\epsilon_0}\frac{r^2}{6}) + D)= -\frac{d}{dr}(-\frac{\alpha}{r})$$

$$\frac{\rho}{\epsilon_0}\frac{r}{3} = -\frac{\alpha}{r^2}$$

$$-\frac{\rho r^3}{3\epsilon_0} = \alpha$$

Then I find that (at r = R)

$$-\frac{\rho r^2}{6\epsilon_0} + D = -\frac{\alpha}{r}$$

$$-\frac{\rho r^2}{6\epsilon_0} + D = -\frac{\rho r^3}{3r\epsilon_0}$$

$$-\frac{\rho r^2}{6\epsilon_0} + D = -\frac{\rho r^2}{3\epsilon_0}$$

$$D = -\frac{\rho r^2}{3\epsilon_0} + \frac{\rho r^2}{6\epsilon_0}$$

$$D = -\frac{\rho r^2}{6\epsilon_0}$$

Last edited:
Homework Helper
Gold Member
$$-\mathbf{\nabla}((-\frac{\rho}{\epsilon_0}\frac{r^2}{6}) + D)= -\mathbf{\nabla}(-\frac{\alpha}{r})$$

$$-\frac{d}{dr}((-\frac{\rho}{\epsilon_0}\frac{r^2}{6}) + D)= -\frac{d}{dr}(-\frac{\alpha}{r})$$

$$\frac{\rho}{\epsilon_0}\frac{r}{3} = -\frac{\alpha}{r^2}$$

Weren't you supposed to substitute $r=R$ in there at some point?

$$-\frac{\rho r^3}{3\epsilon_0} = \alpha$$

Then I find that (at r = R)

$$-\frac{\rho r^2}{6\epsilon_0} + D = -\frac{\alpha}{r}$$

$$-\frac{\rho r^2}{6\epsilon_0} + D = -\frac{\rho r^3}{3r\epsilon_0}$$

$$-\frac{\rho r^2}{6\epsilon_0} + D = -\frac{\rho r^2}{3\epsilon_0}$$

$$D = -\frac{\rho r^2}{3\epsilon_0} + \frac{\rho r^2}{6\epsilon_0}$$

$$D = -\frac{\rho r^2}{6\epsilon_0}$$

Again, I see $r$'s but no $R$'s...

sportfreak801
My mistake, I forgot to substitute r = R... So it should read

$$\frac{\rho}{\epsilon_0}\frac{R}{3} = -\frac{\alpha}{R^2}$$

$$-\frac{\rho R^3}{3\epsilon_0} = \alpha$$

$$-\frac{\rho R^2}{6\epsilon_0} + D = -\frac{\alpha}{R}$$

$$-\frac{\rho R^2}{6\epsilon_0} + D = \frac{\rho R^2}{3\epsilon_0}$$

$$-\frac{\rho R^2}{6\epsilon_0} + D = \frac{\rho R^2}{3\epsilon_0}$$

$$D = \frac{\rho R^2}{3\epsilon_0} + \frac{\rho R^2}{6\epsilon_0}$$

$$D = \frac{\rho R^2}{2\epsilon_0}$$

Which would give for the $\varphi(r)$ for r <= R

$$\varphi(r) = -\frac{\rho r^2}{6\epsilon_0} + D$$

$$\varphi(r) = -\frac{\rho r^2}{6\epsilon_0} + \frac{\rho R^2}{2\epsilon_0}$$

Last edited:
sportfreak801
Now, I am supposed to derive the same answer using

$$\varphi(r) = \frac{1}{4\pi\epsilon_0}\int\frac{dq}{|r - r'|}$$

I know that $q = \rho V$ and $dq = \rho dV$

And that $V = \frac{4}{3}\pi r^3$

However, I know that $dV = 4\pi r^2 dr$ is not true because if it were then I would get

$$\varphi(r) = \frac{1}{4\pi\epsilon_0}\int\frac{4\pi\rho\r^2dr}{r}$$

$$\varphi(r) = \frac{\rho}{\epsilon_0}\int\r dr$$

$$\varphi(r) = \frac{\rho}{\epsilon_0}\int_r ^R r dr$$

$$\varphi(r) = \frac{\rho}{\epsilon_0}(\frac{r^2}{2}) \_r ^R$$

$$\varphi(r) = \frac{\rho}{\epsilon_0}(\frac{R^2}{2} -\frac{r^2}{2})$$

$$\varphi(r) = \frac{\rho}{\epsilon_0}(\frac{R^2}{2} -\frac{r^2}{2})$$

$$\varphi(r) = \frac{\rho}{2\epsilon_0}(R^2 - r^2)$$

Last edited:
Homework Helper
Gold Member
Now, I am supposed to derive the same answer using

$$\varphi(r) = \frac{1}{4\pi\epsilon_0}\int\frac{dq}{|r - r'|}$$

Ermmm... you mean

$$\varphi(r) = \frac{1}{4\pi\epsilon_0}\int\frac{dq'}{|\textbf{r} - \textbf{r}'|}$$

Right?

I know that $q = \rho V$ and $dq = \rho dV$

Right, so $dq'=\rho dV'$...

And that $V = \frac{4}{3}\pi r^3$

No, the volume of a sphere of radius $R$ is $V=\frac{4}{3}\pi R^3$, which is a constant. You don't just take the derivative of the volume of some random object to find out what the volume element is in whatever coordinate system you are using.

However, I know that $dV = 4\pi r^2 dr$ is not true because if it were then I would get

$$\varphi(r) = \frac{1}{4\pi\epsilon_0}\int\frac{4\pi\rho\r^2dr}{r}$$

You are correct about it being not true, but you are incorrect as to the why. I suggest you start by looking up "volume element in spherical coordinates", either online or in any of your texts that deal with vector or multi-variable calculus.

And, how did $|\textbf{r}-\textbf{r}'|$ become just plain old $r$ in this expression?

appsci
Hi
I need some help with understanding like i have this poisson's equation from which i have to determine the potential by integrating ofcourse using the boundary condition phi=0 at x=plus or minus L/2 and that differentiation of phi with x is zero at x=0.

I see that they have arrived at the equation
phi= 1/2 rho/epsilon* (square of L/2 - square of x)

I don't know how they got this.

Note: How can I type physics symbols here?

Thanks

Homework Helper
Gold Member
Hi
I need some help with understanding like i have this poisson's equation from which i have to determine the potential by integrating ofcourse using the boundary condition phi=0 at x=plus or minus L/2 and that differentiation of phi with x is zero at x=0.

I see that they have arrived at the equation
phi= 1/2 rho/epsilon* (square of L/2 - square of x)

I don't know how they got this.

Note: How can I type physics symbols here?

Thanks

appsci
There is an introduction to using $\LaTeX$ in these forums in this thread