Skip to main content
Mathematics LibreTexts

5.3: Fourier-Legendre Series

  • Page ID
    90262
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    In the last chapter we saw how useful Fourier series expansions were for solving the heat and wave equations. In Chapter 6 we will investigate partial differential equations in higher dimensions and find that problems with spherical symmetry may lead to the series representations in terms of a basis of Legendre polynomials. For example, we could consider the steady state temperature distribution inside a hemispherical igloo, which takes the form \[\phi(r, \theta)=\sum_{n=0}^{\infty} A_{n} r^{n} P_{n}(\cos \theta)\nonumber \] in spherical coordinates. Evaluating this function at the surface \(r=a\) as \(\phi(a, \theta)=f(\theta)\), leads to a Fourier-Legendre series expansion of function \(f\) : \[f(\theta)=\sum_{n=0}^{\infty} c_{n} P_{n}(\cos \theta),\nonumber \] where \(c_{n}=A_{n} a^{n}\)

    In this section we would like to explore Fourier-Legendre series expansions of functions \(f(x)\) defined on \((-1,1)\) : \[f(x) \sim \sum_{n=0}^{\infty} c_{n} P_{n}(x) .\label{eq:1}\] As with Fourier trigonometric series, we can determine the expansion coefficients by multiplying both sides of Equation \(\eqref{eq:1}\) by \(P_{m}(x)\) and integrating for \(x \in[-1,1]\). Orthogonality gives the usual form for the generalized Fourier coefficients, \[c_{n}=\frac{\left\langle f, P_{n}\right\rangle}{\left\|P_{n}\right\|^{2}}, n=0,1, \ldots\nonumber \] We will later show that \[\left\|P_{n}\right\|^{2}=\frac{2}{2 n+1} .\nonumber \] Therefore, the Fourier-Legendre coefficients are \[c_{n}=\frac{2 n+1}{2} \int_{-1}^{1} f(x) P_{n}(x) d x .\label{eq:2}\]

    Properties of Legendre Polynomials

    We can do examples of Fourier-Legendre Expansions given just a few facts about Legendre polynomials. The first property that the Legendre polynomials have is the Rodrigues formula: \[P_{n}(x)=\frac{1}{2^{n} n !} \frac{d^{n}}{d x^{n}}\left(x^{2}-1\right)^{n}, \quad n \in N_{0} .\label{eq:3}\]

    From the Rodrigues formula, one can show that \(P_{n}(x)\) is an \(n\)th degree polynomial. Also, for \(n\) odd, the polynomial is an odd function and for \(n\) even, the polynomial is an even function.

    Example \(\PageIndex{1}\)

    Determine \(P_{2}(x)\) from Rodrigues formula:

    Solution

    \[\begin{align} P_{2}(x) &=\frac{1}{2^{2} 2 !} \frac{d^{2}}{d x^{2}}\left(x^{2}-1\right)^{2}\nonumber \\ &=\frac{1}{8} \frac{d^{2}}{d x^{2}}\left(x^{4}-2 x^{2}+1\right)\nonumber \\ &=\frac{1}{8} \frac{d}{d x}\left(4 x^{3}-4 x\right)\nonumber \\ &=\frac{1}{8}\left(12 x^{2}-4\right)\nonumber \\ &=\frac{1}{2}\left(3 x^{2}-1\right) .\label{eq:4} \end{align}\] Note that we get the same result as we found in the last section using orthogonalization.

    The first several Legendre polynomials are given in Table \(\PageIndex{1}\). In Figure \(\PageIndex{1}\) we show plots of these Legendre polynomials.

    Table \(\PageIndex{1}\): Tabular computation of the Legendre polynomials using the Rodrigues formula.
    \(n\) \(\left(x^{2}-1\right)^{n}\) \(\frac{d^{n}}{d x^{n}}\left(x^{2}-1\right)^{n}\) \(\frac{1}{2^{n} n !}\) \(P_{n}(x)\)
    \(\mathrm{O}\) 1 1 1 1
    1 \(x^{2}-1\) \(2 x\) \(\frac{1}{2}\) \(x\)
    2 \(x^{4}-2 x^{2}+1\) \(12 x^{2}-4\) \(\frac{1}{8}\) \(\frac{1}{2}\left(3 x^{2}-1\right)\)
    3 \(x^{6}-3 x^{4}+3 x^{2}-1\) \(120 x^{3}-72 x\) \(\frac{1}{48}\) \(\frac{1}{2}\left(5 x^{3}-3 x\right)\)
    clipboard_e39400ea9a9e11adb059efa817717e36f.png
    Figure \(\PageIndex{1}\): Plots of the Legendre polynomials \(P_{2}(x), P_{3}(x), P_{4}(x)\), and \(P_{5}(x)\).
    Note

    The first proof of the three term recursion formula is based upon the nature of the Legendre polynomials as an orthogonal basis, while the second proof is derived using generating functions.

    All of the classical orthogonal polynomials satisfy a three term recursion formula (or, recurrence relation or formula). In the case of the Legendre \[(n+1) P_{n+1}(x)=(2 n+1) x P_{n}(x)-n P_{n-1}(x), \quad n=1,2, \ldots .\label{eq:5}\] This can also be rewritten by replacing \(n\) with \(n-1\) as \[(2 n-1) x P_{n-1}(x)=n P_{n}(x)+(n-1) P_{n-2}(x), \quad n=1,2, \ldots\label{eq:6}\]

    Example \(\PageIndex{2}\)

    Use the recursion formula to find \(P_{2}(x)\) and \(P_{3}(x)\), given that \(P_0(x)=1\) and \(P_1(x)=x\).

    Solution

    We first begin by inserting \(n=1\) into Equation \(\eqref{eq:5}\): \[2 P_{2}(x)=3 x P_{1}(x)-P_{0}(x)=3 x^{2}-1 .\nonumber \]

    For \(n=2\), we have \[\begin{align} 3 P_{3}(x) &=5 x P_{2}(x)-2 P_{1}(x)\nonumber \\ &=\frac{5}{2} x\left(3 x^{2}-1\right)-2 x\nonumber \\ &=\frac{1}{2}\left(15 x^{3}-9 x\right) .\label{eq:7} \end{align}\]

    This gives \(P_{3}(x)=\frac{1}{2}\left(5 x^{3}-3 x\right)\). These expressions agree with the earlier results.

    We will prove the three term recursion formula in two ways. First we polynomials, we have use the orthogonality properties of Legendre polynomials and the following lemma.

    Lemma \(\PageIndex{1}\)

    The leading coefficient of \(x^{n}\) in \(P_{n}(x)\) is \(\frac{1}{2^{n} n !} \frac{(2 n) !}{n !}\).

    Proof

    We can prove this using the Rodrigues formula. First, we focus on the leading coefficient of \(\left(x^{2}-1\right)^{n}\), which is \(x^{2 n}\). The first derivative of \(x^{2 n}\) is \(2 n x^{2 n-1}\). The second derivative is \(2 n(2 n-1) x^{2 n-2}\). The \(j\) th derivative is \[\frac{d^{j} x^{2 n}}{d x^{j}}=[2 n(2 n-1) \ldots(2 n-j+1)] x^{2 n-j} \text {. }\nonumber \] Thus, the \(n\)th derivative is given by \[\frac{d^{n} x^{2 n}}{d x^{n}}=[2 n(2 n-1) \ldots(n+1)] x^{n} .\nonumber \] This proves that \(P_{n}(x)\) has degree \(n\). The leading coefficient of \(P_{n}(x)\) can now be written as \[\begin{align} \frac{[2 n(2 n-1) \ldots(n+1)]}{2^{n} n !} &=\frac{[2 n(2 n-1) \ldots(n+1)]}{2^{n} n !} \frac{n(n-1) \ldots 1}{n(n-1) \ldots 1}\nonumber \\ &=\frac{1}{2^{n} n !} \frac{(2 n) !}{n !}\label{eq:8} \end{align}\]

    Theorem \(\PageIndex{1}\)

    Legendre polynomials satisfy the three term recursion formula \[(2 n-1) x P_{n-1}(x)=n P_{n}(x)+(n-1) P_{n-2}(x), \quad n=1,2, \ldots .\label{eq:9}\]

    Proof

    In order to prove the three term recursion formula we consider the expression \((2 n-1) x P_{n-1}(x)-n P_{n}(x)\). While each term is a polynomial of degree \(n\), the leading order terms cancel. We need only look at the coefficient of the leading order term first expression. It is \[\frac{2 n-1}{2^{n-1}(n-1) !} \frac{(2 n-2) !}{(n-1) !}=\frac{1}{2^{n-1}(n-1) !} \frac{(2 n-1) !}{(n-1) !}=\frac{(2 n-1) !}{2^{n-1}[(n-1) !]^{2}} .\nonumber \] The coefficient of the leading term for \(n P_{n}(x)\) can be written as \[n \frac{1}{2^{n} n !} \frac{(2 n) !}{n !}=n\left(\frac{2 n}{2 n^{2}}\right)\left(\frac{1}{2^{n-1}(n-1) !}\right) \frac{(2 n-1) !}{(n-1) !} \frac{(2 n-1) !}{2^{n-1}[(n-1) !]^{2}} .\nonumber \] It is easy to see that the leading order terms in the expression \((2 n-1) x P_{n-1}(x)-\) \(n P_{n}(x)\) cancel.

    The next terms will be of degree \(n-2\). This is because the \(P_{n}\) ’s are either even or odd functions, thus only containing even, or odd, powers of \(x\). We conclude that \[(2 n-1) x P_{n-1}(x)-n P_{n}(x)=\text { polynomial of degree } n-2 \text {. }\nonumber \] Therefore, since the Legendre polynomials form a basis, we can write this polynomial as a linear combination of Legendre polynomials: \[(2 n-1) x P_{n-1}(x)-n P_{n}(x)=c_{0} P_{0}(x)+c_{1} P_{1}(x)+\ldots+c_{n-2} P_{n-2}(x) .\label{eq:10}\]

    Multiplying Equation \(\eqref{eq:10}\) by \(P_{m}(x)\) for \(m=0,1, \ldots, n-3\), integrating from \(-1\) to 1 , and using orthogonality, we obtain \[0=c_{m}\left\|P_{m}\right\|^{2}, \quad m=0,1, \ldots, n-3 .\nonumber \] [Note: \(\int_{-1}^{1} x^{k} P_{n}(x) d x=0\) for \(k \leq n-1\). Thus, \(\int_{-1}^{1} x P_{n-1}(x) P_{m}(x) d x=0\) for \(m \leq n-3\).]

    Thus, all of these \(c_{m}\) ’s are zero, leaving Equation \(\eqref{eq:10}\) as \[(2 n-1) x P_{n-1}(x)-n P_{n}(x)=c_{n-2} P_{n-2}(x) .\nonumber \] The final coefficient can be found by using the normalization condition, \(P_{n}(1)=1\). Thus, \(c_{n-2}=(2 n-1)-n=n-1\).

    Generating Functions The Generating Function for Legendre Polynomials

    A second proof of the three term recursion formula can be obtained from the generating function of the Legendre polynomials. Many special functions have such generating functions. In this case it is given by \[g(x, t)=\frac{1}{\sqrt{1-2 x t+t^{2}}}=\sum_{n=0}^{\infty} P_{n}(x) t^{n}, \quad|x| \leq 1,|t|<1 .\label{eq:11}\]

    This generating function occurs often in applications. In particular, it arises in potential theory, such as electromagnetic or gravitational potentials. These potential functions are \(\frac{1}{r}\) type functions.

    clipboard_e05076e17e881160c79145c57b02d068f.png
    Figure \(\PageIndex{2}\): The position vectors used to describe the tidal force on the Earth due to the moon.

    For example, the gravitational potential between the Earth and the moon is proportional to the reciprocal of the magnitude of the difference between their positions relative to some coordinate system. An even better example, would be to place the origin at the center of the Earth and consider the forces on the non-pointlike Earth due to the moon. Consider a piece of the Earth at position \(r_1\) and the moon at position \(r_2\) as shown in Figure \(\PageIndex{2}\). The tidal potential \(\phi\) is proportional to \[\Phi \propto \frac{1}{\left|\mathbf{r}_{2}-\mathbf{r}_{1}\right|}=\frac{1}{\sqrt{\left(\mathbf{r}_{2}-\mathbf{r}_{1}\right) \cdot\left(\mathbf{r}_{2}-\mathbf{r}_{1}\right)}}=\frac{1}{\sqrt{r_{1}^{2}-2 r_{1} r_{2} \cos \theta+r_{2}^{2}}}\nonumber \] where \(\theta\) is the angle between \(\mathbf{r}_{1}\) and \(\mathbf{r}_{2}\).

    Typically, one of the position vectors is much larger than the other. Let’s assume that \(r_{1} \ll r_{2}\). Then, one can write \[\Phi \propto \frac{1}{\sqrt{r_{1}^{2}-2 r_{1} r_{2} \cos \theta+r_{2}^{2}}}=\frac{1}{r_{2}} \frac{1}{\sqrt{1-2 \frac{r_{1}}{r_{2}} \cos \theta+\left(\frac{r_{1}}{r_{2}}\right)^{2}}} .\nonumber \] Now, define \(x=\cos \theta\) and \(t=\frac{r_{1}}{r_{2}}\). We then have that the tidal potential is proportional to the generating function for the Legendre polynomials! So, we can write the tidal potential as \[\Phi \propto \frac{1}{r_{2}} \sum_{n=0}^{\infty} P_{n}(\cos \theta)\left(\frac{r_{1}}{r_{2}}\right)^{n} .\nonumber \] The first term in the expansion, \(\frac{1}{r_{2}}\), is the gravitational potential that gives the usual force between the Earth and the moon. [Recall that the gravitational potential for mass \(m\) at distance \(r\) from \(M\) is given by \(\Phi=-\frac{G M m}{r}\) and that the force is the gradient of the potential, \(\mathbf{F}=-\nabla \Phi \propto \nabla\left(\frac{1}{r}\right)\).] The next terms will give expressions for the tidal effects.

    Now that we have some idea as to where this generating function might have originated, we can proceed to use it. First of all, the generating function can be used to obtain special values of the Legendre polynomials.

    Example \(\PageIndex{3}\)

    Evaluate \(P_{n}(0)\) using the generating function. \(P_{n}(0)\) is found by considering \(g(0, t)\).

    Solution

    Setting \(x=0\) in Equation \(\eqref{eq:11}\), we have \[\begin{align} g(0, t) &=\frac{1}{\sqrt{1+t^{2}}}\nonumber \\ &=\sum_{n=0}^{\infty} P_{n}(0) t^{n}\nonumber \\ &=P_{0}(0)+P_{1}(0) t+P_{2}(0) t^{2}+P_{3}(0) t^{3}+\ldots .\label{eq:12} \end{align}\] We can use the binomial expansion to find the final answer. Namely, we have \[\frac{1}{\sqrt{1+t^{2}}}=1-\frac{1}{2} t^{2}+\frac{3}{8} t^{4}+\ldots .\nonumber \] Comparing these expansions, we have the \(P_{n}(0)=0\) for \(n\) odd and for even integers one can show (see Problem 5.7.12) that\(^{1}\) \[P_{2 n}(0)=(-1)^{n} \frac{(2 n-1) ! !}{(2 n) ! !},\label{eq:13}\] where \(n ! !\) is the double factorial, \[n ! !=\left\{\begin{array}{ll} n(n-2) \ldots(3) 1, & n>0, \text { odd }, \\ n(n-2) \ldots(4) 2, & n>0, \text { even }, \\ 1 & n=0,-1 \end{array} .\right.\nonumber\]

    Note

    This example can be finished by first proving that \[(2 n) ! !=2^{n} n !\nonumber\] and \[(2 n-1) ! !=\frac{(2 n) !}{(2 n) ! !}=\frac{(2 n) !}{2^{n} n !}.\nonumber\]

    Example \(\PageIndex{4}\)

    Evaluate \(P_{n}(-1)\). This is a simpler problem.

    Solution

    In this case we have \[g(-1, t)=\frac{1}{\sqrt{1+2 t+t^{2}}}=\frac{1}{1+t}=1-t+t^{2}-t^{3}+\ldots .\nonumber \] Therefore, \(P_{n}(-1)=(-1)^{n}\).

    Example \(\PageIndex{5}\)

    Prove the three term recursion formula, \[(k+1) P_{k+1}(x)-(2 k+1) x P_{k}(x)+k P_{k-1}(x)=0, \quad k=1,2, \ldots,\nonumber \] using the generating function.

    Solution

    We can also use the generating function to find recurrence relations. To prove the three term recursion \(\eqref{eq:5}\) that we introduced above, then we need only differentiate the generating function with respect to \(t\) in Equation \(\eqref{eq:11}\) and rearrange the result. First note that \[\frac{\partial g}{\partial t}=\frac{x-t}{\left(1-2 x t+t^{2}\right)^{3 / 2}}=\frac{x-t}{1-2 x t+t^{2}} g(x, t) .\nonumber \] Combining this with \[\frac{\partial g}{\partial t}=\sum_{n=0}^{\infty} n P_{n}(x) t^{n-1}\nonumber \] we have \[(x-t) g(x, t)=\left(1-2 x t+t^{2}\right) \sum_{n=0}^{\infty} n P_{n}(x) t^{n-1} .\nonumber \] Inserting the series expression for \(g(x, t)\) and distributing the sum on the right side, we obtain \[(x-t) \sum_{n=0}^{\infty} P_{n}(x) t^{n}=\sum_{n=0}^{\infty} n P_{n}(x) t^{n-1}-\sum_{n=0}^{\infty} 2 n x P_{n}(x) t^{n}+\sum_{n=0}^{\infty} n P_{n}(x) t^{n+1} .\nonumber \] Multiplying out the \(x-t\) factor and rearranging, leads to three separate sums: \[\sum_{n=0}^{\infty} n P_{n}(x) t^{n-1}-\sum_{n=0}^{\infty}(2 n+1) x P_{n}(x) t^{n}+\sum_{n=0}^{\infty}(n+1) P_{n}(x) t^{n+1}=0 .\label{eq:14}\]

    Each term contains powers of \(t\) that we would like to combine into a single sum. This is done by reindexing. For the first sum, we could use the new index \(k=n-1\). Then, the first sum can be written \[\sum_{n=0}^{\infty} n P_{n}(x) t^{n-1}=\sum_{k=-1}^{\infty}(k+1) P_{k+1}(x) t^{k} .\nonumber \] Using different indices is just another way of writing out the terms. Note that \[\sum_{n=0}^{\infty} n P_{n}(x) t^{n-1}=0+P_{1}(x)+2 P_{2}(x) t+3 P_{3}(x) t^{2}+\ldots\nonumber \] and \[\sum_{k=-1}^{\infty}(k+1) P_{k+1}(x) t^{k}=0+P_{1}(x)+2 P_{2}(x) t+3 P_{3}(x) t^{2}+\ldots\nonumber \] actually give the same sum. The indices are sometimes referred to as dummy indices because they do not show up in the expanded expression and can be replaced with another letter.

    If we want to do so, we could now replace all of the \(k^{\prime}\) with \(n\) ’s. However, we will leave the \(k^{\prime}\) s in the first term and now reindex the next sums in Equation \(\eqref{eq:14}\). The second sum just needs the replacement \(n=k\) and the last sum we reindex using \(k=n+1\). Therefore, Equation \(\eqref{eq:14}\) becomes \[\sum_{k=-1}^{\infty}(k+1) P_{k+1}(x) t^{k}-\sum_{k=0}^{\infty}(2 k+1) x P_{k}(x) t^{k}+\sum_{k=1}^{\infty} k P_{k-1}(x) t^{k}=0 .\label{eq:15}\]

    We can now combine all of the terms, noting the \(k=-1\) term is automatically zero and the \(k=0\) terms give \[P_{1}(x)-x P_{0}(x)=0 .\label{eq:16}\] Of course, we know this already. So, that leaves the \(k>0\) terms: \[\sum_{k=1}^{\infty}\left[(k+1) P_{k+1}(x)-(2 k+1) x P_{k}(x)+k P_{k-1}(x)\right] t^{k}=0 .\label{eq:17}\] Since this is true for all \(t\), the coefficients of the \(t^{k}\) ’s are zero, or \[(k+1) P_{k+1}(x)-(2 k+1) x P_{k}(x)+k P_{k-1}(x)=0, \quad k=1,2, \ldots\nonumber \] While this is the standard form for the three term recurrence relation, the earlier form is obtained by setting \(k=n-1\).

    There are other recursion relations which we list in the box below. Equation \(\eqref{eq:18}\) was derived using the generating function. Differentiating it with respect to \(x\), we find Equation \(\eqref{eq:19}\). Equation \(\eqref{eq:20}\) can be proven using the generating function by differentiating \(g(x, t)\) with respect to \(x\) and rearranging the resulting infinite series just as in this last manipulation. This will be left as Problem 5.7.4. Combining this result with Equation \(\eqref{eq:18}\), we can derive Equations \(\eqref{eq:21}\)-\(\eqref{eq:22}\). Adding and subtracting these equations yields Equations \(\eqref{eq:23}\)-\(\eqref{eq:24}\).

    Table \(\PageIndex{2}\)
    Recursion Formulae for Legendre Polynomials for \(n=1,2,\ldots\)
    \[(n+1) P_{n+1}(x) =(2 n+1) x P_{n}(x)-n P_{n-1}(x)\label{eq:18}\]
    \[(n+1) P_{n+1}^{\prime}(x) =(2 n+1)\left[P_{n}(x)+x P_{n}^{\prime}(x)\right]-n P_{n-1}^{\prime}(x)\label{eq:19}\]
    \[P_{n}(x) =P_{n+1}^{\prime}(x)-2 x P_{n}^{\prime}(x)+P_{n-1}^{\prime}(x)\label{eq:20}\]
    \[P_{n-1}^{\prime}(x) =x P_{n}^{\prime}(x)-n P_{n}(x)\label{eq:21}\]
    \[P_{n+1}^{\prime}(x) =x P_{n}^{\prime}(x)+(n+1) P_{n}(x)\label{eq:22}\]
    \[P_{n+1}^{\prime}(x)+P_{n-1}^{\prime}(x) = 2 x P_{n}^{\prime}(x)+P_{n}(x) .\label{eq:23}\]
    \[P_{n+1}^{\prime}(x)-P_{n-1}^{\prime}(x) =(2 n+1) P_{n}(x) .\label{eq:24}\]
    \[\left(x^{2}-1\right) P_{n}^{\prime}(x) = n x P_{n}(x)-n P_{n-1}(x)\label{eq:25}\]

    Finally, Equation \(\eqref{eq:25}\) can be obtained using Equations \(\eqref{eq:21}\) and \(\eqref{eq:22}\). Just multiply Equation \(\eqref{eq:21}\) by \(x\), \[x^{2} P_{n}^{\prime}(x)-n x P_{n}(x)=x P_{n-1}^{\prime}(x) .\nonumber \] Now use Equation \(\eqref{eq:22}\), but first replace \(n\) with \(n-1\) to eliminate the \(x P_{n-1}^{\prime}(x)\) term: \[x^{2} P_{n}^{\prime}(x)-n x P_{n}(x)=P_{n}^{\prime}(x)-n P_{n-1}(x) .\nonumber \]

    Rearranging gives the Equation \(\eqref{eq:25}\).

    Example \(\PageIndex{6}\)

    Use the generating function to prove \[\left\|P_{n}\right\|^{2}=\int_{-1}^{1} P_{n}^{2}(x) d x=\frac{2}{2 n+1} .\nonumber \]

    Solution

    Another use of the generating function is to obtain the normalization constant. This can be done by first squaring the generating function in order to get the products \(P_{n}(x) P_{m}(x)\), and then integrating over \(x\).

    Squaring the generating function has to be done with care, as we need to make proper use of the dummy summation index. So, we first write \[\begin{align} \frac{1}{1-2 x t+t^{2}} &=\left[\sum_{n=0}^{\infty} P_{n}(x) t^{n}\right]^{2}\nonumber \\ &=\sum_{n=0}^{\infty} \sum_{m=0}^{\infty} P_{n}(x) P_{m}(x) t^{n+m} .\label{eq:26} \end{align} \] Integrating from \(x=-1\) to \(x=1\) and using the orthogonality of the Legendre polynomials, we have \[\begin{align} \int_{-1}^{1} \frac{d x}{1-2 x t+t^{2}} &=\sum_{n=0}^{\infty} \sum_{m=0}^{\infty} t^{n+m} \int_{-1}^{1} P_{n}(x) P_{m}(x) d x\nonumber \\ &=\sum_{n=0}^{\infty} t^{2 n} \int_{-1}^{1} P_{n}^{2}(x) d x .\label{eq:27} \end{align}\]

    However, one can show that\(^{2}\) \[\int_{-1}^1\frac{dx}{1-2xt+t^2}=\frac{1}{t}\ln\left(\frac{1+t}{1-t}\right).\nonumber\] Expanding this expression about \(t=0\), we obtain\(^{3}\) \[\frac{1}{t}\ln\left(\frac{1+t}{1-t}\right)=\sum\limits_{n=0}^\infty\frac{2}{2n+1}t^{2n}.\nonumber\] Comparing this result with Equation \(\eqref{eq:27}\), we find that \[\left\|P_{n}\right\|^{2}=\int_{-1}^{1} P_{n}^{2}(x) d x=\frac{2}{2 n+1} .\label{eq:28}\]

    Note

    You will need the integral \[\int \frac{d x}{a+b x}=\frac{1}{b} \ln (a+b x)+C .\nonumber \]

    You will need the series expansion \[\begin{aligned} \ln (1+x) &=\sum_{n=1}^{\infty}(-1)^{n+1} \frac{x^{n}}{n} \\ &=x-\frac{x^{2}}{2}+\frac{x^{3}}{3}-\cdots \end{aligned}\]

    Differential Equation for Legendre Polynomials

    The Legendre Polynomials satisfy a second order linear differential equation. This differential equation occurs naturally in the solution of initialboundary value problems in three dimensions which possess some spherical symmetry. We will see this in the last chapter. There are two approaches we could take in showing that the Legendre polynomials satisfy a particular differential equation. Either we can write down the equations and attempt to solve it, or we could use the above properties to obtain the equation. For now, we will seek the differential equation satisfied by \(P_{n}(x)\) using the above recursion relations.

    We begin by differentiating Equation \(\eqref{eq:25}\) and using Equation \(\eqref{eq:21}\) to simplify: \[\begin{align} \frac{d}{d x}\left(\left(x^{2}-1\right) P_{n}^{\prime}(x)\right) &=n P_{n}(x)+n x P_{n}^{\prime}(x)-n P_{n-1}^{\prime}(x)\nonumber \\ &=n P_{n}(x)+n^{2} P_{n}(x)\nonumber \\ &=n(n+1) P_{n}(x)\label{eq:29} \end{align}\] Therefore, Legendre polynomials, or Legendre functions of the first kind, are solutions of the differential equation \[\left(1-x^{2}\right) y^{\prime \prime}-2 x y^{\prime}+n(n+1) y=0 \text {. }\nonumber \] As this is a linear second order differential equation, we expect two linearly independent solutions. The second solution, called the Legendre function of the second kind, is given by \(Q_{n}(x)\) and is not well behaved at \(x=\pm 1\). For example, \[Q_{0}(x)=\frac{1}{2} \ln \frac{1+x}{1-x} .\nonumber \] We will not need these for physically interesting examples in this book.

    Note

    A generalization of the Legendre equation is given by \(\left(1-x^{2}\right) y^{\prime \prime}-2 x y^{\prime}+\) \(\left[n(n+1)-\frac{m^{2}}{1-x^{2}}\right] y=0\). Solutions to this equation, \(P_{n}^{m}(x)\) and \(Q_{n}^{m}(x)\), are called the associated Legendre functions of the first and second kind.

    Fourier-Legendre Series

    With these properties of Legendre Functions we are now prepared to compute the expansion coefficients for the Fourier-Legendre series representation of a given function.

    Example \(\PageIndex{7}\)

    Expand \(f(x)=x^{3}\) in a Fourier-Legendre series.

    Solution

    We simply need to compute \[c_{n}=\frac{2 n+1}{2} \int_{-1}^{1} x^{3} P_{n}(x) d x .\label{eq:30}\] We first note that \[\int_{-1}^{1} x^{m} P_{n}(x) d x=0 \quad \text { for } m>n .\nonumber \] As a result, we have that \(c_{n}=0\) for \(n>3\). We could just compute \(\int_{-1}^{1} x^{3} P_{m}(x) d x\) for \(m=0,1,2, \ldots\) outright by looking up Legendre polynomials. But, note that \(x^{3}\) is an odd function. \(S o, c_{0}=0\) and \(c_{2}=0\).

    This leaves us with only two coefficients to compute. We refer to Table \(\PageIndex{1}\) and find that \[\begin{gathered} c_{1}=\frac{3}{2} \int_{-1}^{1} x^{4} d x=\frac{3}{5} \\ c_{3}=\frac{7}{2} \int_{-1}^{1} x^{3}\left[\frac{1}{2}\left(5 x^{3}-3 x\right)\right] d x=\frac{2}{5} . \end{gathered}\nonumber \]

    Thus, \[x^{3}=\frac{3}{5} P_{1}(x)+\frac{2}{5} P_{3}(x) .\nonumber \] Of course, this is simple to check using Table \(\PageIndex{1}\): \[\frac{3}{5} P_{1}(x)+\frac{2}{5} P_{3}(x)=\frac{3}{5} x+\frac{2}{5}\left[\frac{1}{2}\left(5 x^{3}-3 x\right)\right]=x^{3} .\nonumber \] We could have obtained this result without doing any integration. Write \(x^{3}\) as a linear combination of \(P_{1}(x)\) and \(P_{3}(x)\) : \[\begin{align} x^{3} &=c_{1} x+\frac{1}{2} c_{2}\left(5 x^{3}-3 x\right)\nonumber \\ &=\left(c_{1}-\frac{3}{2} c_{2}\right) x+\frac{5}{2} c_{2} x^{3} .\label{eq:31} \end{align}\]

    Equating coefficients of like terms, we have that \(c_{2}=\frac{2}{5}\) and \(c_{1}=\frac{3}{2} c_{2}=\frac{3}{5}\).

    Note

    Oliver Heaviside (\(1850-1925\)) was an English mathematician, physicist and engineer who used complex analysis to study circuits and was a co-founder of vector analysis. The Heaviside function is also called the step function.

    Example \(\PageIndex{8}\)

    Expand the Heaviside\(^{3}\) function in a Fourier-Legendre series.

    The Heaviside function is defined as \[H(x)=\left\{\begin{array}{rr}1,&x>0, \\ 0,&x<0.\end{array}\right.\label{eq:32}\]

    Solution

    In this case, we cannot find the expansion coefficients without some integration. We have to compute \[\begin{align}c_n&=\frac{2n+1}{2}\int_{-1}^1f(x)P_n(x)dx\nonumber \\ &=\frac{2n+1}{2}\int_0^1P_n(x)dx.\label{eq:33}\end{align}\] We can make use of identity \(\eqref{eq:24}\), \[P_{n+1}'(x)-P_{n-1}'(x)=(2n+1)P_n(x),\quad n>0.\label{eq:34}\] We have for \(n>0\) \[c_n=\frac{1}{2}\int_0^1[P_{n+1}'(x)-P_{n-1}'(x)]dx=\frac{1}{2}[P_{n-1}(0)-P_{n+1}(0)].\nonumber\] For \(n=0\), we have \[c_0=\frac{1}{2}\int_0^1dx=\frac{1}{2}.\nonumber\]

    This leads to the expansion \[f(x)\sim\frac{1}{2}+\frac{1}{2}\sum\limits_{n=1}^\infty [P_{n-1}(0)-P_{n+1}(0)]P_n(x).\nonumber\] We still need to evaluate the Fourier-Legendre coefficients \[c_n=\frac{1}{2}[P_{n-1}(0)-P_{n+1}(0)].\nonumber\]

    Since \(P_n(0) = 0\) for \(n\) odd, the \(c_n\)’s vanish for \(n\) even. Letting \(n = 2k − 1\), we re-index the sum, obtaining \[f(x)\sim\frac{1}{2}+\frac{1}{2}\sum\limits_{n=1}^\infty [P_{2k-2}(0)-P_{2k}(0)]P_{2k-1}(x).\nonumber\]

    We can compute the nonzero Fourier coefficients, \(c_{2 k-1}=\frac{1}{2}\left[P_{2 k-2}(0)-P_{2 k}(0)\right]\), using a result from Problem 12: \[P_{2 k}(0)=(-1)^{k} \frac{(2 k-1) ! !}{(2 k) ! !} .\label{eq:35}\] Namely, we have \[\begin{align} c_{2 k-1} &=\frac{1}{2}\left[P_{2 k-2}(0)-P_{2 k}(0)\right]\nonumber \\ &=\frac{1}{2}\left[(-1)^{k-1} \frac{(2 k-3) ! !}{(2 k-2) ! !}-(-1)^{k} \frac{(2 k-1) ! !}{(2 k) ! !}\right]\nonumber \\ &=-\frac{1}{2}(-1)^{k} \frac{(2 k-3) ! !}{(2 k-2) ! !}\left[1+\frac{2 k-1}{2 k}\right]\nonumber \\ &=-\frac{1}{2}(-1)^{k} \frac{(2 k-3) ! !}{(2 k-2) ! !} \frac{4 k-1}{2 k} .\label{eq:36} \end{align}\]

    Thus, the Fourier-Legendre series expansion for the Heaviside function is given by \[f(x) \sim \frac{1}{2}-\frac{1}{2} \sum_{n=1}^{\infty}(-1)^{n} \frac{(2 n-3) ! !}{(2 n-2) ! !} \frac{4 n-1}{2 n} P_{2 n-1}(x) .\label{eq:37}\] The sum of the first 21 terms of this series are shown in Figure \(\PageIndex{3}\). We note the slow convergence to the Heaviside function. Also, we see that the Gibbs phenomenon is present due to the jump discontinuity at \(x=0\). [See Section 3.7.]

    clipboard_eef9569d0b9bd43cc5b940ba7ce2e2264.png
    Figure \(\PageIndex{3}\): Sum of first 21 terms for Fourier-Legendre series expansion of Heaviside function.

    This page titled 5.3: Fourier-Legendre Series is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Russell Herman via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.