Potential and E-Field of a Uniform Sphere of Charge using Laplace’s and Poisson’s Equations

(I know,....the problem is trivial with Gauss’s Law and Integration from Infinity)

PROBLEM

 A sphere of radius R has a uniform charge density ρ and total charge Q.   We seek the potential and E-Field inside and outside of the sphere and wish to use Laplace’s and Poisson’s Equation (for the shear joy of it).

(a)   Taking advantage of the symmetry of this problem, choose an appropriate coordinate system and write down the appropriate form of Laplace’s OR Poisson’s Equation for finding the potential outside of the sphere.

<First enter answer here in this text cell>

We can view the full Laplacian in spherical coordinates by executing this statement:

(*Execute code below*)
Laplacian[f[r,θ,ϕ],{r,θ,ϕ},"Spherical"]//Expand

NOTATION:  Derivative[0,0,2][f][r,θ,ϕ]  in M signifies the 2nd derivative of f with respect to ϕ.  

Thus, the first three terms are derivatives with respect to the Second and Third Variables (θ and ϕ).  The last two terms are derivatives wrt r (the First Variable).  

For f a function of r only, these first 3 terms would yield zero.  Replacing f[r] with Vout[r], we therefore can write Laplace’s Equation for our problem as:

 (2/r)Vout'[r] + Vout''[r] == 0.      (holds for r > R)

(b)  Using DSolve, find a ‘general’ solution for Vout[r]  (before introducing boundary conditions).

(*Input code below*)
ClearAll["`*"]  (*Leave the ClearAll["`*"] statement; discards previously defined variables, etc. *)

As expected (for a second order DE), we get two constants of integration, C[1] and C[2].

(c)  To determine the arbitrary constants C[1] and C[2], we need to employ the boundary conditions.

First consider BC1:  We take our V = 0 point to correspond to the limit r → ∞.  

Using BC1 Determine one of the two constants

<Input derivation in this text cell>

(d)  Defining a second BC2:   You should recognize that the remaining term in Vout[r] ∝ (1/r) which is the potential of a point charge.  From earlier work we have shown that a uniformly charged sphere has the potential of a point charge Q where Q is the total charge contained in the sphere. 

Here is the tap dance:  Using V[r] = k (∫_(τ'))ρ(r')(1/(|r - r'|))dτ' we showed that the potential OUTSIDE the sphere due to a spherical shell of charge q is equal to the potential due to a point charge at the center of the sphere.  The filled sphere (constant ρ), by superposition of shells gives a Vout equal to Vout[r] = ((k Q)/r).  

So:  equating our “general solution” to ((k Q)/r), we can find the remaining C[1].  With lightning speed, do so and execute your final definition of Vout[r] to get it defined.   This whole mini-exercise gives us BC2:

<Input derivation in this text cell>

(*Assuming you use M for the math, input your code below*)

(* Define your final potential function below. I call it VVout[r_]. *)
(* M wants the assignments for these C's to be done using a Rule  (via the -> operator)  *)

(*Execute your potential function again below to be absolutely sure it is what you expect*)

(e)  Now consider inside the sphere (r < R).  For V, we want to use Poisson’s Equation because ρ ≠ 0.  Exploiting the symmetry of the problem, derive the appropriate DE and solve it with DSolve.

<Describe your plan in this text cell>

(*Input code below*)

Again, as expected (for a second order DE), we get two constants of integration, C[1] and C[2].

(f)  To determine the arbitrary constants C[1] and C[2], we need to employ the boundary conditions.

For BC1:  we require that V NOT blow up at r = 0;   So what is C[1]?

For BC2:  we require Vin[R] = Vout[R]   (the continuity of V at an interface with no charge)  Use this to find C[2].

(*Input code to set C[1] to the correct value in Vin[]*)

(*Input code neccesary to solve for C[2].  Set C[2] in Vin[] to this value*)

(g) Now plot Vin and Vout in the same graph (suggest you use Show[]).  You will have to assign values to R, k, ρ, and ϵo.

(*Input code below*)
Clear[R, k, ρ, ϵo]  (*Leave Clear[]statement*)

Note:  Although we forced it to happen, it’s important to note that V is continuous at r = R (the vertical line).

(h) Remembering that for a V that is dependent on r only, the only nonzero component of the resulting E field is the radial component.  

Use M’s Grad operator (in spherical coordinates) to generate the E field both inside and outside the sphere.  Plot the magnitude of EEradial versus r.

Remember that for a V dependent on r only, the resulting E field will only have a radial component (derivatives wrt θ and ϕ will be zero and insure that only the r component remains).

(* Input code below *)
Clear[R, k, ρ, ϵo] (* Leave the Clear[] statement *)

As expected, (OverVector[E]) = EE[r] (OverHat[r]), both inside and outside the sphere.

Notice that because there is no surface charge at r = R, (σ[r=R] = 0), EE[r] is continuous at r = R:  EE[r] = (Subscript[EE, ⊥])[r], where   (Subscript[EE, ⊥])[r] is the normal component of the field at the interface.

Finally, if you compare these results of using Laplace’s and Poisson’s equation for this simple charge distribution, we get the same potentials and E-fields that we would get by employing Gauss’s Law (for (OverVector[E])) and the integral:  V[r] = – (∫_∞^r) (OverVector[E])[(OverVector[r])]·d(OverVector[r]), where we take V → 0 as r → ∞.