Electric Field and Potential for an infinite slab with uniform charge density ρ

PROBLEM:  Consider an infinite slab parallel to  the x-z plane  (normal to the y axis) of uniform charge density ρ and thickness 2a, as shown:


Find the Electric Field and Potential everywhere.

(a)  First, present your arguments for treating this problem as one dimensional.

<This is a text cell - enter your answer here.>

The infinite slab can be thought of a set of parallel infinite sheets of uniform surface charge density σ ( = ρ dy where dy is the ‘thickness of the charge sheet).  The field for such a charge sheet is independent of x and z and normal to the charge sheet, therefore normal to the x-z plane (for σ>0, E points away from the plane of charge).  

Superposition will lead to an E Field that will also be independent of x & z and normal to the x-z plane.   Thus, a one D problem (y dependent).

We wish to derive the E field, (OverVector[E])(y), at all values of y.

(b) Start with E outside the slab.

<This is a text cell - enter your answer here.>

Suggest using Gauss’s law.  

First we find the field OUTSIDE using a pillbox wider than 2a and both ends of area A placed OUTSIDE of the charge slab.

(Subscript[(OverVector[E]), outside]) will be in the ±y direction and therefore normal to the ends S1 and S2 (i.e., in the ±(OverHat[y]) direction).  Let A be the area of both S1 and S2.
 
Gauss's Law,  (∫_S)(OverVector[E]).d(OverVector[S]) = (∫_S1)(OverVector[E1]).d(OverVector[S])1  + (∫_S2)(OverVector[E2]).d(OverVector[S])2      =  (1/(ϵo)) (Charge Contained inside S)

The charge contained in the pillbox = ρ A (2a).

All the E’s are || to the dS’s;  For a given y, the E’s are constant.
 
 (Subscript[E, outside]) A + (Subscript[E, outside]) A  =  (1/(Subscript[ϵ, o]))  ρ A (2a)  or
On the Right:	 (Subscript[(OverVector[E]), outpos]) = (1/(Subscript[ϵ, o]))  ρ a (OverHat[y])      
	         and      
On the Left: 	 (Subscript[(OverVector[E]), outneg]) = - (1/(Subscript[ϵ, o]))  ρ a (OverHat[y])

(c) Now find E inside the slab.

<This is a text cell - enter your answer here.>

Now inside the slab (-a ≤ y ≤  a).  We redraw S to have one end of the pillbox inside the charged region located at y = yprime.  I label the end of the pillbox inside S2 (on the right). (OverVector[E1]) at S1 =  (Subscript[(OverVector[E]), outneg]) = - (1/(Subscript[ϵ, o]))  ρ a (OverHat[y])  on the left.

Gauss's Law,  (∫_S)(OverVector[E]).d(OverVector[S]) = (∫_S1)(OverVector[E1]).d(OverVector[S1]) + (∫_S2)(OverVector[E2]).d(OverVector[S2])      =  (1/(ϵo)) (Charge Contained inside S)
E1 A + (Subscript[E, inside])[y]   A =  (1/(ϵo)) (Charge Contained inside S)
 (1/(Subscript[ϵ, o]))  ρ a A + (Subscript[E, inside])[y]   A =  (1/(ϵo)) (  ρ (a + y) A )      Note:  SIGN of y critical here in determining (Subscript[Q, enclosed])
  (Subscript[E, inside])[y]   = (1/(ϵo)) (  ρ (a + y) A )  -   (1/(Subscript[ϵ, o]))  ρ a A  
            (Subscript[(OverVector[E]), inside])[y]   = ((ρ  y)/(Subscript[ϵ, o])) (OverHat[y])     Note: the sign of y is critical in determining the direction of (Subscript[(OverVector[E]), inside])[y]

(d) Plot the magnitude of EE[y] for both inside and outside the slab.

(* Input Cell - Enter your code here -- start with a ClearAll["`*"]   *)
ClearAll["`*"]
Einside[y_] =(( rho y)/epsilonzero);  (*  NOTE x takes care of the SIGN)  *)
Eoutneg[y_] =-(( rho a)/epsilonzero);
Eoutpos[y_] = (( rho a)/epsilonzero);
rho = 1; epsilonzero = 1; a = 2;
EE[y_] = If[y<-a, Eoutneg[y],If[-a ≤ y ≤ a, Einside[y],If[y> a,Eoutpos[y]]]];
EEplot = Plot[EE[y],{y,-2 a ,2 a},AxesLabel->{"y","EE(y component)[y]"},PlotLabel->Style[Framed["y component of the E-Field vs. y"],16,Red,Background->Lighter[Yellow]]];
lineleft = Graphics[{Thick, Dashed, Blue,Line[{{-a,-2 a -.5},{-a,2 a +.5}}]}];
lineright = Graphics[{Thick, Dashed, Blue,Line[{{a,-2 a -.5},{a,2 a +.5}}]}];
Show[EEplot, lineleft ,lineright]

(e) Comment on this plot

<This is a text cell - enter your answer here.>

First, the blue vertical lines are the edges of the slab of charge.  Note to the left of the origin, E[y] is < 0, meaning that the vector E[y] points to the left.  To the right of the origin, E[y] is > 0, meaning that the vector (OverVector[E])[y] points to the right.  We assumed for this plot that rho = ρ = +1 (positive charge).  So outside the slab (OverVector[E]) should point away from the slab which it does.  INSIDE: think of the slab as a bunch of identical, parallel sheets of positive charge.  If you are at a point to the left of the origin (say y = -1), you would have more sheets of + charge on the right than on the left.  Therefore the superposition of the fields from these sheets would lead to a field pointing left.  The linear behavior of |(OverVector[E])| is reasonable in terms of the Number of sheets on the left vs. on the right.

Not that E[y] is continuous at the edges of the slab.  There is a boundary condition on (OverVector[E]) at an interface (let’s use “left” and “right” for position, assuming an interface, such as ours, parallel to the x-z plane).

						(Subscript[E, normal-left]) - (Subscript[E, normal-right]) = (σ/(ϵo)) 
For a continuous slab of charge, the surface is considered free of charge (because ρ changes abruptly from 0 to ρ with y) so we take σ = 0.  Thus, (Subscript[E, normal-left]^interface) = (Subscript[E, normal-right]^interface), which is what is observed in the graph at both interfaces (at y = ± a).

(f) Now generate a 2D Vector Plot of the E-Field both inside and outside of the slab of charge (assume a positive ρ).

(* Input Cell - Enter your code here *)
vecplot = VectorPlot[{EE[y],0},{y,-2 a ,2 a},{z,-2a,2a},FrameLabel->{"y","z"},PlotLabel->Style[Framed["Vector Plot of the E-Field in the y-z Plane"],16,Yellow,Background->Lighter[Blue]]];
Show[vecplot, lineleft, lineright]

(g) Comment on this vector plot

<This is a text cell - enter your answer here.>

Again, the blue vertical lines are the edges of the slab of charge.  Again, we assumed for this plot that rho = ρ = +1 (positive charge).  We see that the direction of the E vectors are consistent with the amount of + charge on the left side of a given point (y value) chosen vs. the amount of + charge on the right side of that point.  E = 0 at y = 0 because the two amounts of charge balance.  [Of course, we cannot forget that the slab extends to ∞ in both the x and z directions].

So E grows in magnitude (linearly with y) from zero at y = 0 to a maximum at y = ± a.  Outside, both left and right, the fields are of constant magnitude (uniform).  It probably need not be mentioned, but such uniform fields require that the charge be of infinite extent in {x, z}.  

Although not so obvious in the vector plot, (Subscript[E, normal-left]^interface) = (Subscript[E, normal-right]^interface) at both y = ± a.

(h) Derive and plot the 1D Electric Potential vs. y for the above E Field.

<This is a text cell - enter your answer here.>

Starting again with the E field expressions, we assume that the potential at y = 0 is zero;   Potin[0] = 0.  

WHY?  For |Eout| constant vs. y, we would conclude that E at infinity = this constant.  I.e., it would take an infinite amount of work to move a unit test charge from infinity to the slab.  Thus, we could not set Potin[∞] = 0.  We therefore adopt y = 0 as a reference point where we set Potin[0] = 0.

NOTE: y takes care of SIGNs; we use yprime as the variable of integration:

(* Input Cell - Enter your code here *)
ClearAll["`*"]
Ein[y_] =(( rho y)/epsilonzero);
Eoutneg[y_] =-(( rho a)/epsilonzero);
Eoutpos[y_] = (( rho a)/epsilonzero);
Potin[y_] = -(∫_0^y)Ein[yprime]\[DifferentialD]yprime
Potoutpositive[y_] = Potin[a] -(∫_a^y)Eoutpos[yprime]\[DifferentialD]yprime
Potoutnegative[y_] = Potin[-a] -(∫_(-a)^y)Eoutneg[yprime]\[DifferentialD]yprime
Pottot[y_]  = If[y< -a,Potoutnegative[y],If[ -a ≤y ≤ a,Potin[y],Potoutpositive[y]]];
rho = 1; epsilonzero = 1; a = 2;
PotPlot = Plot[Pottot[y],{y,-5 a, 5 a}];lineleft = Graphics[{Thick, Dashed, Green,Line[{{-a, -a },{-a, a }}]}];
lineright = Graphics[{Thick, Dashed, Green,Line[{{a, -a },{a, a }}]}];
Show[PotPlot, lineleft, lineright]

(i)Comment on this result (the plot).

<This is a text cell - enter your answer here.>

The green dashed lines show the values of y (±a) at the edges of the slab.  

The straight lines correspond to the constant E fields outside of the slab with slopes indicating the magnitudes of E 

              ((OverVector[E])[y] = - Grad[Potential] = - (dV/dy) (OverHat[y])).

Inside the slab, E changes linearly with y so that the potential ~ -(y^2); this is consistent with the (OverVector[E]) pointing away from the center of the slab.  Check yourself out on the SIGNS for the above and the directions of (OverVector[E]) in the various regions.