This notebook has transformation techniques to translate a couple of circular charge distribution integrals into their elliptic integral form.  It also has plots of some of the electric and magnetic fields obtained from solving one such problem.

Transform integral to elliptic or hypergeometric forms?

https://mathematica.stackexchange.com/questions/161971/transform-integral-to-elliptic-or-hypergeometric-forms/162095#162095

a = z/R, b = r/R

<<peeters` ;
peeters`setGitDir[ "../project/figures/GAelectrodynamics" ]

ClearAll[int1, lim1t, lim1b,A]
int1[p_,a_,b_]=Integrate[1/(1+a^2+b^2-2 b Cos[p])^(3/2),p,Assumptions->a∈Reals&&b∈Reals&&0≤p≤2 Pi];

lim1t=Limit[int1[p,a,b],p->2 Pi,Direction->1,Assumptions->a∈Reals&&b∈Reals];

(*(4 EllipticE[-((4 b)/(a^2+(-1+b)^2))])/(Sqrt[a^2+(-1+b)^2] (a^2+(1+b)^2))*)

(*lim1b=Limit[int1[p,a,b],p->0,Direction->-1,Assumptions->a∈Reals&&b∈Reals]*)

(*0*)



A[z_, rho_] = (lim1t /. {a->z, b->rho}) ;

A[z,ρ] // TraditionalForm

Integrate[A[z,rho],z,Assumptions -> (rho∈Reals && rho ≠ 1)]
Integrate[A[z,rho],{z,-Infinity,Infinity},Assumptions -> (rho∈Reals && rho ≠ 1)]

ClearAll[int2,lim2t, lim2b, B]

int2[p_,a_,b_]=Integrate[Cos[p]/(1+a^2+b^2-2 b Cos[p])^(3/2),p,Assumptions->a∈Reals&&b∈Reals];

lim2t=Limit[int2[p,a,b],p->2 Pi,Direction->1,Assumptions->a∈Reals&&b∈Reals];

(*(2 (1+a^2+b^2) EllipticE[-((4 b)/(a^2+(-1+b)^2))]-2 (a^2+(1+b)^2) EllipticK[-((4 b)/(a^2+(-1+b)^2))])/(Sqrt[a^2+(-1+b)^2] b (a^2+(1+b)^2))*)

(*lim2b=Limit[int2[p,a,b],p->0,Direction->-1,Assumptions->a∈Reals&&b∈Reals]*)

(*0*)



B[z_, rho_] = (lim2t /. {a->z, b->rho}) ;

B[z, ρ] // TraditionalForm

Integrate[B[z,rho],z,Assumptions -> (rho∈Reals && rho ≠ 1)]
Integrate[B[z,rho],{z,-Infinity,Infinity},Assumptions -> (rho∈Reals && rho ≠ 1)]

ClearAll[e1, e2,e3]
{e1, e2, e3} = IdentityMatrix[3];
rhocap[phi_] = e1 Cos[phi] + e2 Sin[phi];
phicap[phi_] = e2 Cos[phi] - e1 Sin[phi];
zcap = e3;
Efield[rho_, phi_, z_] = z A[z,rho] e3 + rhocap[phi] ( rho A[z,rho] - B[z,rho]);
Hfield[rho_, phi_, z_] = -z A[z,rho] phicap[phi] -e3  ( rho B[z,rho] + A[z,rho]);

Efield[ρ,ϕ, z] // TraditionalForm
Hfield[ρ,ϕ, z] // TraditionalForm

pe = Module[{range,zmin},
range = 1.2;
zmin = 0.2;
VectorPlot3D[
Module[{rho,phi},
rho[x_, y_] = Sqrt[x^2 + y^2];
phi[x_, y_] = ArcTan[x,y];
Efield[rho[ x,y], phi[x,y], z]
],
{x,-range,range},
{y,-range,range},
{z,zmin,range},
PlotRange->{Full, Full, {0.2, range}},
AxesLabel-> {x, y, z}
]
]

ph = Module[{range,zmin},
range = 1.2;
zmin = 0.2;
VectorPlot3D[
Module[{rho,phi},
rho[x_, y_] = Sqrt[x^2 + y^2];
phi[x_, y_] = ArcTan[x,y];
Hfield[rho[ x,y], phi[x,y], z]
],
{x,-range,range},
{y,-range,range},
{z,zmin,range},
PlotRange->{Full, Full, {zmin, range}},
AxesLabel-> {x, y, z}
]
]

pa = Plot3D[A[z,rho] , {z,0,2}, {rho,0,2}, AxesLabel->{z,ρ, "A"}, PlotRange->{Full, Full, {0,30}}]
pb = Plot3D[B[z,rho] , {z,0,2}, {rho,0,2}, AxesLabel->{z,ρ, "B"}, PlotRange->{Full, Full, {0,30}}]

peeters`exportForLatex["ringFieldAFig1", pa]
peeters`exportForLatex["ringFieldBFig1", pb]

peeters`exportForLatex["ringFieldEFig1", pe]
peeters`exportForLatex["ringFieldHFig1", ph]

(*Plot[EllipticK[-x], {x,0,10}]
Plot[EllipticE[-x], {x,0,1000}]*)

ph2 = Module[{range,zmin},
range = 1.2;
zmin = 0.2;
VectorPlot3D[
Module[{rho,phi},
rho[x_, y_] = Sqrt[x^2 + y^2];
phi[x_, y_] = ArcTan[x,y];
Hfield[rho[ x,y], phi[x,y], z]
],
{x,-range,range},
{y,-range,range},
{z,10,11},
AxesLabel-> {x, y, z}
]
]

peeters`exportForLatex["ringFieldHFig2", ph2]