Expansion of the potential for Prob 2.22  inside the sphere.

Clear["`*"]

g  =  
      a (a^2 - 
                r^2)/(a^2  +  r^2  - 2  a r ξ)^(3/
                  2) /(4 π)

nterm  =  7

g =  
      Expand[Simplify[Normal[Series[g, {r, 0, nterm}]], 
          Assumptions ->  a > 0]]

g  = 
      g /.  ξ  ->  
          Cos[θ] Cos[ψ]  +  
            Sin[θ] Sin[ψ] Cos[ϕ]

g  =  Expand[g]

Expand[t1]

t2  =  
      Integrate[Sin[ψ] t1, {ψ, 0, π/2}]  - 
        Integrate[Sin[ψ] t1, {ψ, π/2, π}]

Factor coefficient of μ in potential and make a table of  coefficients of  Pl(μ)

F  = FullSimplify[t2 /.  θ ->  ArcCos[μ]]

c  =  Normal[Series[2  a F/(3  r), {r, 0, nterm}]]

nt  =  Length[c]

t   =  
      Table[Simplify[c[[i]]/LegendreP[2  i - 1, μ]], {i, 1, 
          nt}]

Plot the Field on Axis

Clear["`*"]

Φi  =  
      V (a/z) (1 - (a^2 - 
                  z^2)/(a Sqrt[a^2 + z^2]))

Ei  =  -Expand[D[Φi, z]]

c  =  Ei[[1]]

dEi  =  Ei - c

dEi  =  FullSimplify[dEi]

de  =  
      Simplify[a dEi /V /.  z ->  a ζ, 
        Assumptions ->  a > 0]

cc  =  
      Simplify[a c/V  /.  z ->  a ζ, 
        Assumptions ->  a > 0]

ein  =  V/a (cc +  de)

Limit[ein,  ζ -> 0]

ein /.  ζ ->  1

Φo  =  
      V (1 - (z^2 - a^2)/(z Sqrt[a^2 + z^2]))

Eo  =  -FullSimplify[D[Φo, z]]

Simplify[Eo /.  z ->  a, Assumptions ->  a > 0]

Ei  =  Ei /.  {V -> 10, a ->  1}

Eo  =  Eo /.  {V -> 10, a ->  1}

Eb =  
      Piecewise[{{Eo, 
            z < -1}, {Ei, -1 ≤  z ≤ 1}, {Eo, 
            z > 1}}]

Plot[Eb, {z, -2, 2}, 
      PlotStyle -> {Thickness[0.01], RGBColor[1, 0, 0]}, 
      AxesLabel ->  {z, ""}, 
      PlotLabel ->  "Axial Electric Field", 
      TextStyle -> {FontSize -> 14}]

Export["C:\Documents and Settings\johnson\My \
Documents\Filexfer\Class06S\eio.eps", %]

Sketch  E field

Clear["`*"]

Φi  =  
      V (a/z) (1 - (a^2 - 
                  z^2)/(a Sqrt[a^2 + z^2]))

Φo  =  
      V (1 - (z^2 - a^2)/(z Sqrt[a^2 + z^2]))

nterm  =  40

ϕi  = Normal[Series[Φi, {z, 0, nterm}]]

ϕi  =  
      Expand[Simplify[ϕi /.  {V ->  10, a -> 1}]]

li =  Length[ϕi]

ti  =  
      Table[ϕi[[i]]/z^(2  i - 1), {i, 1, li}]

ϕi = 0

Do[ϕi  =  ϕi  +  
          ti[[i]] r^(2  i - 1)  LegendreP[2 i - 1, 
              Cos[θ]], {i, 1, li}]

ϕo  = 
      Normal[Series[Φo, {z, Infinity, nterm}]]

ϕo  =  
      Expand[Simplify[ϕo /.  {V ->  10, a -> 1}]]

lo =  Length[ϕo]

to =  
      Table[ϕo[[i]] z^(nterm  -  2  i + 2), {i, 1, 
          lo}]

ϕo  =  0

Do[ϕo  =  ϕo  +  
          to[[i]]/ r^(nterm - 2  i + 2)  LegendreP[
              nterm - 2 i + 1, Cos[θ]], {i, 1, lo}]

vv  =  
      Piecewise[{{ϕi, r < 1}, {ϕo, 
              r > 1}}] /.  Cos[θ]-> μ

v[x_, y_]  =  
      Simplify[vv /.  {r ->  Sqrt[x^2 + z^2], μ ->  
              z/Sqrt[x^2 + z^2]}]

cp  =  
      ContourPlot[v[x, z], {x, -3, 3}, {z, -3, 3}, 
        PlotPoints ->  200, ColorFunction -> Hue, 
        ContourSmoothing ->  
          True, 
DisplayFunction ->  
          Identity]

Needs["Graphics`PlotField`"]

ce  =  
      PlotGradientField[-v[x, z], {x, -3, 3}, {z, -3, 
          3}, 
ScaleFunction ->  (1 &),  
        DisplayFunction ->  Identity]

circle = Graphics[{Thickness[0.008], Circle[{0, 0}, 1]}]

Show[{cp, ce, circle}, 
      DisplayFunction ->  $DisplayFunction]

Export["C:\Documents and Settings\johnson\My \
Documents\Filexfer\Class06S\eio1.eps", %]

Evaluation of potential in Prob 2.23

Clear["`*"]

m0  =  1

n0  =  1

Φ  :=  (16/π^2) Sum[
          Sin[(2  m + 1) π x]/(2  m + 1)   Sum[
              Sin[(2  n + 1) π y]/(2  n + 1) (Cosh[
                      Sqrt[(2  n + 1)^2 + (2  m + 1)^2] π (z - 
                            1/2)]/ 
                    Cosh[Sqrt[(2  n + 1)^2 + (2  m + 1)^2] π/
                          2]), {n, 0, n0}], {m, 0, m0}]

Φ /.  {x -> 1/2,  y ->  1/2,  
          z ->  1/2} // N

Problem 2.26

Φ  =  
      a1 (ρ^(π/β) -  (a^2/ρ)^(π/β)) Sin[π ϕ/β]

Eρ  =  -Simplify[ D[Φ, ρ]]

Eϕ  =  -Simplify[D[Φ, ϕ]/ρ]

σ0  =  (Subscript[ϵ, 0 ]) 
          Eϕ  /.  ϕ ->  0

σβ  =  -(Subscript[ϵ, 0]) Eϕ  /.  ϕ ->  β

σa  =  Eρ  /.  ρ ->  a

Er1  =  Eρ /.  β  ->  π

Ef1  =  Eϕ  /.  β ->  π

s0  =  σ0 /.  {a1 ->  -1,  β ->  π,  a ->  1,  (Subscript[ϵ, 0]) ->  1}

sa  =  σa /.   {a1 ->  -1,  β ->  π,  a ->  1,  (Subscript[ϵ, 0]) ->  1}

pr  =  
      Plot[s0, {ρ, 1, 3}, AxesLabel ->  {ρ, σ}, 
        PlotStyle ->  {Thickness[0.01],  RGBColor[0, 0, 1]}, 
        TextStyle -> {FontSize -> 14}]

pa  =  
      Plot[sa, {ϕ, 0, π}, AxesLabel ->  {ϕ, σ}, 
        PlotStyle ->  {Thickness[0.01],  RGBColor[0, 0, 1]}, 
        TextStyle -> {FontSize -> 14}]

Export["C:\Documents and Settings\johnson\My \
Documents\Filexfer\Class06S\pr.eps", pr]

Export["C:\Documents and Settings\johnson\My \
Documents\Filexfer\Class06S\pa.eps", pa]