Remarks: In dealing with spherical coordinates in general and with Legendre polynomials in particular it is convenient to make the sustitution c = cosθ. For example, this allows use of the following simplification of the orthogonality relationship: π P n cosθp m cosθsinθ dθ = 2 2n+ δ nm = P n cp m c dc = 2 2n+ δ nm Since θ = π/2 the equator corresponds to c =, symmetries that correspond to reflection in the equatorial plane correspond to c c symmetry. So the statement P n c = n P n c 2 reports that the n-even P n have even reflection symmetry whereas the n-odd P n have odd reflection symmetry. Finally note that since θ = and π corresponds to c = ±, the statements P n = and P n = n report the ehavior of P n along the positive and negative z axes respectively. As shown in the text, we can write an aritrary azimuthally-symmetric solution to Laplace s equation in spherical coordinates as: φr,θ = A n r n + C n r n+ P n cosθ 3 or equivalently φr,c = A n r n + C n r n+ P n c 4 Example : Consider the prolem of finding φ inside a sphere of radius R where the voltage on the surface of the sphere has een given as a known function Vθ which we will use in the form Vc. First, since nothing singular is happening at the origin, C n = for all n. The A n are determined y the requirement that φ and V agree if r = R: Vc = φr,c = A n R n P n c 5 If we multiply oth sides y P m c and integrate c from to, we can calculate the lhs which of course depends on m and the rhs simplifies ecause of orthogonality: so VcP m c dc = A n R n A m = P n cp m c dc = A m R m 2 2m+ VcP mc dc R m 2 2m+ 6 7 Forexample, iftheappliedvoltage is+v inthenorthernhemisphereand V inthesouthern hemisphere an odd function of c, we can immediately conclude that for n even A n =, and for n odd Mathematica says: A n R n 2 2n+ = 2V P n c dc = V π Γ n/2 Γ3+n/2 8
In[]:= A=2 Integrate[LegendreP[n,x],{x,,}] Sqrt[Pi] Out[]= --------------------------- n 3 + n Gamma[ - -] Gamma[-----] 2 2 Mathematica has provided a complex answer for a result that is just a simple rational numer. For your enjoyment, I ll produce a form I can etter understand, ut in the end we ll let Mathematica use its own result. I ll egin y reporting some properties of the Gamma function: Γx+ = xγx 9 Γn+ = n! for n a positive integer π Γ x = sinπx Γx Γ/2 = π 2 x n = xx+x+2 x+n = Γx+n Γx 3 The last formula is for the shifted factorial 2 or Pochhammer Symol defined in class. Note that n is odd which we will write as n = 2m, so m = {,2,3,...} corresponds to n = {,3,5,...}. π Γ n/2 Γ3+n/2 sinπn/2 Γn/2 = = m Γm /2 π Γ3+n/2 Γ/2 Γm+ = m 2 i.e., {, 4, 8, 5 64, 7 2 28, 52,...} Back to Mathematica: m! m 2 = m 2 Γm /2 Γ /2Γm + 4 f[r_,c_]=sum[a 2 n +/2 r^n LegendreP[n,c],{n,,2,2}] ContourPlot[f[Sqrt[x^2+z^2],z/Sqrt[x^2+z^2]],{x,,.9},{z,-.9,.9}, Contours -> {-.9,-.8,-.7,-.6,-.5,-.4,-.3,-.2,-.,,.,.2,.3,.4,.5,.6,.7,.8,.9}, ContourShading->False,RegionFunction->Function[{x, z, q},x^2+z^2< ], AspectRatio->Automatic] Example 2: Consider the prolem of finding φ inside and outside a sphere of radius R where the surface charge density on the surface of the sphere has een given as a known Part of the reason for this complex formula is that Mathematica is showing that n even produces zero result. However it doesn t really matter if you don t recognize the answer as Mathematica can quickly produce the rational numer for any n you want. 2 Note: n = n! more generally x n is n terms multiplied together, starting with x with successive terms one more than the previous.
function σθ which we will use in the form σc. First, since nothing singular is happening at the origin, for the inside solution C n = for all n. Since the potential must approach zero as r, for the outside solution A n = for all n. Thus: φr,θ = A n r n P n c for r < R Continuity of φ at r = R produces the requirement: C n r n+p nc for r > R 5 A n R n = C n R n+ 6 The surface charge density can e related to the discontinuity in the radial component of the electric field: σθ = ǫ r φ r=r r φ r=r + 7 = ǫ na n R n +n+c n R n+2 P n c 8 = ǫ 2n+A n R n P n c 9 Theusual FourierTrick multiplyothsidesyp m candintegratefrom tocollapsing the sum to a single term allows A m to e calculated: 2 σcp m c dc = ǫ 2m+A m R m 2 2m+ = ǫ 2A m R m 2 Example 3: Often you can calculate φ along the z axis, ut the off-axis calculation is difficult or impossile. However you can expand φz to produce the full φr,c y a trick. Taylor expand φz to otain a power series expansion: φz = a n z n 22 This formula must agree with the Legendre expansion evaluated on the z axis: φr,c = A n r n P n c = a n z n on the z axis 23 The fact that on axis c = ± and P n ± = ± n allows easy comparison etween these twoseries. Agreement requiresa n usefulforφoff-axis equalsa n determinedonlyknowing φ on-axis. For example, the potential on the z-axis for a ring charge radius R, total charge Q is clearly φz = Q [ z 2 +R 2] /2 Q [ = +z/r 2 ] /2 Q = 2 n z2 /R 2 n 24 4πǫ 4πǫ R 4πǫ n!
we can conclude A n = n/2 Q 2 n/2 4πǫ R n n/2! for n even 25 for n odd f[r_,c_]=sum[-^n/2 Pochhammer[/2, n/2] r^n LegendreP[n,c]/n/2!,{n,,2,2}] ContourPlot[f[Sqrt[x^2+z^2],z/Sqrt[x^2+z^2]],{x,,.9},{z,-.9,.9},Contours->6, ContourShading->False,RegionFunction->Function[{x, z, q},x^2+z^2<.8 ], PlotRangePadding->None,AspectRatio->Automatic].5.5...5.5..2.4.6.8..2.4.6.8 Figure : Isopotential contours for Example left and Example 3 right
Homework : A physicist aims to suject a sample to a pure quadrupole field n = 2 inside a spherical cavity. The plan is to charge the top and ottom caps of the sphere to V and the remaining and around the equator to a potential of V. Because the applied voltage Vθ is symmetric, terms A n = for n odd. The first important term will then e quadrupole A 2 A corresponds to a constant voltage and so makes no electric field. It would e nice ut not possile to make A 2 the only non-zero term. The est we can do is make A 4 =. Prolem: Find the and angle, θ that makes A 4 =. Find A 6 in this circumstance. Find the values: A, A 2 and A 6. Put the pieces together to express the potential inside the sphere. Have Mathematica produce a contour plot of that voltage. Hint: A 4 { c } VcP 4 c dc = 2 P 4 c dc+ P 4 c dc c Use Mathematica or a root-finding calculator to find the value c to make this quality zero. V z 26 V θ V Homework 2: In a region where there are no currents flowing, we can define a magnetic potential that is exactly analogous to the electric potential: B = φ where: 2 φ = 27 For a pair of Helmholtz coils two identical coaxial coils with centers separated y R; recall Phys 2 las with them, the magnetic potential along the axis is given y: [ ] φz = 5 5R z R/2 6 R 2 +z R/2 + z +R/2 28 2 R 2 +z +R/2 2 Recall from the 2 la that the spacing of the coils is designed to produce a particularly uniform field etween the coils, and if you reverse the current in one coil you produce a diverging B with B = at the center in short a quadrupole field. Use Mathematica to series expand φ around the origin. Use that series to produce φr,cosθ in a region near the origin. Make a contour plot of φ to confirm that it is nearly uniform. If you have reversed coils a distance aove and elow the origin, φ is given y: [ ] z φz = R 2 +z z + 2 R 2 +z + 2 29 What value of will produce a particularly pure quadrupole field? Make a contour plot of φ to confirm that it is nearly quadrupole.
Homework 3: Consider a prolem analogous to Helmholtz coils ut in electrostatics with charged rings. You have a ring radius R, centered on the z axis, in a plane parallel to the xy plane with charge +Q at distance aove the origin, and a similar ring with center at z = with charge Q. Find that will produce the most uniform possile E field in the vicinity of the origin. Explain why the voltage on the z axis is given y: φz = Q 4πǫ [ ] R 2 +z 2 R 2 +z + 2 Expand this result in a power series in z. The term linear in z corresponds to rp c why? and further terms produce a non-uniform E. Determine the value of which makes as many of these further terms zero. Make a contour plot of φr,cosθ for R = to confirm that it is nearly uniform. Example 4: In the case of cylindrical coordinates where φr,θ and not z, we have: φr,θ = A +C lnr+ 3 An r n +C n r n a n cosnθ+c n sinnθ 3 Note that A n,c n,a n,c n are not independent: for example you could multiply oth A n,c n y five and divide oth a n,c n y five and have exactly the same solution. Most commonly one of the terms in parenthesis is reduced to a single term. As usual we have orthogonality as: +π π +π π +π π cosnθ sinmθ dθ = 32 cosnθcosmθ dθ = π δ mn 33 sinnθsinmθ dθ = π δ mn 34 We seek φ outside a cylinder of radius R on which the potential is known to e Vθ = cos 2 θ 35 Since the source extends to infinity, we cannot in general take φ at infinity to e zero; thus the meaning of the potential on the cylinder is amiguous; a convenient solution is to define the constant A = A C lnr a further enefit is the result makes sense dimensionally. φr,θ = A +C lnr/r+ An r n +C n r n a n cosnθ+c n sinnθ 36 Note that in this form the value of C has asolutely no effect on the value of the voltage at r = R; A it of thought should convince you that C is determined y the net chargeper-length on the cylinder. Recall: voltage for a line charge: φ = λ/2πǫ lnr. We will take C =. Since the Vθ is even in θ, c n = ; since the electric field should e regular at infinity A n =. Thus: φr,θ = A + C n r n cosnθ 37
Since φr,θ must agree with Vθ we have: cos 2 θ = φr,θ = A + C n R n cosnθ 38 The C n could now e determined using the Fourier Trick, ut a faster way is to use a trig identity to immediately write cos 2 θ in terms of cosnθ: cos 2 θ = 2 + 2 cos2θ = A + C n R n cosnθ 39 Simple inspection rather than integration, ut of course integration produces the same result: and C n = for n > 2. So the final result is: 2 = A 4 = C R cosθ 4 2 cos2θ = C 2R 2 cos2θ 42 φr,θ = [ +cos2θ R/r 2 ] 43 2 I hope it is immediately clear that this potential solves Laplace s equation, agrees with Vθ when r = R and represents a cylinder with a simple quadrupole. y V= Vy a x Example 5: Consider an infinite in the z directions rectangular gutter with cross-section etween, and a,. Three of the sides of the gutter are grounded; the fourth, a,y with y, has a specified voltage Vy. Separation of variales yields a general solution: φx,y = We have orthogonality in the form: sin A n sin nπy nπy sinh nπx sinh nπa 44 mπy sin dy = 2 δ mn 45
Requiring φx,y to agree with Vy when x = a yields: Vy = φa,y = nπy A n sin 46 With the Fourier Trick yielding: mπy Vy sin dy = 2 A m 47 Consider, for example, the case Vy = constant: So: [ mπy cos mπy sin dy = φx,y = 4 π n odd mπ ] nπy n sin = mπ [ m ] 48 sinh nπx sinh nπa 49..8.6.4.2...5..5 2. 2..5..5. 2 2.8.6.4.2.8.6.4.2.5..5 2..2.4.6.8. Figure 2: Clockwise from upper left: isopotential contours for Example 5, a slice of Example 5 φ along x,.5, a slice of Example 5 φ along.9,y, isopotential contours for Example 4