# Chapter 3: Legendre Polynomials

NOTE: Math will not display properly in Safari - please use another browser

The material covered in this chapter is also presented in Boas Chapter 12, Sections 2, 5, 6, 7, and 8.

## 3.1 Introduction

The simplest distribution of charge in electrostatics involves a single point charge $q$; this is known as a monopole. Next on the ladder of complexity is a dipole, which consists of a positive charge $q$ and a negative charge $-q$ held at a fixed distance from one another. Next up is the quadrupole, which consists of four charges (two positive, two negative) placed on the corners of a rectangle; this can be thought of as two opposing dipoles next to each other. If we go one more step up the ladder we find the octupole, which consists of eight charges (four positive, four negative) and can be viewed as two opposing quadrupoles placed next to each other. These simple configurations are illustrated in Fig.3.1.

A central and beautiful result of electrostatic theory is the statement that any charge distribution, whether discrete or continuous, can be represented as the superposition of a monopole, dipole, quadrupole, octupole, and so on. The idea, which goes under the name of multipole expansion, is captured by Fig.3.2. To make it precise, and understand what it means specifically, requires the machinery of Legendre polynomials, the topic of this chapter. We shall pick this story up again in Sec.3.8, once we have introduced the required tools.

## 3.2 Legendre Polynomials

The Legendre polynomials $P_\ell(x)$ make up an infinite set of functions of the variable $x$. Each function in the set is given a label $\ell$; this is an integer that begins at $\ell = 0$ and ends at $\ell = \infty$. We therefore have a function $P_0(x)$, another function $P_1(x)$, and an infinite number of additional functions belonging to the set of Legendre polynomials. As the name indicates, all these functions are polynomials in $x$.

The definition of the Legendre polynomials is a little curious and quite different from anything you will have encountered in your mathematical education thus far. We first introduce a function $\Phi(x,h)$ of two variables, known as a generating function. The first variable, $x$, is the same variable that appears as the argument of the Legendre polynomials. The second variable, $h$, is an auxiliary variable with no particular meaning. The generating function is defined by

$$\Phi(x,h) := (1 - 2xh + h^2)^{-1/2}. \tag{3.1}$$

The specific form of the generating function will be motivated once we return to the multipole expansion in Sec.3.8. For the time being we simply accept Eq.(3.1) as a definition, however arbitrary it may seem.

Let us, for the moment, think of $x$ as a fixed parameter in Eq.(3.1), and therefore think of $\Phi$ as a function of a single variable $h$. To focus on this dependence we shall write $\Phi = \Phi(h)$, and momentarily forget about the dependence on $x$. Most functions of $h$ can be expanded as a Taylor expansion in powers of $h$, and this is true of $\Phi(h)$. We write

\begin{align} \Phi(h) &= \Phi(0) + \frac{d\Phi}{dh}\biggr|_{h=0}\, h + \frac{1}{2!} \frac{d^2\Phi}{dh^2}\biggr|_{h=0}\, h^2 + \frac{1}{3!} \frac{d^3\Phi}{dh^3}\biggr|_{h=0}\, h^3 + \cdots \nonumber \\ &= \sum_{\ell=0}^\infty \frac{1}{\ell!} \frac{d^\ell\Phi}{dh^\ell}\biggr|_{h=0}\, h^\ell. \tag{3.2} \end{align}

It is no accident that we use the symbol $\ell$ to denote the summation index in the Taylor expansion, which holds the key to the definition of the Legendre polynomials. Before we come to that, we must restore the $x$-dependence of the generating function. This doesn't change the general appearance of the Taylor expansion, except for the fact that derivatives with respect to $h$ must now be properly written as partial derivatives instead of total derivatives. We therefore have

$$\Phi(x,h) = \sum_{\ell=0}^\infty \frac{1}{\ell!} \frac{\partial^\ell\Phi}{\partial h^\ell}\biggr|_{h=0}\, h^\ell. \tag{3.3}$$

It is important to understand that in this expression, the coefficients of the Taylor expansion, given by the partial derivatives of $\Phi$ with respect to $h$ evaluated at $h=0$, depend on $x$ but are independent of $h$.

The Legendre polynomials are precisely defined to be equal to these coefficients. We write

$$\Phi(x,h) = \sum_{\ell=0}^\infty P_\ell(x)\, h^\ell, \tag{3.4}$$

and comparing with the Taylor expansion, we conclude that

$$P_\ell(x) = \frac{1}{\ell!} \frac{\partial^\ell\Phi}{\partial h^\ell}\biggr|_{h=0}. \tag{3.5}$$

To arrive at this conclusion we relied on the fact that if two expansions $\sum_{\ell} a_\ell\, h^\ell$ and $\sum_{\ell} b_\ell\, h^\ell$ are equal to each other for any value of $h$, then we must have $a_\ell = b_\ell$ for all values of $\ell$. Equation (3.4) is the formal definition of the Legendre polynomials. It captures the main idea that they are identified as the coefficients in the Taylor expansion of the generating function about $h=0$; because the Taylor expansion formally involves an infinite number of terms, we have an infinite number of coefficients, and therefore an infinite set of functions of $x$. Equation (3.5) provides an explicit link with the partial derivatives of $\Phi(x,h)$.

Let us use Eq.(3.5) to calculate the first few polynomials. For $\ell = 0$ we are instructed to take no derivatives, and to evaluate the generating function at $h = 0$. This gives $P_0(x) = 1$; the zeroth polynomial is actually a constant. Moving on to $\ell = 1$, we must differentiate $\Phi$ once with respect to $h$, which yields

$$\frac{\partial \Phi}{\partial h} = (x-h)(1-2xh+h^2)^{-3/2} \tag{3.6}$$

after simplification. Evaluating this at $h=0$ and dividing by $1! = 1$ gives $P_1(x) = x$. For $\ell = 2$ we differentiate $\Phi$ twice, and get

$$\frac{\partial^2 \Phi}{\partial h^2} = (3x^2-1-4xh+2h^2)(1-2xh+h^2)^{-5/2} \tag{3.7}$$

after simplification. Evaluating this at $h=0$ and dividing by $2! = 2$ produces $P_2(x) = \frac{1}{2}(3x^2 - 1)$. We can just keep going like this, and generate any number of polynomials. The calculations, however, become progressively tedious, and as we shall see below, more convenient methods are available to generate Legendre polynomials beyond $\ell = 2$.

Exercise 3.1: Verify the previous expressions for $\partial \Phi/\partial h$ and $\partial^2 \Phi/\partial h^2$.

The first few Legendre polynomials are given by

\begin{align} P_0 &= 1 \tag{3.8a} \\ P_1 &= x \tag{3.8b} \\ P_2 &= \frac{1}{2}(3x^2 - 1) \tag{3.8c} \\ P_3 &= \frac{1}{2}(5x^3 - 3 x) tag{3.8d} \\ P_4 &= \frac{1}{8}(35x^4 - 30x^2 + 3) \tag{3.8e} \\ P_5 &= \frac{1}{8}(63x^5 - 70x^3 + 15x) \tag{3.8f} \\ P_6 &= \frac{1}{16}(231x^6 - 315x^4 + 105x^2 - 5). \tag{3.8g} \end{align}

These are plotted in Fig.3.3

A few properties can be seen to emerge from this partial listing. First, the largest power of $x$ contained in $P_\ell(x)$ is always $x^\ell$ (multiplied by a numerical coefficient). Second, when $\ell$ is even, $P_\ell(x)$ contains only even powers of $x$, starting with $x^\ell$ and ending with $x^0$. Third, when $\ell$ is odd, $P_\ell(x)$ contains only odd powers of $x$, starting with $x^\ell$ and ending with $x$. It follows from the last two observations that $P_\ell(x)$ is an even function of $x$ when $\ell$ is even, and an odd function of $x$ when $\ell$ is odd.

Another property that can gleaned from the listing of Eqs.(3.8) is the fact that the polynomials always evaluate to $1$ when $x=1$:

$$P_\ell(1) = 1. \tag{3.9}$$

The even and odd nature of the polynomials then implies that $P_\ell(-1) = 1$ when $\ell$ is even, and $P_\ell(-1) = -1$ when $\ell$ is odd; these statements can be summarized in the single equation

$$P_\ell(-1) = (-1)^\ell. \tag{3.10}$$

It is actually easy to prove that Eq.(3.9) is true for all Legendre polynomials, not just the first few listed in Eqs.(3.8). This can be done by inserting $x=1$ in the defining relation of Eq.(3.4), taking into account that $\Phi(1,h) = (1-2h+h^2)^{-1/2} = (1-h)^{-1}$. We have

$$\frac{1}{1-h} = \sum_{\ell=0}^\infty P_\ell(1)\, h^\ell, \tag{3.11}$$

and $P_\ell(1)$ is identified as the set of coefficients in the Taylor expansion of the function $(1-h)^{-1}$. But it is known that

$$\frac{1}{1-h} = 1 + h + h^2 + h^3 + \cdots = \sum_{\ell=0}^\infty h^\ell, \tag{3.12}$$

and equality of the two expansions for any $h$ guarantees that $P_\ell(1) = 1$, as claimed.

Exercise 3.2: Verify that the Taylor expansion of $(1-h)^{-1}$ is given by $1 + h + h^2 + h^3 + \cdots$. The easiest way is to multiply both sides of the equation by $(1-h)$ and prove that the right-hand side evaluates to $1$, as required.

## 3.3 Recursion Relations

We shall prove that the Legendre polynomials satisfy the recursion relation

$$\ell P_\ell(x) = (2\ell-1) x P_{\ell-1}(x) - (\ell-1) P_{\ell-2}(x). \tag{3.13}$$

This equation is enormously useful, because it provides us with a very efficient means to generate any number of Legendre polynomials. Suppose, for example, that we have computed $P_0 = 1$ and $P_1 = x$ by exploiting the definition (as we did previously), but that we have no knowledge of the higher-order polynomials. By setting $\ell = 2$ in Eq.(3.13) we can generate $P_2$ with very little effort; the equation gives $2P_2 = 3xP_1 - P_0 = 3x^2 - 1$, or $P_2 =\frac{1}{2}(3x^2 - 1)$. And now that $P_1$ and $P_2$ are known, we can set $\ell =3$ in Eq.(3.13) to obtain $P_3$; we get $3 P_3 = 5x P_2 - 2P_1 = \frac{5}{2}x(3x^2-1) - 2x = \frac{3}{2}(5x^3 - 3x)$, so that $P_3 = \frac{1}{2}(5x^3 - 3x)$, in agreement with the listing of Eqs.(3.8). The recursion relation can be iterated any number of times to generate any number of Legendre polynomials. It is truly a wonderful tool, since the alternative method would involve taking a large number of derivatives of the generating function, which soon becomes unpleasant.

Exercise 3.3: Use the recursion relation to calculate $P_4$, $P_5$, and $P_6$, and make sure that your results agree with Eqs.(3.8).

The recursion relation of Eq.(3.13) can be used to prove that the properties of the Legendre polynomials, identified previously for $\ell \leq 6$ on the basis of Eqs.(3.8), actually hold for all values of $\ell$. The proof is an application of the method of induction.

The first property we identified was that the largest power of $x$ that appears in $P_\ell$ is $x^\ell$. Let us assume that the property is known to hold for all values of $\ell$ up to some limiting value that we denote $\ell^*$; for the listing of Eqs.(3.8) we have that $\ell^* = 6$. We can use the recursion relation to prove that the property continues to hold for the next value of $\ell$. We set $\ell = \ell^*+1$ in Eq.(3.13) and notice that the right-hand side involves $x P_{\ell^*}$ and $P_{\ell^*-1}$, both multiplied by a numerical coefficient. We know that the largest power of $x$ in $P_{\ell^*}$ is $x^{\ell^*}$, and multiplication by $x$ turns this into $x^{\ell^*+1} = x^\ell$. The largest power of the second term is $x^{\ell^*-1} = x^{\ell-2}$, and this is a smaller power than for the first term. The recursion relation therefore reveals that the largest power of $x$ in $P_\ell$ is $x^\ell$ when $\ell = \ell^*+1$. At this stage the property is established for all values of $\ell$ up to $\ell^* + 1$, and additional iterations of the recursion relation allow us to keep on increasing the limiting value of $\ell$. The recursive process has no endpoint, and we can conclude that the property will continue to hold for all values of $\ell$, all the way to infinity.

Exercise 3.4: Use induction and the recursion relation of Eq.(3.13) to convince yourself that for all values of $\ell$, $P_\ell(x)$ is an even (odd) function of $x$ when $\ell$ is even (odd).

The proof of Eq.(3.13) relies on the generating function $\Phi(x,h)$ and the defining relation of Eq.(3.4). The generating function was given explicitly in Eq.(3.1), and its partial derivative with respect to $h$ was calculated in Eq.(3.6). These equations imply

$$(1-2xh+h^2) \frac{\partial \Phi}{\partial h} = (x-h) \Phi, \tag{3.14}$$

and this can be turned into a useful identity by inserting Eq.(3.4) and its derivative with respect to $h$, given by

$$\frac{\partial \Phi}{\partial h} = \sum_{\ell=1}^\infty \ell P_\ell(x)\, h^{\ell-1}; \tag{3.15}$$

we indicate that the sum begins at $\ell=1$ instead of $\ell=0$ as in Eq.(3.4), because the term with $\ell = 0$ obviously vanishes. For the left-hand side of Eq.(3.14) we get

\begin{align} (1-2xh+h^2) \frac{\partial \Phi}{\partial h} &= (1-2xh+h^2) \sum_{\ell=1}^\infty \ell P_\ell\, h^{\ell-1} \nonumber \\ &= \sum_{\ell=1}^\infty \ell P_\ell\, h^{\ell-1} - 2x \sum_{\ell=1}^\infty \ell P_\ell\, h^{\ell} +\sum_{\ell=1}^\infty \ell P_\ell\, h^{\ell+1}. \tag{3.16} \end{align}

We notice that the three sums feature different powers of $h$, and we would like to re-express them so as to consolidate the powers. We leave the first sum alone, but rewrite the second and third sums as

$\sum_{\ell'=1}^\infty \ell' P_{\ell'}\, h^{\ell'}, \qquad \sum_{\ell'=1}^\infty \ell' P_{\ell'}\, h^{\ell'+1},$

denoting the summation index by $\ell'$ instead of $\ell$; this clearly does not alter the value of the sum. In the second sum we write $\ell' = \ell - 1$, replacing the summation index by a new $\ell$, which is not to be confused with the original $\ell$; this gives us

$\sum_{\ell=2}^\infty (\ell-1) P_{\ell-1}\, h^{\ell-1},$

where we must be careful to start the sum at $\ell=2$, the value of $\ell$ that properly corresponds to $\ell'=1$. For the third sum we write $\ell' = \ell -2$ and express it as

$\sum_{\ell=3}^\infty (\ell-2) P_{\ell-2}\, h^{\ell-1}.$

Putting all this together, we have that

$$(1-2xh+h^2) \frac{\partial \Phi}{\partial h} = \sum_{\ell=1}^\infty \ell P_\ell\, h^{\ell-1} - 2x \sum_{\ell=2}^\infty (\ell-1) P_{\ell-1}\, h^{\ell-1} + \sum_{\ell=3}^\infty (\ell-2) P_{\ell-2}\, h^{\ell-1}, \tag{3.17}$$

with all sums featuring the same powers of $h$. Further consolidation is possible if we join the three sums into a single one. For this step we must pay attention to the fact that the sums begin at different values of $\ell$. To work around this we re-express the first sum as

$P_1 + 2P_2\, h + \sum_{\ell=3}^\infty \ell P_\ell\, h^{\ell-1},$

the second sum as

$P_1\, h + \sum_{\ell=3}^\infty (\ell-1) P_{\ell-1}\, h^{\ell-1},$

and leave the third sum alone. Putting all this together and simplifying, we finally arrive at

\begin{align} (1-2xh+h^2) \frac{\partial \Phi}{\partial h} &= P_1 + (2 P_2 - 2x P_1) h \nonumber \\ & \quad \mbox{} + \sum_{\ell=3}^\infty \bigl[ \ell P_\ell - 2(\ell-1) x P_{\ell-1} + (\ell-2) P_{\ell-2} \bigr] h^{\ell-1} \tag{3.18} \end{align}

for the left-hand side of Eq.(3.14).

Exercise 3.5: Make sure that you can reproduce all the steps that led to Eq.(3.18).

Moving on to the right-hand side of Eq.(3.14), we insert Eq.(3.4) and go through similar manipulations. We find

\begin{align} (x-h) \Phi &= (x-h) \sum_{\ell=0}^\infty P_\ell\, h^\ell \nonumber \\ &= x \sum_{\ell'=0}^\infty P_{\ell'}\, h^{\ell'} - \sum_{\ell'=0}^\infty P_{\ell'}\, h^{\ell' + 1} \nonumber \\ &= x \sum_{\ell=1}^\infty P_{\ell-1}\, h^{\ell-1} - \sum_{\ell=2} P_{\ell-2}\, h^{\ell - 1} \nonumber \\ &= x( P_0 + P_1\, h) + x \sum_{\ell=3}^\infty P_{\ell-1}\, h^{\ell-1} - P_0\, h - \sum_{\ell=3} P_{\ell-2}\, h^{\ell - 1} \nonumber \\ &= x P_0 + (x P_1 - P_0)\, h + \sum_{\ell = 3}^\infty \bigl( x P_{\ell-1} - P_{\ell-2} \bigr) h^{\ell - 1}. \tag{3.19} \end{align}

Exercise 3.6: Make sure that you can reproduce all the steps that led to Eq.(3.19).

The hard work is over. In Eqs.(3.19) and (3.18) we have two expansions in powers of $h$ that are known to be equal to each other by virtue of Eq.(3.14). Because equality is guaranteed for any value of $h$, the expansion coefficients of the left-hand side must all be equal to those of the right-hand side. At order $h^0$ this gives us $P_1 = x P_0$, or $x=x$, which is obviously true. At order $h^1$ we get $2P_2 - 2x P_1 = xP_1 - P_0$, or $x^2 -1 = x^2 - 1$. The higher orders are more informative. We get

$$\ell P_\ell - 2(\ell-1) x P_{\ell-1} + (\ell-2) P_{\ell-2} = x P_{\ell-1} - P_{\ell-2}, /tag{3.20}$$

which reduces to the recursion relation of Eq.(3.13) after simplification.

## 3.4 Recursion Relation II

The Legendre polynomials satisfy a number of additional recursion relations,

\begin{align} &P'_{\ell+1} - 2x P'_{\ell} + P'_{\ell-1} = P_\ell, /tag{3.21a} \\ & P'_{\ell+1} - P'_{\ell-1} = (2\ell+1) P_\ell, \tag{3.21b} \\ & P'_{\ell+1} - x P'_{\ell} = (\ell+1) P_\ell, \tag{3.21c}\\ & P'_{\ell-1} - x P'_{\ell} = -\ell P_\ell, \tag{3.21d} \\ & (1-x^2) P'_\ell = \ell P_{\ell-1} - \ell x P_\ell, \tag{3.21e} \end{align}

in which a prime indicates differentiation with respect to $x$. These relations, unlike the original one of Eq.(3.13), feature derivatives of the Legendre polynomials.

We establish Eq.(3.21a) by following steps very similar to those outlined in Sec.3.3. We again begin with the generating function $\Phi(x,h) = (1-2xh+h^2)^{-1/2}$, but this time we differentiate it with respect to $x$, which yields $\partial \Phi/\partial x = h (1-2xh+h^2)^{-3/2}$. This gives rise to the identity

$$(1-2xh+h^2) \frac{\partial \Phi}{\partial x} = h \Phi, \tag{3.22}$$

which shall play the same role here as Eq.(3.14) in the derivation of Eq.(3.13). Inserting Eq.(3.4) on the left-hand side and going through the familiar manipulations, we get

\begin{align} (1-2xh+h^2) \frac{\partial \Phi}{\partial x} &= (1-2xh+h^2) \sum_{\ell=0}^\infty P'_\ell\, h^\ell \nonumber \\ &  = \sum_{\ell'=0}^\infty P'_{\ell'}\, h^{\ell'} -2 x \sum_{\ell=0}^\infty P'_\ell\, h^{\ell+1} + \sum_{\ell'=0}^\infty P'_{\ell'}\, h^{\ell'+2} \nonumber \\ &  = \sum_{\ell=-1}^\infty P'_{\ell+1}\, h^{\ell+1} -2 x \sum_{\ell=0}^\infty P'_\ell\, h^{\ell+1} + \sum_{\ell=1}^\infty P'_{\ell-1}\, h^{\ell+1} \nonumber \\ & = P'_0 + P'_1\, h + \sum_{\ell=1}^\infty P'_{\ell+1}\, h^{\ell+1} - 2 x P'_0\, h - 2 x \sum_{\ell=1}^\infty P'_\ell\, h^{\ell+1} + \sum_{\ell=1}^\infty P'_{\ell-1}\, h^{\ell+1} \nonumber \\ &  = P'_0 + (P'_1 - 2x P'_0) h + \sum_{\ell=1}^\infty \bigl( P'_{\ell+1} - 2x P'_{\ell} + P'_{\ell-1} \bigr) h^{\ell + 1}. \tag{3.23} \end{align}

For the right-hand side we get

$$h \Phi = h \sum_{\ell =0}^\infty P_{\ell}\, h^{\ell} = \sum_{\ell =0}^\infty P_{\ell}\, h^{\ell +1} = P_0\, h + \sum_{\ell =1}^\infty P_{\ell}\, h^{\ell +1}. \tag{3.24}$$

Equating both sides informs us that $P'_0 = 0$, which we already knew, as well as $P'_1 - 2x P'_0 = P_0$, which merely states that $1=1$. The higher-order terms return Eq.(3.21a).

Exercise 3.7: Make sure that you can reproduce all the steps involved in the derivation of Eq.(3.21a).

$$\ell ' P_{\ell '} = (2\ell '-1) x P_{\ell '-1} - (\ell '-1) P_{\ell '-2} \tag{3.25}$$

In this we set $\ell' = \ell + 1$, and get

$$(2\ell+1) x P_\ell = (\ell+1) P_{\ell+1} + \ell P_{\ell - 1} \tag{3.26}$$

after simplification and a slight re-arrangement. We next differentiate with respect to $x$ and multiply by 2:

$$2(2\ell+1) x P'_\ell + 2(2\ell+1) P_\ell = 2(\ell+1) P'_{\ell+1} + 2\ell P'_{\ell-1}. \tag{3.27}$$

For the final step we multiply Eq.(3.21a) by $2\ell+1$,

$$2(2\ell+1) x P'_{\ell} + (2\ell+1) P_\ell = (2\ell+1) P'_{\ell+1} + (2\ell+1) P'_{\ell-1}, \tag{3.28}$$

and subtract the two equations. This leaves us with Eq.(3.21b) after a bit of simplification.

Exercise 3.8: Go through all the steps involved in the derivation of Eq.(3.21b).

Equation (3.21c) follows immediately after adding Eq.(3.21a) to Eq.(3.21b) and dividing by $2$. To get Eq.(3.21d) we subtract the equations instead. Finally, to establish Eq.(3.21e) we replace $\ell$ by $\ell - 1$ in Eq.(3.21c),

$$P'_\ell - x P'_{\ell-1} = \ell P_{\ell-1}, /tag{3.29}$$

multiply Eq.(3.21d) by $x$,

$$-x^2 P'_\ell + x P'_{\ell-1} = -\ell x P_\ell, \tag{3.30}$$

Exercise 3.9: You know what to do.

## 3.5 Legendre's Equation

The Legendre polynomials satisfy the second-order differential equation

$$(1-x^2) P''_\ell - 2x P'_\ell + \ell(\ell+1) P_\ell = 0. \tag{3.31}$$

This can also be expressed in the alternative form

$$\frac{d}{dx} \biggl[ (1-x^2) \frac{dP_\ell}{dx} \biggr] + \ell(\ell+1) P_\ell = 0, \tag{3.32}$$

as you can quickly verify by expanding the first term on the left-hand side of the equation. Either form of the differential equation is known as Legendre's equation. It is a very important equation of mathematical physics, with applications in many different fields.

Exercise 3.10: Verify that $P_0$, $P_1$, $P_2$, and $P_3$ are all solutions to Eq.(3.31).

To arrive at Eq.(3.31) we begin with Eq.(3,21e),

$$(1-x^2) P'_\ell - \ell P_{\ell-1} + \ell x P_\ell = 0,/tag{3.33}$$

which we differentiate with respect to $x$. This gives

$$(1-x^2) P''_\ell - 2x P'_\ell - \ell P'_{\ell-1} + \ell x P'_\ell + \ell P_\ell = 0, /.tag{3.34}$$

and we eliminate the term involving $P'_{\ell-1}$ by making use of Eq.(3.21e). A bit of simplification returns Legendre's equation.

Exercise 3.11: Make sure you can recover Eq.(3.31) from Eq.(3.21e).

In many textbook presentations of the Legendre polynomials, the differential equation is stated first (with whatever motivation), and the polynomials $P_\ell(x)$ are shown to be solutions to that differential equation. We shall have more to say about this point of view in Sec.3.9. For our purposes here we have preferred to define the polynomials first, with the help of the generating function, and to derive Legendre's equation as a consequence of the definition.

## 3.6 Orthogonal Functions

We now interrupt the development of the main topic (Legendre polynomials) to introduce the concept of orthogonal functions. The notion of orthogonality is familiar in the context of vectors; here we wish to generalize it to the context of functions.

In ordinary, three-dimensional space, two vectors $\boldsymbol{A}$ and $\boldsymbol{B}$ are orthogonal when

$$0 = \boldsymbol{A} \cdot \boldsymbol{B} = \sum_{j=1}^3 A_j B_j; \tag{3.35}$$

we make use of the component notation for vectors, writing, for example, $A_1 := A_x$, $A_2 := A_y$, and $A_3 := A_z$. It is easy to generalize this notion of orthogonality to a higher-dimensional space. Indeed, in an $n$-dimensional space, the vectors $\boldsymbol{A}$ and $\boldsymbol{B}$, each possessing $n$ components, would be declared orthogonal when

$$0 = \sum_{j=1}^n A_j B_j. \label{eq3:vector_ortho} \tag{3.36}$$

This expression can be used to motivate a generalization from vectors to functions.

Let us imagine replacing the vector index $j$, which jumps discontinuously as it runs from $j=1$ to $j = n$, by a continuous variable $x$. At the same time, let us imagine replacing the vector components $A_j$ and $B_j$ by the values of two functions, $A(x)$ and $B(x)$. Just as the finite number of distinct values of $j$ have been replaced by an infinity of values for $x$, the finite number of vector components $A_j$ have been replaced by an infinity of values for the function $A(x)$. In this generalization, it seems appropriate to replace the discrete sum over $j$ by a continuous sum over the variable $x$. This, of course, defines an integral, and the functions $A(x)$ and $B(x)$ shall be declared to be orthogonal when $0 = \int A(x) B(x)\, dx$.

A final ingredient is required to make this generalized notion of orthogonality well defined: we must specify the domain of integration. We shall thus adopt the following definition: Two functions $A(x)$ and $B(x)$, defined over an interval going from $x=a$ to $x=b$, are orthogonal on that interval when

$$\int_a^b A(x) B(x)\, dx = 0. \tag{3.37}$$

The specification of the interval is important. In general, two functions that are orthogonal on a given interval will not be orthogonal on other intervals. The integral

$$N[A] := \int_a^b \bigl[ A(x) \bigr]^2\, dx \tag{3.38}$$

is known as the norm of the function $A(x)$ on the interval $(a,b)$, by analogy with the norm of a vector $\boldsymbol{A}$, defined by $|\boldsymbol{A}|^2 = \sum_j A_j A_j$.

This notion of functional orthogonality can be generalized further. It can, for example, be extended to functions of more than one variable. It can also be extended to complex functions. In this case we would say that two complex functions $f(x)$ and $g(x)$ are orthogonal on an interval $(a, b)$ when

$$\int_a^b f^*(x) g(x)\, dx = 0, \tag{3.39}$$

where the asterisk indicates complex conjugation. Which of two functions is complex conjugated is a matter of choice; the outcome is independent of this choice. The reason for complex conjugation is that in the case of a complex function, the norm is naturally defined by

$$N[f] := \int_a^b |f(x)|^2\, dx, \tag{3.40}$$

where $|f|^2 = f^* f$, so as to necessarily return a real and positive number.

It is also possible to make the notion of functional orthogonality more abstract by altering the integral criterion. A frequently encountered generalization of Eq.(3.37) is

$$N[f] := \int_a^b |f(x)|^2\, dx, \tag{3.41}$$

where $|f|^2 = f^* f$, so as to necessarily return a real and positive number.

## 3.7 Orthogonality of Legendre Polynomials

Legendre polynomials form a set of orthogonal functions on the interval $(-1,1)$. We shall indeed prove that

$$\int_{-1}^1 P_\ell(x) P_{\ell'}(x)\, dx = 0 \tag{3.42}$$

when $\ell \neq \ell'$. When $\ell = \ell'$ the integral does not vanish, and we shall see instead that

$$N_\ell := N[P_\ell] = \int_{-1}^1 \bigl[ P_\ell(x) \bigr]^2\, dx =\frac{2}{2\ell + 1}; \tag{3.43}$$

this is the norm of the function $P_\ell(x)$ on the interval $(-1,1)$. Equations (3.42) and (3.43) can be summarized by the single statement

$$\int_{-1}^1 P_\ell(x) P_{\ell'}(x)\, dx = \frac{2}{2\ell + 1}\, \delta_{\ell\ell'}, \tag{3.44}$$

where $\delta_{\ell\ell'}$ is our old friend the Kronecker delta, equal to $1$ when $\ell=\ell'$, and to $0$ when $\ell\neq \ell'$.

To establish Eq.(3.42) we proceed from Legendre's equation, in the form given by Eq.(3.32). We first multiply the equation by $P_{\ell'}$ and get

$$P_{\ell'} \frac{d}{dx} \biggl[ (1-x^2) \frac{dP_{\ell}}{dx} \biggr] + \ell(\ell+1) P_{\ell} P_{\ell'} = 0. \tag{3.45}$$

We next interchange $\ell$ and $\ell'$ and produce a different version of the same equation,

$$P_{\ell} \frac{d}{dx} \biggl[ (1-x^2) \frac{dP_{\ell'}}{dx} \biggr] + \ell'(\ell'+1) P_{\ell} P_{\ell'} =0. \tag{3.46}$$

The next step is to subtract the second equation from the first,

$$P_{\ell'} \frac{d}{dx} \biggl[ (1-x^2) \frac{dP_{\ell}}{dx} \biggr] - P_{\ell} \frac{d}{dx} \biggl[ (1-x^2) \frac{dP_{\ell'}}{dx} \biggr] + \bigl[ \ell(\ell+1) - \ell'(\ell'+1) \bigr] P_{\ell} P_{\ell'} = 0,\tag{3.47}$$

and to write the final result as

$$\frac{d}{dx} \biggl[ P_{\ell'} (1-x^2) \frac{dP_{\ell}}{dx} - P_{\ell} (1-x^2) \frac{dP_{\ell'}}{dx} \biggr] + \bigl[ \ell(\ell+1) - \ell'(\ell'+1) \bigr] P_{\ell} P_{\ell'} = 0, \tag{3.48}$$

with the first two terms consolidated into a total derivative.

Exercise 3.12: Verify that the total derivative in Eq.(3.48) is equal to the first two terms of the preceding equation.

The result displayed in Eq.(3.48) is a direct consequence of Legendre's equation. It is this equation that will lead us to the orthogonality property of the polynomials, and will reveal why the interval had to be $(-1,1)$ and not some other interval. The idea is to integrate Eq.(3.48) over an arbitrary interval $(a,b)$, and see what choice of interval gets us something useful. Integration yields

$$\biggl[ P_{\ell'} (1-x^2) \frac{dP_{\ell}}{dx} - P_{\ell} (1-x^2) \frac{dP_{\ell'}}{dx} \biggr] \biggr|^{b}_{a} + \bigl[ \ell(\ell+1) - \ell'(\ell'+1) \bigr] \int_a^b P_{\ell} P_{\ell'}\, dx = 0, \tag{3.49}$$

and we observe that in general, the boundary terms at $x=a$ and $x=b$ do not vanish; this prevents us from saying anything useful about the remaining integral. But we see that a judicious choice of interval allows us to eliminate the boundary terms: the factor $(1-x^2)$ vanishes at both $x=-1$ and $x=1$, and choosing $(-1,1)$ will force the boundary terms to vanish. With this choice of interval we now have that

$$\bigl[ \ell(\ell+1) - \ell'(\ell'+1) \bigr] \int_{-1}^{1} P_{\ell} P_{\ell'}\, dx = 0. \tag{3.50}$$

When $\ell = \ell'$ the factor in square brackets vanishes, and the equation reduces to $0 = 0$. But when $\ell \neq \ell'$ we obtain the statement of Eq.(3.42), and confirm that distinct Legendre polynomials are orthogonal on $(-1,1)$.

To derive Eq.(3.43) we begin\footnote{This method to derive Eq.(3.13)  is not found in standard textbooks. It was extracted from Sec.4.5 of Special functions and their applications, by N.N.\ Lebedev (Dover Publications, 1972).} with the recursion relation of Eq.(3.13), which we write as

$$\ell P_\ell - (2\ell-1) x P_{\ell-1} + (\ell-1) P_{\ell-2} = 0. \tag{3.51}$$

We produce an alternative form by replacing $\ell$ by $\ell+1$,

$$(\ell+1) P_{\ell+1} - (2\ell+1) x P_{\ell} + \ell P_{\ell-1} = 0. \tag{3.52}$$

Next we multiply the first equation by $(2\ell+1) P_\ell$,

$$\ell (2\ell+1) \bigl( P_\ell \bigr)^2 - (2\ell-1) (2\ell+1) x P_{\ell-1} P_{\ell} + (\ell-1) (2\ell+1) P_{\ell-2} P_{\ell} = 0,\tag{3.53}$$

and multiply the second equation by $(2\ell-1) P_{\ell-1}$,

$$(\ell+1) (2\ell-1) P_{\ell-1} P_{\ell+1} - (2\ell-1) (2\ell+1) x P_{\ell-1} P_{\ell} + \ell (2\ell-1) \bigl(P_{\ell-1})^2 = 0. \tag{3.54}$$

We now subtract the last equation from the preceding one, and cancel out the common terms involving $x P_{\ell-1} P_{\ell}$. This gives

\begin{align} & \ell (2\ell+1) \bigl( P_\ell \bigr)^2 + (\ell-1) (2\ell+1) P_{\ell-2} P_{\ell} \nonumber \\ & \mbox{} - (\ell+1) (2\ell-1) P_{\ell-1} P_{\ell+1} \tag{3.55} \end{align}

In the next step we integrate the equation from $x=-1$ to $x=1$, and invoke the orthogonality of $P_{\ell-2}$ and $P_\ell$ to eliminate the second term, as well as the orthogonality of $P_{\ell-1}$ and $P_{\ell+1}$ to discard the third term. We are left with

$$\ell (2\ell+1) \int_{-1}^1 \bigl( P_\ell \bigr)^2\, dx - \ell (2\ell-1) \int_{-1}^1 \bigl(P_{\ell-1})^2\, dx = 0, \tag{3.56}$$

a relation between the norms of $P_{\ell}$ and $P_{\ell-1}$. In the notation of Eq.(3.43), the relation is

$$N_\ell = \frac{2\ell-1}{2\ell+1} N_{\ell-1}, \tag{3.57}$$

and it takes the form of a recursion relation for $N_\ell$.

To obtain $N_\ell$ we must solve the recursion relation. First, let us set $\ell = 1$ in Eq.(3.57), to get $N_1 = \frac{1}{3} N_0$. If we next set $\ell=2$, we get $N_2 = \frac{3}{5} N_1 = \frac{1}{5} N_0$; notice that the factors of $3$ have cancelled out. Something like this happens again in the next step: With $\ell = 3$ we have that $N_3 = \frac{5}{7} N_2 = \frac{1}{7} N_0$, and this time it is the factors of $5$ that cancel out. A little thought will convince you that this phenomenon keeps on happening, so that after $\ell$ iterations of the recursion relation, we eventually obtain

$$N_\ell = \frac{1}{2\ell+1} N_0. \tag{3.58}$$

We almost have our answer, but we are still missing a value for $N_0$. But this is easy to get: we just calculate it directly as $N_0 = \int_{-1}^1 (P_0)^2\, dx = \int_{-1}^1 dx = 2$. We finally arrive at

$$N_\ell = \frac{2}{2\ell+1}, \tag{3.59}$$

which is the same statement as in Eq.(3.43).

## 3.8 Multipole Expansion

We may now return to the discussion initiated in Sec.3.1. We wish to make precise the idea captured by Fig.3.4, that any charge distribution, whether discrete or continuous, can be represented as the superposition of a monopole, dipole, quadrupole, octupole, and so on. This is the multipole expansion of electrostatics.

For this purpose we examine the electrostatic potential $V$ created by an arbitrary distribution of charge. This, you will recall, is related to the electric field by $\boldsymbol{E} = -\boldsymbol{\nabla} V$, so that the electric field can easily be constructed once we have the potential. You will also recall that the potential is given by

$$V(\boldsymbol{r}) = \frac{1}{4\pi\epsilon_0} \int \frac{\rho(\boldsymbol{r'})}{|\boldsymbol{r}-\boldsymbol{r'}|}\, dV', \tag{3.60}$$

where $\boldsymbol{r}$ designates the position at which the potential is evaluated, $\rho$ is the charge density, a function of position $\boldsymbol{r'}$ inside the distribution, and $dV' := dx' dy' dz'$ is the volume element associated with the variables contained in $\boldsymbol{r'}$. The situation is depicted in Fig.3.4.

To aid with the calculation we introduce some convenient notation. We let $r := |\boldsymbol{r}|$ be the length of the vector $\boldsymbol{r}$, $r' := |\boldsymbol{r'}|$ be the length of the vector $\boldsymbol{r'}$, and we introduce the unit vectors $\boldsymbol{n} := \boldsymbol{r}/r$ and $\boldsymbol{n'} := \boldsymbol{r'}/r'$. The angle between the vectors $\boldsymbol{r}$ and $\boldsymbol{r'}$ is denoted $\gamma$, and we have that $\boldsymbol{n} \cdot \boldsymbol{n'} = \cos\gamma$. For this discussion we shall assume that $r'$ is everywhere smaller than $r$, so that $V$ is evaluated outside the charge distribution.

The integral for the potential features $|\boldsymbol{r}-\boldsymbol{r'}|$, the distance between the points associated with $\boldsymbol{r}$ and $\boldsymbol{r'}$. The square of this is

\begin{align} |\boldsymbol{r}-\boldsymbol{r'}|^2 &= (\boldsymbol{r}-\boldsymbol{r'}) \cdot (\boldsymbol{r}-\boldsymbol{r'}) \nonumber \\ &= \boldsymbol{r} \cdot \boldsymbol{r} - 2 \boldsymbol{r} \cdot \boldsymbol{r'} + \boldsymbol{r'} \cdot \boldsymbol{r'} \nonumber \\ &= r^2 - 2rr' \cos\gamma + r^{\prime 2} \nonumber \\ &= r^2 \bigl[ 1 - 2 \cos\gamma\, (r'/r) + (r'/r)^2 \bigr],\tag{3.61} \end{align}

and we see that the function that appears inside the integral can be expressed as

$$\frac{1}{|\boldsymbol{r}-\boldsymbol{r'}|} = \frac{1}{r} \bigl[ 1 - 2 \cos\gamma\, (r'/r) + (r'/r)^2 \bigr]^{-1/2}. \tag{3.62}$$

It is this expression that reveals the link with the Legendre polynomials. Compare it with Eq.(3.1), which specifies the generating function $\Phi(x,h)$. Do you see the relation? Inspection reveals that if we set $x = \cos\gamma$ and $h = r'/r$, then

$$\frac{1}{|\boldsymbol{r}-\boldsymbol{r'}|} = \frac{1}{r} \Phi(x,h). \tag{3.63}$$

Incorporating Eq.(3.4), which defines the Legendre polynomials, we arrive at the interesting identity

$$\frac{1}{|\boldsymbol{r}-\boldsymbol{r'}|} = \frac{1}{r} \sum_{\ell=0}^\infty P_\ell(\cos\gamma)\, (r'/r)^\ell = \sum_{\ell=0}^\infty \frac{r^{\prime \ell}}{r^{\ell+1}}\, P_\ell(\cos\gamma), \tag{3.64}$$

which relates the distance function to the Legendre polynomials, expressed as functions of $x = \cos\gamma$. It is important to understand that the right-hand side of the equation depends on the variables contained in $\boldsymbol{r'}$ through both $r'$ and $\cos\gamma$.

We can evaluate the potential by inserting Eq.(3.64) into Eq.(3.60). We get

\begin{align} V(\boldsymbol{r}) &= \frac{1}{4\pi\epsilon_0} \int \rho(\boldsymbol{r'}) \Biggl[ \sum_{\ell=0}^\infty\frac{r^{\prime \ell}}{r^{\ell+1}}\, P_\ell(\cos\gamma) \Biggr]\, dV' \nonumber \\ &= \sum_{\ell=0}^\infty \frac{1}{4\pi\epsilon_0} \frac{1}{r^{\ell+1}} \int \rho(\boldsymbol{r'}) r^{\prime \ell} P_\ell(\cos\gamma)\, dV', \tag{3.65} \end{align}

where we took out everything that doesn't belong inside the integral. We put this in the final form of

$$V = \sum_{\ell=0}^\infty V_\ell, \tag{3.66}$$

with

$$V_\ell(\boldsymbol{r}) = \frac{1}{4\pi\epsilon_0} \frac{1}{r^{\ell+1}} \int \rho(\boldsymbol{r'}) r^{\prime \ell} P_\ell(\cos\gamma)\, dV'. \tag{3.67}$$

In the field's lingo, Eq.(3.66) is the multipole expansion of the electrostatic potential $V$, and each term $V_\ell$ in the infinite sum is the potential of a specific multipole. The term with $\ell = 0$ is known as the monopole term, the one with $\ell = 1$ is the dipole term, the quadrupole term corresponds to $\ell = 2$, the octupole term to $\ell = 3$, and so on. The correspondence with the physical multipoles of Fig.3.1 will be made clear as we explore this in more detail.

Let us examine the monopole term in Eq.(3.66). We set $\ell = 0$ in Eq.(3.67), recall that $P_0(\cos\gamma) = 1$, and get

$$V_0 = \frac{1}{4\pi\epsilon_0} \frac{1}{r} \int \rho\, dV'. \tag{3.68}$$

The integral is recognized as $q$, the total charge of the distribution, and we conclude that

$$V_0 = \frac{1}{4\pi\epsilon_0} \frac{q}{r}, \qquad q := \int \rho(\boldsymbol{r'})\, dV'. \tag{3.69}$$

You have seen this before: it is the potential of a single point charge $q$ situated at the origin of the coordinate system. And this is what we called a monopole in Fig.3.1.

Turn next to the dipole term in Eq.(3.66). This time we set $\ell = 1$ in Eq.(3.67), recall that $P_1(\cos\gamma) = \cos\gamma$, and get

$$V_1 = \frac{1}{4\pi\epsilon_0} \frac{1}{r^2} \int \rho\, r' \cos\gamma\, dV'. \tag{3.70}$$

We make this more explicit by writing $r' \cos\gamma = r' (\boldsymbol{n'} \cdot \boldsymbol{n}) = \boldsymbol{r'} \cdot \boldsymbol{n}$, and we take the vector $\boldsymbol{n}$ out of the integral, because it does not depend on the variables contained in $\boldsymbol{r'}$. This gives

$$V_1 = \frac{1}{4\pi\epsilon_0} \frac{1}{r^2} \boldsymbol{n} \cdot \int \rho\, \boldsymbol{r'}\, dV', \tag{3.71}$$

and we put this into its final form by introducing the notation $\boldsymbol{p}$ for the integral. The dipole term becomes

$$V_1 = \frac{1}{4\pi\epsilon_0} \frac{\boldsymbol{n} \cdot \boldsymbol{p}}{r^2}, \qquad \boldsymbol{p} := \int \rho(\boldsymbol{r'})\, \boldsymbol{r'}\, dV', \tag{3.72}$$

and the vector $\boldsymbol{p}$ is known as the {\it dipole moment} of the charge distribution. You will recall that the potential of a physical dipole, as depicted in Fig.3.1, has precisely the form given by $V_1$, with $\boldsymbol{p}$ given by the product of the positive charge with the displacement vector from the negative to the positive charges. The expression of Eq.(3.72), however, applies to an arbitrary charge distribution, and in this context $\boldsymbol{p}$ is defined by the integral. The link with Fig.3.1 is nevertheless clear, because to the $\boldsymbol{p}$ given by the integral we can always associate a physical dipole with the same dipole moment. The multipole expansion is beginning to make sense.

Let us consider one more example, that of the quadrupole term --- we could go on and on, but this shall do. We set $\ell = 2$ in Eq.(3.67), write $P_2(\cos\gamma) = \frac{1}{2} (3\cos^2\gamma-1)$, and get

$$V_2 = \frac{1}{4\pi\epsilon_0} \frac{1}{r^3} \frac{1}{2} \int \rho\, r^{\prime 2} (3\cos^2\gamma-1)\, dV'. \tag{3.73}$$

The factor inside the integral is

$$r^{\prime 2}\bigl[ 3(\boldsymbol{n'} \cdot \boldsymbol{n})^2 - 1 \bigr] =3 (\boldsymbol{r'} \cdot \boldsymbol{n})^2 - r^{\prime 2}, \tag{3.74}$$

and to produce the simplest form for the integral we introduce the component notation $n_j$ and $r'_j$ for the vectors $\boldsymbol{n}$ and $\boldsymbol{r'}$, respectively. To be clear, we note that in the component notation, $n_1 = x/r$, $n_2 = y/r$, and $n_3 = z/r$, while $r'_1 = x'$, $r'_2 = y'$, and $r'_3 = z'$. We write $\boldsymbol{n} \cdot \boldsymbol{r'} = \sum_j n_j r'_j$, so that

$$(\boldsymbol{n} \cdot \boldsymbol{r'})^2 = \Biggl( \sum_{j=1}^3 n_j r'_j \Biggr) \Biggl( \sum_{k=1}^3 n_k r'_k \Biggr) = \sum_{j=1}^3 \sum_{k=1}^3 n_j n_k r'_j r'_k. \tag{3.75}$$

As a convenient trick, we also write

$$r^{\prime 2} = \boldsymbol{r'} \cdot \boldsymbol{r'} = \sum_{j=1}^3 r'_j r'_j = \sum_{j=1}^3 \sum_{k=1}^3 \delta_{jk}r'_j r'_k\tag{3.76}$$

so that both terms inside the integral can be expressed as a double sum. With all this we have

$$3 (\boldsymbol{r'} \cdot \boldsymbol{n})^2 - r^{\prime 2} = \sum_{j=1}^3 \sum_{k=1}^3 (3 n_j n_k - \delta_{jk}) r'_j r'_k, \tag{3.77}$$

and making the substitution inside the integral yields

$$\int \rho\, r^{\prime 2} (3\cos^2\gamma-1)\, dV' = \sum_{j=1}^3 \sum_{k=1}^3 (3 n_j n_k - \delta_{jk}) \int \rho\, r'_j r'_k\, dV'. \tag{3.78}$$

The quadrupole term in the potential can therefore be expressed as

$$V_2 = \frac{1}{4\pi\epsilon_0} \frac{1}{r^3} \frac{1}{2} \sum_{j=1}^3 \sum_{k=1}^3 (3 n_j n_k - \delta_{jk}) Q_{jk}, \qquad Q_{jk} := \int \rho(\boldsymbol{r'})\, r'_j r'_k\, dV'. \tag{3.79}$$

The quantities $Q_{jk}$ form a tensor, and they are collectively known as the quadrupole moment of the charge distribution. To be clear, each index $j$ and $k$ represents a possible choice among $x$, $y$, and $z$; for example, $Q_{xz} = \int \rho\, x' z'\, dV'$. The link with Fig.3.1 is perhaps less obvious in the quadrupole case, but it can be shown that to any quadrupole-moment tensor $Q_{jk}$ we can always associate a system of four point charges (two positive, and two negative) arranged on a rectangle, as shown in the figure. The precise geometry and orientation of the rectangle in three-dimensional space corresponds to the precise collection of components $\{ Q_{xx}, Q_{xy}, Q_{xz}, Q_{yy}, Q_{yz}, Q_{zz} \}$, and the electrostatic potential of this physical quadrupole will have precisely the form displayed in Eq.(3.79).

The multipole expansion of Eq.(3.66) is exact. It shows that the potential outside any distribution of charge is the sum of a monopole term, a dipole term, a quadrupole term, an octupole term, and so on. To each term we can associate a physical multipole, and we have made precise the idea introduced at the beginning of the chapter and illustrated in Fig.3.2, that any charge distribution can be represented as a superposition of multipoles. This is a beautiful result, and a powerful idea. But it is also a practical tool, because of an observation that we have yet to make. Examine Eq.(3.67) closely, and notice that the $\ell$-pole term in the multipole expansion of the potential comes with a factor of $1/r^{\ell+1}$. Schematically, therefore, the expansion takes the form of

$$V = \frac{\text{monopole}}{r} + \frac{\text{dipole}}{r^2} + \frac{\text{qudrupole}}{r^3} + \frac{\text{octupole}}{r^4} + \cdots. \tag{3.80}$$

For an exact representation of $V$ we need an infinite number of terms in the multipole expansion. But when $r$ is sufficiently large, we may well be satisfied with an approximation that retains only a finite number of terms. This approximate potential is much more economical, and the essential details of the charge distribution can be adequately captured by a finite number of multipole moments. At the crudest level the potential would be approximated by $\text{monopole}/r$, and the only aspect of the charge distribution that survives this description is the total charge $q$, a single number. For a better approximation we would also include $\text{dipole}/r^2$, and three more quantities --- the dipole moment $\boldsymbol{p}$ --- would be required to capture the essentials of the charge distribution. An adequate approximation may well require the inclusion of a few more terms, but the main message remains: In any truncation of the multipole expansion, the relevant aspects of the charge distribution are completely captured by a finite number of quantities packaged into multipole moments.

## 3.9 Legendre Functions

As was mentioned back in Sec.3.5, textbook presentations of Legendre polynomials often start with the differential equation

$$(1-x^2) y'' - 2x y' + \ell (\ell +1) y = 0, \tag{3.81}$$

and the polynomial $P_\ell(x)$ is shown to be a solution to the equation. This approach is analogous to one in which we would define $\sin x$ to be a solution to the differential equation $y'' + y = 0$. But we know that this equation admits a second solution, $y = \cos x$. Should we not expect Eq.(3.81) to also possess a second solution? After all, it is a known fact of mathematics that second-order differential equations admit two independent solutions.

The answer is in the affirmative. For each integer $\ell$, Eq.(3.81) admits a second solution, denoted $Q_\ell(x)$ and known as a Legendre function of the second kind. These new solutions are {\it not} polynomials. The first few are given by

\begin{align} Q_0 &= \frac{1}{2} \ln \frac{1+x}{1-x}, \tag{3.82a}\\ Q_1 &= \frac{1}{2} x \ln \frac{1+x}{1-x} - 1, \tag{3.82b}\\ Q_2 &= \frac{1}{4} (3x^2 - 1) \ln \frac{1+x}{1-x} - \frac{3}{2} x, \tag{3.82c} \end{align}

and you can see that they contain logarithms and are definitely not simple polynomials. In fact you can see more than this. Unlike the polynomials $P_\ell(x)$, which are finite everywhere on the interval $(-1,1)$, the functions $Q_\ell(x)$ are all singular at $x = 1$ and $x = -1$, thanks specifically to the logarithms. This is the main distinguishing property between the two classes of solutions to Eq.(3.81).

Exercise 3.13: Verify that $Q_0$, $Q_1$, and $Q_2$ are solutions to Eq.(3.81).

The differential equation (3.81) can be generalized by letting $\ell$ differ from an integer. In this case we would write it as

$$(1-x^2) y'' - 2x y' + \lambda(\lambda+1) y = 0,\tag{3.83}$$

and reserve the notation $\ell$ for integers. Like any other second-order differential equation, this one admits two independent solutions. The first is denoted $P_\lambda(x)$, and is known as a Legendre function of the first kind. The second is denoted $Q_\lambda(x)$, and is known, naturally enough, as a Legendre function of the second kind. In general, the functions $P_\lambda(x)$ are finite at $x=1$, but they blow up at $x=-1$ unless $\lambda$ is an integer (and the functions reduce to the familiar polynomials). The functions $Q_\lambda(x)$ are singular at both $x=-1$ and $x=1$.

This generalized view of Legendre's equation reveals that Eq.(3.81) is distinguished, in that it admits a class of solutions that is regular everywhere on the interval $(-1,1)$, namely our good old Legendre polynomials. The mere change from an integer $\ell$ to an noninteger $\lambda$ completely spoils this property.

## 3.10 Practice Problems

1. (Boas Chapter 12, Section 5, Problem 4) Derive the identity $(x-h) \partial\Phi/\partial x = h \partial\Phi/\partial h$, and find the recursion relation that follows from it.

2. (Boas Chapter 12, Section 5, Problem 9) Express $3x^2 + x - 1$ as a linear combination of Legendre polynomials.

3. (Boas Chapter 12, Section 5, Problem 10) Express $x^4$ as a linear combination of Legendre polynomials.

4. (Boas Chapter 12, Section 5, Problem 12) Express $7x^4 - 3x + 1$ as a linear combination of Legendre polynomials.

5. (Boas Chapter 12, Section 6, Problem 2) Show that the functions $e^{in\pi x/L}$, with $n = 0, \pm 1, \pm 2, \cdots$, are a set of orthogonal functions on $(-L,L)$.

6. (Boas Chapter 12, Section 6, Problem 3) Show that the functions $x^2$ and $\sin x$ are orthogonal on $(-1,1)$.

7. (Boas Chapter 12, Section 6, Problem 5) Evaluate $\int_{-1}^1 P_0(x) P_2(x)\, dx$ directly to show that $P_0(x)$ and $P_2(x)$ are orthogonal on $(-1,1)$.

8. (Boas Chapter 12, Section 7, Problem 5) Calculate $\int_{-1}^1 P_\ell(x)\, dx$ for all integers $\ell$.

9. (Boas Chapter 12, Section 8, Problem 2) Calculate $\int_{-1}^1 [P_2(x)]^2\, dx$ directly, and show that it agrees with Eq.(3.43). Repeat for $P_3(x)$.

## 3.11 Challenge Problems

1. Find an explicit expression for $P_\ell(0)$. You may wish to involve the generating function $\Phi(x,h)$ and make use of the binomial series

\begin{align} (1+z)^\alpha &= 1 + \alpha z + \frac{\alpha(\alpha-1)}{2!} z^2 + \frac{\alpha(\alpha-1)(\alpha-2)}{3!} z^3 + \cdots \nonumber \\ &= \sum_{n=0}^\infty \frac{\alpha(\alpha-1) \cdots (\alpha-n+1)}{n!} z^n. \nonumber \end{align}

Simplify your result by expressing $P_\ell(0)$ in terms of two double factorials. Verify your result with the special cases $\ell = 2, 4, 6$.

2. Evaluate the integral

$\int_{-1}^1 x P_\ell(x) P_{\ell'}(x)\, dx$

for arbitrary values of $\ell$ and $\ell'$. Verify your result with the special cases $\ell = 2$ and $\ell' = 0, 1, 2, 3, 4$.

3. The octupole ($\ell=3$) term in a multipole expansion of the electrostatic potential is given by

$V_3 = \frac{1}{4\pi\epsilon_0} \frac{1}{r^4} \int\rho(\boldsymbol{r'})\, r^{\prime 3} P_3(\cos\gamma)\, dV',$

where $\cos\gamma := \boldsymbol{n} \cdot \boldsymbol{n'}$, with $\boldsymbol{n} := \boldsymbol{r}/r$ and $\boldsymbol{n'} := \boldsymbol{r'}/r'$. Express this octupole potential in terms of the octupole moment tensor of the charge distribution,

$Q_{ijk} := \int \rho(\boldsymbol{r'})\, r'_i r'_j r'_k\, dV',$

where $r'_i$ are the components of the position vector $\boldsymbol{r'}$. Each index $i$, $j$, and $k$ ranges over the values $x$, $y$, and $z$.