Multipole Fields

Dipole Fields

ContourPlot[
      (1/(Sqrt[(((x + 1))^2) + (y^2)])) - (1/(Sqrt[(((x - 1))^2) + (y^2)])), {x, 
        -2, 2}, {y, -1, 1}, PlotPoints -> 40, 
      Contours -> 30, ColorFunction -> Hue]

ϕ = 
      (1/(Sqrt[(((x + 1))^2) + (y^2)])) - (1/(Sqrt[(((x - 1))^2) + (y^2)]));

<< Graphics`PlotField`

PlotVectorField[
      Evaluate[{(∂_x) ϕ, (∂_y) ϕ}], {x, -2, 
        2}, {y, -2, 2}]

General Multipole Fields

Multipole[n_] := 
      (∑_(i = 1)^n)
          ((((-1))^i)
            /(Sqrt[(((x - Cos[((2 π i)/n)]))^2) + 
              (((y - Sin[((2 π i)/n)]))^2)]))

ContourPlot[Evaluate[Multipole[4]], {x, -2, 2}, {y, -2, 2}, 
      PlotPoints -> 40, Contours -> 30, 
      ColorFunction -> (RGBColor[#, 1 - #, 0.6]&)]

ContourPlot[Evaluate[Multipole[5]], {x, -2, 2}, {y, -2, 2}, 
      PlotPoints -> 40, Contours -> 30, ColorFunction -> Hue]

Plot3D[Evaluate[Multipole[5]], {x, -2, 2}, {y, -2, 2}, 
      PlotPoints -> 40, ColorFunction -> Hue]

Simplify[Series[Multipole[5], {x, ∞, 3}]]

Simplify[Series[Multipole[4], {x, ∞, 8}]]

Simplify[Series[Multipole[8], {x, ∞, 8}]]

Table[Simplify[LegendreP[n, x]], {n, 8}] // TableForm