# Math Help - gradient and potential

Hi ,
I need help about procedure on this problem:

Consider a sphere of charge density ρv= 2/r[C/m3] having a radius a (no charge outside), centered at the origin. Perform the following steps:
a) Calculate the electric field both inside and outside the sphere using Gauss’ law.
b) Calculate the potential inside and outside the sphere by integrating the electric field to get
the potential, assuming zero Volts at infinity.
c) Calculate the potential assuming that the reference is at the origin zero, V(0,0,0) =0
d) Find the electric field inside and outside the sphere by taking the gradient of the potential.
You should be able to verify that your answer is the same as the electric field that you started with from Gauss’s law.

I found the first question:
for r<a -> E=1/ε0

for r>a--> E=a^2/(ε0*r^2)

Now for the second question b)

for r>a :
V(r)-V(inf)=- ∫(a^2/(ε0*r^2)dr) [from infinity to r]=[a^2/(ε0*r)]+ (2a/(ε0))

for r<a:
V(r)-V(a)=- ∫(1/(ε0)dr) [from a to r]=-r/ε0

I did the same approach with the question (but not so sure about the method) c).

Now when I want to find that electric field with the gradient, I dont find the same answer of E I started with.

Perhaps my method is wrong.
At least one part to show me how we verify the electric field with the gradient [especially with V(r=0)=0].

Thank you

Hi ,
I need help about procedure on this problem:

Consider a sphere of charge density ρv= 2/r[C/m3] having a radius a (no charge outside), centered at the origin. Perform the following steps:
a) Calculate the electric field both inside and outside the sphere using Gauss’ law.
b) Calculate the potential inside and outside the sphere by integrating the electric field to get
the potential, assuming zero Volts at infinity.
c) Calculate the potential assuming that the reference is at the origin zero, V(0,0,0) =0
d) Find the electric field inside and outside the sphere by taking the gradient of the potential.
You should be able to verify that your answer is the same as the electric field that you started with from Gauss’s law.

I found the first question:
for r<a -> E=1/ε0

for r>a--> E=a^2/(ε0*r^2)
I haven't finished this, but for a start either your E(r < a) is wrong or there was a typo. I get
E(r < a) = r/(a*epsilon0)

-Dan

3. It was not a typo. I am gonna check my calculations...

4. I get the same answer.
I did:
4*pi*r'^2=∫∫∫((2/r'*r'^2*sin(theta)dr' d(theta) d(phi)
-->4*pi*r'^2=∫∫∫((2r'*sin(theta)dr' d(theta) d(phi)

with the limits:theta:0--->pi
phi-0--->2pi
r'--->0-r

How did you do it?

5. My bad, I did the enclosed charge calculation incorrectly. For reference:

We have a spherical charge distribution inside the sphere of the form (rho) = 2/r. For a sphere of radius a, this represents a total charge of
Q = Int[(2/r')r'^2*sin(theta') dr' d(theta') d(phi')] = 2*4(pi)*Int[r' dr'] (r' goes from 0 to a)

Q = (1/2)*8(pi)a^2 = 4(pi)a^2

Imagine now a spherical Gaussian surface, centered on the center of the sphere with r < a. The charge enclosed by this sphere is:
Q(enc) = Int[(2/r')r'^2*sin(theta') dr' d(theta') d(phi')] (r' goes from 0 to r)

Q(enc) = 4(pi)r^2

Thus:
Int[E (dot) dA] = Q(enc)/epsilon0

E will always be perpendicular to the surface, so E is always parallel to dA:
EA = 4(pi)r^2/epsilon0

E*4(pi)r^2 = 4(pi)r^2/epsilon0

E = 1/epsilon0

-Dan

b) Calculate the potential inside and outside the sphere by integrating the electric field to get
the potential, assuming zero Volts at infinity.
Now for the second question b)

for r>a :
V(r)-V(inf)=- ∫(a^2/(ε0*r^2)dr) [from infinity to r]=[a^2/(ε0*r)]+ (2a/(ε0))

for r<a:
V(r)-V(a)=- ∫(1/(ε0)dr) [from a to r]=-r/ε0
Where did you get your second term for the r > a calculation? The integral is correct, but you apparently took limits from a to r instead of infinity to r as you said you were.

So V(r > a) = a^2/(r*epsilon0)

For r < a we need to integrate E(r > a) from infinity to a, then add the integration of E(r < a) from a to r:
V(r < a) = (2a/epsilon0) + (-a/epsilon0 + r/epsilon0) = (r + a)/epsilon0

-Dan

c) Calculate the potential assuming that the reference is at the origin zero, V(0,0,0) =0
This time we can integrate outward, so for r < a:
V(r < a) - V(0) = -Int[E(r' < a), dr', 0, r] = -r/epsilon0

For r > a we need to integrate E(r < a) from 0 to a and then add the integral of E(r > a) from a to r:
V(r) - V(0) = (-a/epsilon0) + (-a/epsilon0 + a^2/(r*epsilon0))

V(r > a) = -2a/epsilon0 + a^2/(r*epsilon0)

-Dan