# Legendre Polynomials

Some time ago, I wrote a post discussing the solution to Legendre’s ODE. In that post, I discussed what is an alternative definition of Legendre polynomials in which I stated Rodriguez’s formula:

$\displaystyle \frac{1}{2^{p}p!}\frac{d^{p}}{dx^{p}}\bigg\{(x^{2}-1)^{p}\bigg\}, (0.1)$

where

$\displaystyle P_{p}(x)=\sum_{n=0}^{\alpha}\frac{(-1)^{n}(2p-2n)!}{2^{p}{n!}(p-n)!(p-2n)!} (0.2)$,

and

$\displaystyle P_{p}(x)=\sum_{n=0}^{\beta}\frac{(-1)^{n}(2p-2n)!}{2^{p}{n!}(p-n)!(p-2n)!} (0.3)$

in which I have let $\displaystyle \alpha=p/2$ and $\displaystyle \beta=(p-1)/2$ corresponding to the even and odd expressions for the Legendre polynomials.

However, in this post I shall be using the approach of the generating function. This will be from a purely mathematical perspective, so I am not applying this to any particular topic of physics.

Consider a triangle with sides $\displaystyle X,Y.Z$ and angles $\displaystyle \theta, \phi, \lambda$. The law of cosines therefore maintains that

$\displaystyle Z^{2}=X^{2}+Y^{2}-2XY\cos{(\lambda)}. (1)$

We can factor out $\displaystyle X^{2}$ from the left hand side of Eq.(1), take the square root and invert this yielding

$\displaystyle \frac{1}{Z}=\frac{1}{X}\bigg\{1+\bigg\{\frac{Y}{X}\bigg\}^{2}-2\bigg\{\frac{Y}{X}\bigg\}\cos{(\lambda)}\bigg\}^{-1/2}. (2)$

Now, we can expand this by means of the binomial expansion. Let $\displaystyle \kappa \equiv \bigg\{\frac{Y}{X}\bigg\}^{2}-2\bigg\{\frac{Y}{X}\bigg\}\cos{(\lambda)}$, therefore the binomial expansion is

$\displaystyle \frac{1}{(1+\kappa)^{1/2}}=1-\frac{1}{2}\kappa+\frac{3}{8}\kappa^{2}-\frac{5}{16}\kappa^{3}+... (3)$

Hence if we expand this in terms of the sides and angle(s) of the triangle and group by powers of $\displaystyle (y/x)$ we get

$\displaystyle \frac{1}{Z}=\frac{1}{X}\bigg\{1+\bigg\{\frac{Y}{X}\bigg\}\cos{(\lambda)}+\bigg\{\frac{Y}{X}\bigg\}^{2}\frac{1}{2}(3\cos^{2}{(\lambda)}-1)+\bigg\{\frac{Y}{X}\bigg\}^{3}\frac{1}{2}(5\cos^{3}{(\lambda)}-3\cos{(\lambda)}\bigg\}.(4)$

Notice the coefficients, these are precisely the expressions for the Legendre polynomials. Therefore, we see that

$\displaystyle \frac{1}{Z}=\frac{1}{X}\bigg\{\sum_{l=0}^{\infty}\bigg\{\frac{Y}{X}\bigg\}^{l}P_{l}(\cos{(\lambda)}\bigg\}, (5)$

or

$\displaystyle \frac{1}{Z}=\frac{1}{\sqrt[]{X^{2}+Y^{2}-2XY\cos{(\lambda)}}}=\sum_{l=0}^{\infty}\frac{Y^{l}}{X^{l+1}}P_{l}(\cos{(\lambda)}. (6)$

Thus we see that the generating function $\displaystyle 1/Z$ generates the Legendre polynomials. Two prominent uses of these polynomials includes gravity and its application to the theory of potentials of a spherical mass distributions, and the other is that of electrostatics. For example, suppose we have the potential equation

$\displaystyle V(r)=\frac{1}{4\pi\epsilon_{0}}\int_{V}\rho(R)\frac{\hat{\mathcal{R}}}{\mathcal{R_{0}}}d\tau. (7.1)$

We may use the result of the generating function to get the following result for the electric potential due an arbitrary charge distribution

$\displaystyle V(\mathcal{R})=\frac{1}{4\pi\epsilon_{0}}\sum_{l=0}^{\infty}\frac{\mathcal{R}^{l}}{\mathcal{R_{0}}^{l+1}}\int P_{l}(\cos{(\lambda)}). (7.2)$

(For more details, see Chapter 3 of Griffith’s text: Introduction to Electrodynamics.)

# Solution to Legendre’s Differential Equation

Typically covered in a first course on ordinary differential equations, this problem finds applications in the solution of the Schrödinger equation for a one-electron atom (i.e. Hydrogen). In fact, this equation is a smaller problem that results from using separation of variables to solve Laplace’s equation. One finds that the angular equation is satisfied by the Associated Legendre functions. However, if it is assumed that $m=0$ then the equation reduces to Legendre’s equation.

The equation can be stated as

$\displaystyle (1-x^{2})\frac{d^{2}y}{dx^{2}}-2x\frac{dy}{dx}+l(l+1)y(x)=0. (1)$

The power series method starts with the assumption

$\displaystyle y(x)=\sum_{j=0}^{\infty}a_{j}x^{j}. (2)$

Next, we require the first and second order derivatives

$\displaystyle \frac{dy}{dx}=\sum_{j=1}^{\infty}ja_{j}x^{j-1}, (3)$

and

$\displaystyle \frac{d^{2}y}{dx^{2}}=\sum_{j=2}^{\infty}j(j-1)a_{j}x^{j-2}. (4)$

Substitution yields

$\displaystyle (1-x^{2})\sum_{j=2}^{\infty}j(j-1)a_{j}x^{j-2}-2x\sum_{j=1}^{\infty}ja_{j}x^{j-1}+l(l+1)\sum_{j=0}^{\infty}a_{j}x^{j}=0, (5)$

Distribution of the first terms gives

$\displaystyle \sum_{j=2}^{\infty}j(j-1)a_{j}x^{j-2}-\sum_{j=0}^{\infty}j(j-1)a_{j}x^{j}-2ja_{j}x^{j}+l(l+1)a_{j}x^{j}=0, (6)$

where in the second summation term we have rewritten the index to start at zero since the terms for which $j=0,1$ are zero, and hence have no effect on the overall sum. This allows us to write the sum this way. Next, we introduce a dummy variable. Therefore, let $m=j-2\implies j=m+2\implies m+1=j-1$. Thus, the equation becomes

$\displaystyle \sum_{j=0}^{\infty}\bigg\{(j+2)(j+1)a_{j+2}-j(j-1)a_{j}-2ja_{j}+l(l+1)a_{j}\bigg\}x^{j}=0. (7)$

In order for this to be true for all values of j, we require the coefficients of $x^{j}$ equal zero. Solving for $a_{j+2}$ we get

$\displaystyle a_{j+2}=\frac{j(j+1)-l(l+1)}{(j+2)(j+1)}. (8)$

It becomes evident that the terms $a_{2},a_{3},a_{4},...$ are dependent on the terms $a_{0}$ and $a_{1}$. The first term deals with the even solution and the second deals with the odd solution. If we let $p=j+2$ and solve for $a_{p}$, we arrive at the term $a_{p-2}$ and we can obtain the next term $a_{p-4}$. (I am not going to go through the details. The derivation is far too tedious. If one cannot follow there is an excellent video on YouTube that goes through a complete solution of Legendre’s ODE where they discuss all finer details of the problem. I am solving this now so that I can solve more advanced problems later on.) A pattern begins to emerge which we may express generally as:

$\displaystyle a_{p-2n}=\frac{(-1)^{n}(2p-2n)!}{(n!)(2^{p})(p-n)!(p-2n)!}. (9)$

Now, for even terms $0\leq n \leq \frac{p}{2}$ and for odd terms $0 \leq n \leq \frac{p-1}{2}$. Thus for the even solution we have

$\displaystyle P_{p}(x)=\sum_{n=0}^{\frac{p}{2}}\frac{(-1)^{n}(2p-2n)!}{(n!)(2^{p})(p-n)!(p-2n)!}, (10.1)$

and for the odd solution we have

$\displaystyle P_{p}(x)=\sum_{n=0}^{\frac{p-1}{2}}\frac{(-1)^{n}(2p-2n)!}{(n!)(2^{p})(p-n)!(p-2n)!}. (10.2)$

These two equations make up the even and odd solution to Legendre’s equation. They are an explicit general formula for the Legendre polynomials.  Additionally we see that they can readily be used to derive Rodrigues’ formula

$\displaystyle \frac{1}{2^{p}p!}\frac{d^{p}}{dx^{p}}\bigg\{(x^{2}-1)^{p}\bigg\}, (11)$

and that we can relate Legendre polynomials to the Associated Legendre function via the equation

$\displaystyle P_{l}^{m}(x)= (1-x^{2})^{\frac{|m|}{2}}\frac{d^{|m|}P_{l}(x)}{dx^{|m|}}, (12)$

where I have let $p=l$ so as to preserve a more standard notation.  This is the general rule that we will use to solve the associated Legendre differential equation when solving the Schrödinger equation for a one-electron atom.