Two parallel line charges with ± Charge.

PROBLEM:  

Consider two infinitely long line charges parallel to each other and the z axis, passing through the x-y plane at Points {–a,0,0} and {+a,0,0} (e.g., separated by a distance 2a), where the line passing through {–a,0,0} has a linear charge density of –λ and the line passing through {+a,0,0} has a linear charge density of +λ.  The geometry is illustrated in the figure below.  The line charges themselves extend into and out of the plane of the figure.

(a) Find the potential at an arbitrary position in the x - y plane, that is, at the Point P {x, y, 0}, using the Superposition Principle and your previous work on the potential due to an infinitely long, linear charge distribution.  
  
  [Choose an expression with the zero of potential at the origin of the coordinate system, {0, 0, 0}. ]

<Input text here>

After lots of tap dancing, you should be able to get your potential into the form:

(Subscript[V, Total])[x,y] = = k λ Log[(((a+x)^2 + y^2)/((a-x)^2 + y^2))]      I suggest you use this form to go forward.

(b)  Use M to produce a 3D plot and a contour plot of the potential due to the two wires.

You will have to assume values for k, a, and |λ|.  (I set k = a = |λ| = 1.)  

You may find it convenient to define a constant (e.g., MM) for the plot range; for instance, {x, MM, MM} and {y, MM, MM}.  This makes it easy to experiment with the plot range.  The contour plot will be useful later, so be sure to give it a name.  For instance, the command  

contour = ContourPlot[V[x,y],{x, -MM, MM}, {y, -MM, MM}, ColorFunction->"Rainbow"]

This will both draw the ContourPlot and give it the name "contour."

Clear["Global`*"];
V[x_,y_] := k λ Log[(((((x+a))^2) + (y^2))/((((x-a))^2) + (y^2)))];  (*  To get you started  *)

(c)  Interpret your results in this text cell.

<Interpret*your*results*in*this*cell>

(d)  Now use M to compute the electric field due to the pair of parallel +±line charges. Plot the resulting field in a 2D vector plot.  We expect the field to be perpendicular to the equipotentials (countour lines) plotted above.  Is it?  To check this, name your Efield plot when your draw it.  For instance, 

Efield = VectorPlot[EE, {x, -MM, MM}, {y, -MM,MM},VectorPoints->{12,12}]

Then you can superimpose the Efield plot and the contour plot using the Show[] command; for instance.

Show[contour, Efield, PlotRange-> Automatic]

The relationship between the contour plot and the direction of the electric field is more clear if you draw electric field lines rather than the grid of vectors.  (There are issues with field line plotting, but this geometry is pretty safe.) The field lines can be drawn with the StreamPlot command.  For instance, 

Streamlineplot = StreamPlot[EE, {x, -MM, MM}, {y, -MM,MM}]

Clear[a, k , λ ];   (* some code to get you started  *)
EE= -{D[V[x,y],x],D[V[x,y],y]}    (*  You can also use EE = - Grad[V[x,y],{x, y}]; this is the 2D gradient of V in Cartesian Coordinates *)
Simplify[EE]

(e)  Interpret your results

<Interpret*your*results*in*this*text*cell>