Legendre Equation and exercise , Exercises of Physics

Turunan, latihan soal, dan pembahasa tentang persamaan legenre

Typology: Exercises

2016/2017

Uploaded on 11/29/2017

erwin-ello
erwin-ello 🇮🇩

5

(1)

1 document

1 / 21

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ME201/MTH281/ME400/CHE400
Legendre Polynomials
1. Introduction
This notebook has three objectives: (1) to summarize some useful information about Legendre polynomials, (2) to show
how to use Mathematica in calculations with Legendre polynomials, and (3) to present some examples of the use of Legendre
polynomials in the solution of Laplace's equation in spherical coordinates. In our course, the Legendre polynomials arose from
separation of variables for the Laplace equation in spherical coordinates, so we begin there. The basic spherical coordinate
system is shown below. The location of a point P is specified by the distance r of the point from the origin, the angle f between
the position vector and the z-axis, and the angle q from the x-axis to the projection of the position vector onto the xy plane.
The Laplace equation for a function F(r, f, q) is given by
(1)
2F = 1
r2
¶∂
¶∂r
r2¶∂F
¶∂r
+1
r2sinf
¶∂
¶∂fsinf
¶∂F
¶∂f+1
r2sin2f
¶∂2F
¶∂q2=0 .
In this notebook, we will consider only axisymmetric solutions of (1) -- that is, solutions which depend on r and f but not on q.
Then equation (1) reduces to
(2)
1
r2
¶∂
¶∂r
r2¶∂F
¶∂r
+1
r2sinf
¶∂
¶∂fsinf
¶∂F
¶∂f=0 .
As we showed in class by a rather lengthy analysis, equation (2) has separated solutions of the form
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Legendre Equation and exercise and more Exercises Physics in PDF only on Docsity!

ME 201 /MTH 281 /ME 400 /CHE 400

Legendre Polynomials

1. Introduction

This notebook has three objectives: (1) to summarize some useful information about Legendre polynomials, (2) to show

how to use Mathematica in calculations with Legendre polynomials, and (3) to present some examples of the use of Legendre

polynomials in the solution of Laplace's equation in spherical coordinates. In our course, the Legendre polynomials arose from

separation of variables for the Laplace equation in spherical coordinates, so we begin there. The basic spherical coordinate

system is shown below. The location of a point P is specified by the distance r of the point from the origin, the angle f between

the position vector and the z -axis, and the angle q from the x -axis to the projection of the position vector onto the xy plane.

The Laplace equation for a function F( r , f, q) is given by

2

F =

r

2

¶∂ r

r

2

¶∂ F

¶∂ r

r

2

sinf

¶∂ f

sinf

¶∂ F

¶∂ f

r

2 sin

2

f

2 F

¶∂ q

2

In this notebook, we will consider only axisymmetric solutions of (1) -- that is, solutions which depend on r and f but not on q.

Then equation (1) reduces to

r

2

¶∂ r

r

2

¶∂ F

¶∂ r

r

2

sinf

¶∂ f

sinf

¶∂ F

¶∂ f

As we showed in class by a rather lengthy analysis, equation (2) has separated solutions of the form

r ( 3 )

n

P n

HcosfL and r

  • H n + 1 L

P n

HcosfL ,

where n is a non-negative integer and P n is the n th Legendre polynomial. These solutions can be used to solve axisymmetric

problems inside a sphere, exterior to a sphere, or in the region between concentric spheres. We include examples of each type

later in this notebook. Now we look in more detail at Legendre's equation and the Legendre polynomials.

2. Legendre Polynomials

ü 2.1 Differential Equation

The first result in the search for separated solutions of equation (2), which ultimately leads to the formulas (3), is the pair

of differential equations (4) for the r -dependent part F ( r ), and the f-dependent part P (f) of the separated solutions:

r ( 4 )

2

d

2

F

d r

2

  • 2 r

d F

d r

  • l F = 0 , and

d

df

sinf

d P

df

  • lsinf P = 0 ,

where l is the separation constant. The r -equation is equidimensional and thus has solutions, easily found, which are powers of

r. The f-equation is Legendre's equation. We begin by transforming it to a somewhat simpler form by a change of independent

variable, namely

h = cosf.

Then equation (4) becomes

d

dh

BI 1 - h

2

M

d P

dh

F + l P = 0 , - 1 < h < 1.

Equation (6) has regular singular points at the endpoints h = ± 1, and we require the solution P to be well-behaved at those

points. This is our first example of a singular Sturm-Liouville system. Those special values of l for which there are such well-

behaved solutions are the eigenvalues of the problem.

As we showed in class, we may find solutions of (6) in the form of power series about h = 0: P (h) = ⁄ n = 0

a n

h

n

. By

substitution of this into equation (6), we find the recurrence relation for the coefficients a n

a n + 2

n H n + 1 L - l

H n + 1 L H n + 2 L

a n

Because of the index increment of 2 in (7), the solutions fall naturally into even and odd functions of h, with the coefficient

sequences of the two not mixing. For very large n , we may approximate the relation (7) by ignoring l compared with n ( n + 1).

The result is ( n + 2) a n + 2

na n -- that is, a n constant/ n. From that result it is possible to show that any such solution is logarithmi-

cally singular at one or both endpoints. This result is suggested by (but not proved by) the two series

ln H 1 - hL = - ‚ ( 8 )

n= 1

¶ h

n

n

, and ln H 1 + hL = ‚

n= 1

¶ H- 1 L

n + 1

h

n

n

The only way to avoid such singularities in the solution is for the series to terminate. We see immediately from the recurrence

relation (7) that termination occurs if and only if l = k(k + 1) for k a non-negative integer. The terminating solution in that case

is a polynomial of degree k. If k is even, the polynomial has only even powers and is then an even function of h. If k is odd, only

odd powers appear and the function is odd. Such solutions are called Legendre polynomials. The k th one is denoted by P k

(h),

with the convention that the arbitrary multiplicative constant is fixed by the condition

P

k

H 1 L = 1.

Any of the polynomials can be constructed directly from the recurrence formula (7) and the normalization (9). As an alternative,

there is the well-known formula of Rodrigues, which gives an explicit expression for the n th polynomial. Although it is not

usually used to compute the polynomials, it is still of interest:

cos H 0 ÿ fL = 1 = P 0 HcosfL

cos HfL = P 1 HcosfL

cos H 2 fL =

H- P

0

HcosfL + 4 P 2

HcosfLL

cos H 3 fL =

H- 3 P

1

HcosfL + 8 P 3

HcosfLL

cos H 4 fL =

H- 7 P

0 HcosfL - 80 P 2 HcosfL + 192 P 4 HcosfLL

These last two sets of formulas are especially useful in solving boundary value problems in spherical coordinates when the

boundary conditions have special, simple forms.

ü 2.2 Some Useful Formulas and Graphs

To get some idea of what these polynomials look like, we construct graphs of the first 7. According to the general result

about the zeros of solutions of Sturm-Liouville systems, the kth polynomial should have exactly k zeros in the interval (-1,1).

We first define a function legraph[k] that produces a graph of the kth polynomial, and then we use a Do loop to construct the first

7 graphs. The size of the graphs throughout this notebook is controlled by the SetOptions command below. The value 250 is

appropriate for a printed version. A value of 350 might be better for computer display.

SetOptions@Plot, ImageSize Ø 250 D;

legraph@k_D := Plot@LegendreP@k, hD, 8 h, - 1 , 1 <, AxesLabel Ø 8 "h", "P k

HhL"<,

PlotRange Ø 88 - 1.1, 1.1<, 8 - 1.1, 1.1<<, PlotLabel Ø Row@ 8 "k =", PaddedForm@k, 3 D<DD

GraphicsGrid@Table@ 8 legraph@iD, legraph@i + 1 D<, 8 i, 0 , 6 , 2 <DD

  • 1.0 - 0.5 0.5 1.

h

P k

HhL

k = 0

  • 1.0 - 0.5 0.5 1.

h

P k

HhL

k = 1

  • 1.0 - 0.5 0.5 1.

h

P k HhL

k = 2

  • 1.0 - 0.5 0.5 1.

h

P k HhL

k = 3

  • 1.0 - 0.5 0.5 1.

h

P k

HhL

k = 4

  • 1.0 - 0.5 0.5 1.

h

P k

HhL

k = 5

  • 1.0 - 0.5 0.5 1.

h

P k HhL

k = 6

  • 1.0 - 0.5 0.5 1.

h

P k HhL

k = 7

We see the expected alternation between even and odd functions, and the expected number of zeros in each case.

There are a large number of formulas involving Legendre polynomials. We consider here only a few of the most useful.

The following is a recurrence relation for three consecutive Legendre polynomials:

H n + 1 L P n + 1

HhL - H 2 n + 1 L h P

n

HhL + nP n- 1

HhL = 0.

Although P n - 1 is not defined when n = 0, you can easily check that the formula (13) remains true in that case if we define P

  • 1 to

be anything bounded. An interesting application of (13) is to compute P n HhL, starting with the known functions P 0 HhL = 1 and

P

1

HhL = h. Then we get

0

1

P

n HhL „ h =

P

n - 1

H 0 L - P

n + 1

H 0 L

2 n + 1

which again is zero for n even, and can be evaluated for n odd by using (18).

We can also evaluate integrals of the form Ÿ hP n

HhL „ h by using the recurrence relations (13) and (15). The result of the

somewhat tedious calculation is the formula below, valid for n r 2.

  • 1

h

h

è

P

n Hh

è

L „ h

è

H n + 1 L H 2 n - 1 L P n + 2 HhL + H 2 n + 1 L P n HhL - n H 2 n + 3 L P n - 2 HhL

H 2 n - 1 L H 2 n + 1 L H 2 n + 3 L

For the special case h = 1, we get from (16) and (23)

  • 1

1

h P n

HhL „ h = 0 ,

valid for n ¥ 2, again a special case of orthogonality, because P 1 HhL = h. Another special case of (23) is h = 0, which gives

  • 1

0

h P

n

HhL „ h =

H n + 1 L H 2 n - 1 L P n + 2 H 0 L + H 2 n + 1 L P n H 0 L - n H 2 n + 3 L P n - 2

H 0 L

H 2 n - 1 L H 2 n + 1 L H 2 n + 3 L

which is zero for n odd, and may be evaluted from (18) for n even. Finally, by subtracting (25) from (24), we get

0

1

h P

n

HhL „ h =

n H 2 n + 3 L P n - 2 H 0 L - H 2 n + 1 L P n H 0 L - H n + 1 L H 2 n - 1 L P n + 2

H 0 L

H 2 n - 1 L H 2 n + 1 L H 2 n + 3 L

We will use some of these integrals in the examples of expansions in the next section, and in the Laplace equation examples in

the last section.

ü 2.3 Expansions in Legendre Polynomials

As we showed in class from the differential equation (6), the Legendre polynomials are orthogonal on the interval [-1,1]:

  • 1

1

P

m

HhL P n

HhL „ h = 0 for m ¹≠ n.

It may be shown that the normalization integral is given by

  • 1

1

P

n

HhL P n

HhL „ h =

2 n + 1

The polynomials form a complete set on the interval [-1,1], and any piecewise smooth function may be expanded in a series of

the polynomials. The series will converge at each point to the usual mean of the right and left limits. The coefficients are easily

calculated using the orthogonality properties (24) and the normalization integral (25), and we have

f HhL = ‚

n= 0

C

n

P

n HhL , where C n

2 n + 1

  • 1

1

f HhL P n HhL „ h.

As an example, we expand the step function given below in such a series.

f HhL = - 1 for - 1 b h b 0 , and f HhL = 1 for 0 < h § 1.

Because f is odd, the even coefficients will all vanish. The odd coefficients are given by

C ( 31 )

n

= H 2 n + 1 L ‡

0

1

P

n

HhL „ h.

By using equation (22) we get

By using equation (22) we get

C

n

= @ P

n - 1

H 0 L - P

n + 1

H 0 LD ,

where the values at h = 0 needed in (32) are given by equation (18). We now use Mathematica to calculate the coefficients up to

n = 51, starting with n = 1.

Module@ 8 i<, Co = 8 <; Do@Co = Append@Co,

HLegendreP@i - 1 , 0 D - LegendreP@i + 1 , 0 DLD, 8 i, 1 , 51 <DD

The kth coefficient is then given by Co[[k]]. We sample a few values:

Co@@ 1 DD

3

2

Co@@ 2 DD

0

Co@@ 9 DD

133

256

All the even coefficients are zero.

Now we define the kth partial sum, and then a graph of the kth partial sum, along with the original function. Because the

coefficient of P 0

is zero, we may start the sum over i with the i = 1 term. The given function f (h) is shown in blue and the partial

sums in red.

legsum@h_, k_D := Module@ 8 i<, Sum@N@Co@@iDDD * LegendreP@i, hD, 8 i, 1 , k<DD

f@h_D := If@Hh < 0 L, H- 1 L, H 1 LD

legraph@k_D := Plot@ 8 f@hD, legsum@h, kD<, 8 h, - 1 , 1 <, PlotRange Ø 8 - 1.5, 1.5<,

PlotStyle Ø 88 RGBColor@ 0 , 0 , 1 D, [email protected]<, 8 RGBColor@ 1 , 0 , 0 D, [email protected]<<,

AxesLabel Ø 8 "h", "fHhL"<, PlotLabel Ø Row@ 8 "k =", PaddedForm@k, 2 D<DD

We construct a sequence of partial sums which may be animated to see the convergence. We go up to P 51

. The even terms are

zero, so we increment by 2 in the sequence of partial sums. It would be much more efficient computationally to save each partial

sum, and then use it to compute the next partial sum in the sequence. The present inefficient method is however much easier to

program. The output from the calculation is sent to a Manipulate panel.

GraphicsGrid@Table@ 8 legraph@iD, legraph@i + 10 D<, 8 i, 1 , 51 , 20 <DD

  • 1.0 - 0.5 0.5 1.

h

fHhL

k = 1

  • 1.0 - 0.5 0.5 1.

h

fHhL

k = 11

  • 1.0 - 0.5 0.5 1.

h

fHhL

k = 21

  • 1.0 - 0.5 0.5 1.

h

fHhL

k = 31

  • 1.0 - 0.5 0.5 1.

h

fHhL

k = 41

  • 1.0 - 0.5 0.5 1.

h

fHhL

k = 51

As a second example, we consider a function which is continuous on the interval [-1,1], but which has a discontinuity in

slope at 0. The function is defined to be 0 in the left-half interval [-1,0] and h in the right half interval:

y@h_D := If@Hh < 0 L, H 0 L, HhLD

The expansion coefficients are given by

D ( 33 )

n

H 2 n + 1 L

0

1

h P n

HhL „ h.

By equation (26) we get

D

n

n H 2 n + 3 L P n - 2 H 0 L - H 2 n + 1 L P n H 0 L - H n + 1 L H 2 n - 1 L P n + 2

H 0 L

2 H 2 n - 1 L H 2 n + 3 L

This is valid for n r 2. The first two coefficients are

D

0

0

1

h P 0

HhL „ h =

and D 1

0

1

h P 1

HhL „ h =

We now construct an array containing the first 20 coefficients. For convenience, we give a name to the right-hand side of (34).

coeff@n_D :=

HHn H 2 n + 3 L LegendreP@n - 2 , 0 D - H 2 n + 1 L LegendreP@n, 0 DL - Hn + 1 L H 2 n - 1 L LegendreP@n + 2 , 0 DL ê

H 2 H 2 n - 1 L H 2 n + 3 LL

We construct the first 20 coefficients, starting at n = 1, and storing them in the array Co2.

Module@ 8 i<, Co2 = 8 0.5<; Do@Co2 = Append@Co2,

N@coeff@iDDD, 8 i, 2 , 20 <DD

The module below defines the kth partial sum of the Legendre expansion and assigns it to legsum2. The 0.25 appearing in the

module is the n = 0 term added to the sum.

legsum2@h_, k_D := Module@ 8 i<, 0.25 + Sum@N@Co2@@iDDD * LegendreP@i, hD, 8 i, 1 , k<DD

We define a function graph[k] which graphs the kth partial sum in red and the original function in blue. Then we use a Do loop

to construct a sequence of partial sums. All of the graphs of the sequence are collected in a Manipulate panel.

graph@k_D := Plot@ 8 y@hD, legsum2@h, kD<, 8 h, - 1 , 1 <, PlotRange Ø 8 - 1.1, 1.1<,

PlotStyle Ø 88 RGBColor@ 0 , 0 , 1 D, [email protected]<, 8 RGBColor@ 1 , 0 , 0 D, [email protected]<<,

AxesLabel Ø 8 "h", "yHhL"<, PlotLabel Ø Row@ 8 "k =", PaddedForm@k, 2 D<DD

DynamicModule@ 8 mangraph, i<, Do@mangraph@iD = graph@iD, 8 i, 0 , 10 , 1 <D;

Manipulate@mangraph@iD, 8 i, 0 , 10 , 1 <DD

i

  • 1.0 - 0.5 0.5 1.

h

yHhL

k = 0

We see that in this case, the convergence is very rapid. For convergence to graphical accuracy, 10 terms are sufficient.

There is far less flailing around at the endpoints than in the previous case. For visualization in the printed version of this note-

book, we print out every other graph.

If we recast this in terms of the original variable f, where h = cosf and f (h) = f (cosf) = g (f), we get

g HfL = ‚

n= 0

C

n

P

n HcosfL , where C n

H 2 n + 1 L

0

p

g HfL P n HcosfL sinf „ f.

As the notation suggests, the coefficients C n

are the same in the expansions (38) and (39).

We will now use these expansions in solving the Laplace equation.

3. Examples of Solutions of Laplace's Equation

ü 3.1 Interior of a Sphere

For our first example, we find the electrostatic potential F inside a sphere of radius a , when the potential on the boundary

is a particularly simple given function. The problem statement is given below.

r

2

¶∂ r

r

2

¶∂ F

¶∂ r

r

2

sinf

¶∂ f

sinf

¶∂ F

¶∂ f

= 0 , r < a , and 0 § f § p ,

with F H a , fL = g HfL = F 0 H 1 + 2 cos HfL + 3 cos H 2 fL L,

where F 0

is a constant. This is a situation in which the formulas (13) are particularly useful. With those formulas, we may

express each of the three angular harmonics in (40) in terms of the Legendre polynomials with argument cosf. The result is

g HfL = F 0

H 2 P

1

HcosfL + 4 P 2

HcosfLL.

The separated solutions are given by equation (3). The solutions with negative powers of r are singular at the origin and are thus

not suitable for the potential inside the sphere. We superpose all of the solutions with non-negative powers to get F:

F H r , fL = ‚

n= 0

A

n r

n

P n HcosfL.

We now imposed the boundary condition:

F

0

H 2 P

1

HcosfL + 4 P 2

HcosfLL = ‚

n= 0

A

n

a

n P n

HcosfL,

which gives

A

1

= 2 F

0

ê a , A 2

= 4 F

0

ë a

2

, and all other A n

The solution is then

F H r , fL = 2 F ( 45 ) 0 AH r ê a L P 1 HcosfL + 2 H r ê a L

2

P 2 HcosfL.

For our second example, we find the electrostatic potential F inside a sphere of radius a , when the potential on the

boundary is the step function g (f) = V 0

for 0 bf b p/2, and - V 0

for p/2 < f b p. The problem statement is

r

2

¶∂ r

r

2

¶∂ F

¶∂ r

r

2 sinf

¶∂ f

sinf

¶∂ F

¶∂ f

= 0 , r < a , and 0 § f § p ,

with F H a , fL = V 0

for 0 § f §

p

and F H a , fL = - V 0

for

p

< f § p.

The separated solutions are given by equation (3). The solutions with negative powers of r are singular at the origin and are thus

not suitable for the potential inside the sphere. We superpose all of the solutions with non-negative powers to get F:

F H r , fL = ‚

n= 0

A

n

r

n

P n

HcosfL.

Imposing the boundary condition, we get

F H a , fL = ‚

n= 0

A

n a

n

P n HcosfL.

Apart from the factor of the voltage V 0 , the boundary function in this case is the function expanded in the first example of section

2.3, and we found there the coefficents C n for the expansion. (The numerical values of the coefficients were stored in the array

Co.) Thus

A

n a

n

= V 0

C

n

where C n is given by equation (32), and is equal to Co[[n]]. Then the kth partial sum of the series for F is given by

Fsum@r_, f_, k_D := V0 SumAHr ê aL

i Co@@iDD LegendreP@i, Cos@fDD, 8 i, 1 , k<E

We look at the first few partial sums.

Fsum@r, f, 1 D

3 r V0 Cos@fD

2 a

Fsum@r, f, 3 D

V

3 r Cos@fD

2 a

7 r

3 I- 3 Cos@fD + 5 Cos@fD

3 M

16 a

3

Fsum@r, f, 5 D

V

3 r Cos@fD

2 a

7 r

3 I- 3 Cos@fD + 5 Cos@fD

3 M

16 a

3

11 r

5 I 15 Cos@fD - 70 Cos@fD

3

  • 63 Cos@fD

5 M

128 a

5

In order to evaluate our solution in detail, we choose some specific values for the sphere radius a , and the boundary

voltage V 0

. We take

a = 2.0 H m L; V0 = 5.0 H volts L;

First we check our boundary condition. We plot the voltage on the surface r = a of the sphere. We use terms up to n = 51 in the

series, using the coefficients that we calculated earlier. We ask for 200 sample points rather than accepting the default of 25.

The plot takes a very long time because of all the evaluations of both the P n

's and the cosines.

p

4

p

2

3 p

4

p

f

  • 4
  • 2

2

4

FH 1 ,fL

k = 5

p

4

p

2

3 p

4

p

f

  • 4
  • 2

2

4

FH 1 ,fL

k = 11

p

4

p

2

3 p

4

p

f

  • 4
  • 2

2

4

FH 1 ,fL

k = 17

The three curves are graphically identical, as you can see by animating the sequence. Thus at this value of r , the solution is well-

represented by three nonzero terms.

ü 3.2 Exterior of a Sphere

We consider in this section the solution of Laplace's equation exterior to a sphere of radius a , with the boundary condi-

tion on the sphere being the same as the one in the preceeding problem. The full problem statement is given below.

r

2

¶∂ r

r

2

¶∂ F

¶∂ r

r

2 sinf

¶∂ f

sinf

¶∂ F

¶∂ f

= 0 , r > a , and 0 § f § p ,

with F H a , fL = V 0

for 0 § f §

p

and F H a , fL = - V 0

for

p

< f § p ,

and F H r , fL ö

r

The separated solutions are given by equation (3). Because of the condition at ¶, only the negative powers of r may be used in

this region exterior to a sphere. We superpose all of those solutions to get F:

The separated solutions are given by equation (3). Because of the condition at ¶, only the negative powers of r may be used in

this region exterior to a sphere. We superpose all of those solutions to get F:

F H r , fL = ‚

n= 0

B

n

r

  • H n + 1 L

P n

HcosfL.

Apart from the factor of the voltage V 0

, the boundary function is the function expanded in the first example of section 2.3, and

the coefficients C n were obtained in that section. Then imposing the boundary condition we get

F H a , fL = V 0

n= 0

C

n

P

n

HcosfL = ‚

n= 0

B

n

a

  • H n + 1 L

P n

HcosfL,

so B ( 53 ) n

a

  • H n + 1 L

= V 0

C

n

where C n is given by equation (32). The numerical values of the coefficients are stored in the array Co[[n]] (except for the first

coefficient which is zero in this case). Then the kth partial sum of the series for F is given by

Fsum2@r_, f_, k_D := V0 SumAHa ê rL

i+ 1

Co@@iDD LegendreP@i, Cos@fDD, 8 i, 1 , k<E

We look at the first term in the series after clearing the numerical values assigned earlier to a and V 0

Clear@a, V0D;

Fsum2@r, f, 1 D

3 a

2 V0 Cos@fD

2 r

2

For r p a this is a reasonable approximation to the entire solution, because the omitted terms are higher inverse powers of r.

Thus when we are far from the sphere it looks like a dipole. Higher approximations are obtained by keeping more terms.

Fsum2@r, f, 3 D

V

3 a

2 Cos@fD

2 r

2

7 a

4 I- 3 Cos@fD + 5 Cos@fD

3

M

16 r

4

Fsum2@r, f, 5 D

V

3 a

2 Cos@fD

2 r

2

7 a

4 I- 3 Cos@fD + 5 Cos@fD

3

M

16 r

4

11 a

6 I 15 Cos@fD - 70 Cos@fD

3

  • 63 Cos@fD

5

M

128 r

6

ü 3.3 The Region Between Two Concentric Spheres

As our final example, we consider the region between two concentric spheres, with radii a and b , b > a. We solve the

Laplace equation in the region between the spheres, subject to a boundary condition on each sphere. The problem statement is

given below.

r

2

¶∂ r

r

2

¶∂ F

¶∂ r

r

2 sinf

¶∂ f

sinf

¶∂ F

¶∂ f

= 0 , a < r < b , and 0 § f § p ,

with F H a , fL = g HfL and F Hb, fL = h HfL.

We will specify g and h explicitly shortly. We leave them general now because that makes it easier to see the structure of the

calculation that way. We begin by expanding both g and h in Legendre polynomials. That will make our task easier.

A@n_D := Va I- a

n+ 1 coeff@nD ë Ib

2 n + 1

- a

2 n + 1 MM

B@n_D := Va Ia

n+ 1 b

2 n + 1 coeff@nD ë Ib

2 n + 1

- a

2 n + 1 MM

We now define the kth partial sum of the solution F. We call it Fsum3.

Fsum3@r_, f_, k_D := SumAIA@iD r

**i

  • B@iD r**

- Ii + 1 M M LegendreP@i, Cos@fDD, 8 i, 0 , k<E

We check this by looking at the first two partial sums.

Fsum3@r, f, 1 D

a Va

4 H- a + bL

a b Va

4 H- a + bL r

a

2 b

3 Va

2 I- a

3

  • b

3 M r

2

a

2 r Va

2 I- a

3

  • b

3 M

Cos@fD

Fsum3@r, f, 2 D

a Va

4 H- a + bL

a b Va

4 H- a + bL r

a

2

b

3

Va

2 I- a

3

  • b

3 M r

2

a

2

r Va

2 I- a

3

  • b

3 M

Cos@fD +

1

2

5 a

3 b

5 Va

16 I- a

5

  • b

5 M r

3

5 a

3 r

2 Va

16 I- a

5

  • b

5 M

I- 1 + 3 Cos@fD

2

M

Now we will use our solution to calculate the potential on a sphere half way between our two boundary spheres. In

addition, we will check our boundary conditions on r = a and r = b. We assign numerical values to the parameters:

a = 2 H m L; b = 4 H m L; Va = 10.0 H volts L;

Next we define a function grapher[r,k] which uses the kth partial sum to construct a plot of potential versus f on the sphere of

radius r.

grapher@r_, k_D := PlotBFsum3@r, f, kD, 8 f, 0 , p<,

AxesLabel Ø 8 "f", "FHr,fL"<, PlotLabel Ø Row@ 8 "r =", PaddedForm@N@rD, 84 , 2 <D<D,

PlotRange Ø 80 , 1.1 * Va<, Ticks Ø :: 0 ,

p

4

,

p

2

,

3 p

4

, p>, Automatic>F

Now we use 10 terms in the series, and we construct a sequence of 6 plots going in equal r -increments from r = a to r = b.

GraphicsGrid@

Table@ 8 grapher@a + i * Hb - aL ê 5 , 10 D, grapher@a + Hi + 1 L * Hb - aL ê 5 , 10 D<, 8 i, 0 , 5 , 2 <DD

0

p

4

p

2

3 p

4

p

f

2

4

6

8

10

FHr,fL

r = 2.

0

p

4

p

2

3 p

4

p

f

2

4

6

8

10

FHr,fL

r = 2.

0

p

4

p

2

3 p

4

p

f

2

4

6

8

10

FHr,fL

r = 2.

0

p

4

p

2

3 p

4

p

f

2

4

6

8

10

FHr,fL

r = 3.

0

p

4

p

2

3 p

4

p

f

2

4

6

8

10

FHr,fL

r = 3.

0

p

4

p

2

3 p

4

p

f

2

4

6

8

10

FHr,fL

r = 4.

The first and last graphs verify the boundary conditions that we have imposed on the inner and outer sphere. The remaining

graphs show how the solution of the Laplace equation interpolates smoothly between these. We can also use the Manipulate

command. We will construct 21 graphs with r varying in equal increments from the inner to the outer boundary.