Electric Field and Potential along z-axis due to Uniformly Charged Ring

PROBLEM:
Consider the following classic problem:  Find the E field along the symmetry axis of a uniformly charged ring. The ring has a radius a and a uniform line charge density λ.  We will denote the distance along the z-axis from the center of the ring to the point P (on the z- axis) by z.

(Suggest you use the angle ϕ in your solution and k for (1/(4 π (Subscript[ϵ, o]))).)
A couple of reminders:

1.   (* This is a comment *)   

and 

2.  If you get some weird results at some point, try going back and re-executing all the previous cells to reset your functions and variables.  As an absolute last resort, close down and reopen M to get a fresh start.

(a) Start by finding the electric potential. Since potentials are scalars, they are easier to calculate that fields, which are vectors. Using the notation in the diagram below, write the differential of electric potential dV[z] (dV as a function of z) at the point P due to a differential of charge dq on the ring. (You can treat dq as a point charge.)

<this is a text cell — type in your response>

(b)  Find V[z] by integrating your expression for dV[z].  You can do this by entering your equation for dV[z] in the cell below and integrating.

A word about the prime (ʹ).  Mathematica usually interprets the prime symbol as a derivative.  We recommend replacing symbols like ϕʹ with ϕprime in M. 

A series of assumptions (more than you need) are provided that make the integration run like a champ.  They start with:  “ $Assumptions = “

To execute each cell, click your mouse anywhere inside the cell and then hit Shift-Return.

ClearAll["Global`*"]d    (*  clears old constants and functions  *)
$Assumptions = a> 0 && a ∈ Reals && z ∈ Reals && λ > 0 && λ ∈ Reals && k > 0 && k ∈ Reals&&ϕprime ∈ Reals &&  ϕprime > 0 ;    (*  helps M do integrals, etc.  *)

Vring[z] gives us the value of the potential as a function of k, a, λ, and the variable z for points along the z-axis.
By symmetry, we can conclude that for all points on the z-axis, Vring is a function of z only.  Likewise, the only nonzero component of the electric field for points that lie on the z-axis is the z-component of the field.

(c) Now find the Electric Field (OverVector[E])ring[z] corresponding to (OverVector[E])ring at the point P on the z axis.


When we seek the E field for these particular points using –Grad[V[z]], we will obtain a Vector of the form {0, 0, Eringz[z]}. 

Convince yourself that the vector (OverVector[E])ring[z] = Eringz[z] (OverHat[z]).    {Eringz[z] is the magnitude (therefore a scalar) of the zth component of (OverVector[E])ring[z].}  For your sake, enter your very complete and concise arguments below.  You may refer to the figures below or draw your own.

this is a text cell — type in your arguments

(d) Now use Mathematica to find (OverVector[E])ring[z]from V[z].  (you might consider using Grad or just take the appropriate derivative(s))

(*  you can use this input cell *)

(e) Either by hand or using M , enter/define (Subscript[Ez, ring])[z]  (the z component of  (Subscript[(OverVector[E]), ring])[z] ) in this cell:

(*  you can use this input cell *)

(f) In preparation for plotting, give the parameters k, λ, and a numerical values.  As below, I suggest you set all of them = 1.  Note that  λ  > 0; a positive charge distribution.

Plot Vring[z] vs. z (from some negative value of z to some plus value of z. What do the ± values of z represent and how does that influence your plot of V[z]?

(* you want to use Plot in this input cell*)

(g) Comment on the behavior of V[z] as you move away from the ring in both directions.

this is a text cell — type in your analysis of the z-dependence

(g) continued.  Compare Vring[z] and the potential of a point charge for the same total charge:  ((k Q)/(Abs[z])).   Plot them both on the same axes.  (We insert the Abs because for +Q, V of a point charge is positive for both +z and –z;  Abs[z] takes care of this.)

(* Use this input cell for your Plot code*)

this is a text cell for your (simple) conclusion

(h) Now plot the magnitude of  (OverVector[E])ring[z]  = Eringz[z]:

(*  Again, you want to use Plot  *)

(i) Write down a brief interpretation/discussion of the two plots (e.g., SIGNS and the sign of λ).  How are these two plots are related (hint:  SLOPE of one of them)??

this is a text cell — type in your interpretation

(j) No Brainer - Click inside the cell below (or select it by clicking on the bracket to the right) and execute it (Shift-Return);  Answer Boxes will appear; Click on the one you think is correct answer for this question:

Statement (Agree or Disagree):  Off this symmetry axis (that is, off the z-axis), I expect (Subscript[V, ring]) and (Subscript[E, ring]) to depend on z only.  [Live it up! Click both.]

Button["1  I agree.  Off the symmetry axis, (Subscript[V, ring]) and (Subscript[E, ring]) depend on z only",{Print["  Wrong --The symmetry of the problem is broken: in Cartesian Coordinates, we therefore expect x and/or y dependence to creep in. "]}]
Button["2 I disagree; Off the symmetry axis, (Subscript[V, ring]) and (Subscript[E, ring]) generally do not depend on z only ",{Print["  Correct -- The symmetry of the problem is broken; in Cartesian Coordinates, we therefore expect x and/or y dependence to creep in.\n\nIn Spherical Coordinates one would expect θ dependence in V and E, but no ϕ dependence."]}]