Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to the main page for the first course APMA0330
Return to the main page for the second course APMA0340
Return to Part I of the course APMA0340
Introduction to Linear Algebra with Mathematica

Preface


This section presents some properties of the most remarkable and useful in numerical computations Chebyshev polynomials of first kind \( T_n (x) \) and second kind \( U_n (x) .\) Both Chebyshev polynomials are eigenfunctions of the corresponding singular Sturm--Liouville problems. Other two Chebyshev polynomials of the third kind and the fourth kind are not so popular in applications.

Generating functions


The ordinary generating function for Legendre polynomials is
\begin{equation} \label{EqLege1.1} G(x,t) = \frac{1}{\sqrt{1 -2xt + t^2}} = \sum_{n\ge 0} P_n (x)\, t^n , \end{equation}
where Pn(x) is the Legendre polynomial of degree n. Using Mathematica, we find first ten Legendre polynomials:
TableForm[Table[{i, i*(i + 1), LegendreP[i, x]}, {i, 0, 10}], TableHeadings -> {None, {"k", "\!\(\*SubscriptBox[\( \[Lambda] \),\( k\)]\)", "\!\(\*SubscriptBox[\( P \),\( k\)]\)(x)"}}]
       n     Legendre polynomial
    n = 0         P0(x) = 1
    n = 1         P1(x) = x
    n = 2         \( \displaystyle P_2 (x) = \frac{1}{2} \left( 3 x^2 -1 \right) \)
    n = 3         \( \displaystyle P_3 (x) = \frac{1}{2} \left( 5 x^3 -3x \right) \)
    n = 4         \( \displaystyle P_4 (x) = \frac{1}{8} \left( 35 x^4 -30 x^2 +3 \right) \)
    n = 5         \( \displaystyle P_5 (x) = \frac{1}{8} \left( 63 x^5 -70 x^3 + 15 x \right) \)
    n = 6         \( \displaystyle P_6 (x) = \frac{1}{16} \left( 231 x^6 - 315 x^4 + 105 x^2 -5 \right) \)
    n = 7         \( \displaystyle P_7 (x) = \frac{1}{16} \left( 429 x^7 - 693 x^5 + 315 x^3 - 35x \right) \)
    n = 8         \( \displaystyle P_8 (x) = \frac{1}{128} \left( 6435 x^8 - 12012 x^6 + 6930 x^4 -1260 x^2 + 35 \right) \)
    n = 9         \( \displaystyle P_9 (x) = \frac{1}{128} \left( 12155 x^9 - 25740 x^7 + 18018 x^5 -4620 x^3 + 315 x \right) \)
    n = 10         \( \displaystyle P_{10} (x) = \frac{1}{256} \left( 46189 x^{10} - 109395 x^8 + 90090 x^6 - 30030 x^4 + 3465 x^2 -63 \right) \)

By inverting these expressions we get a useful set of formulas expressing the monomials of x in terms of the Legendre polynomials. The first five are given below

       n     Monomial in x
    n = 0         1 = P0(x)
    n = 1         x = P1(x)
    n = 2         \( \displaystyle x^2 = \frac{1}{3} \left[ P_0 + 2 \,P_2 (x) \right] \)
    n = 3         \( \displaystyle x^3 = \frac{1}{5} \left[ 3\,P_1 (x) + 2\,P_3 (x) \right] \)
    n = 4         \( \displaystyle x^4 = \frac{1}{35} \left[ 7\, P_0 + 20\,P_2 (x) + 8\,P_4 (x) \right] \)
    n = 5         \( \displaystyle P_5 (x) = \frac{1}{8} \left( 63 x^5 -70 x^3 + 15 x \right) \)
    n = 6         \( \displaystyle P_6 (x) = \frac{1}{16} \left( 231 x^6 - 315 x^4 + 105 x^2 -5 \right) \)
    n = 7         \( \displaystyle P_7 (x) = \frac{1}{16} \left( 429 x^7 - 693 x^5 + 315 x^3 - 35x \right) \)
    n = 8         \( \displaystyle P_8 (x) = \frac{1}{128} \left( 6435 x^8 - 12012 x^6 + 6930 x^4 -1260 x^2 + 35 \right) \)
    n = 9         \( \displaystyle P_9 (x) = \frac{1}{128} \left( 12155 x^9 - 25740 x^7 + 18018 x^5 -4620 x^3 + 315 x \right) \)
    n = 10         \( \displaystyle P_{10} (x) = \frac{1}{256} \left( 46189 x^{10} - 109395 x^8 + 90090 x^6 - 30030 x^4 + 3465 x^2 -63 \right) \)

If we set x = cpsθ, the Legendre polynomials can be expressed in terms of multiple angles as

       n     Legendre polynomial of cosθ
    n = 0         P0(cosθ) = 1
    n = 1         P1(cosθ) = cosθ
    n = 2         \( \displaystyle P_2 (\cos\theta ) = \frac{1}{2} \left( 1 + 3\,\cos 2\theta\right) \)
    n = 3         \( \displaystyle P_3 (\cos\theta ) = \frac{1}{8} \left( 3\,\cos\theta + 5\,\cos 3\theta \right) \)
    n = 4         \( \displaystyle P_4 (\cos\theta ) = \frac{1}{64} \left( 9 + 20\,\cos 2\theta + 35\,\cos 4\theta \right) \)
    n = 5         \( \displaystyle P_5 (\cos\theta ) = \frac{1}{128} \left( 30\,\cos\theta + 35\,\cos 3\theta + 63\,\cos 5\theta \right) \)
    n = 6         \( \displaystyle P_6 (\cos\theta ) = \frac{1}{512} \left( 50 + 105\,\cos 2\theta + 126\,\cos 4\theta + 231\,\cos 6\theta \right) \)
    n = 7         \( \displaystyle P_7 (x) = \frac{1}{1024} \left( 175\,\cos\theta + 189\,\cos 3\theta + 231\,\cos 5\theta + 429\,\cos 7\theta \right) \)
    n = 8         \( \displaystyle P_8 (x) = \frac{1}{128} \left( 6435 x^8 - 12012 x^6 + 6930 x^4 -1260 x^2 + 35 \right) \)
    n = 9         \( \displaystyle P_9 (x) = \frac{1}{128} \left( 12155 x^9 - 25740 x^7 + 18018 x^5 -4620 x^3 + 315 x \right) \)
    n = 10         \( \displaystyle P_{10} (x) = \frac{1}{256} \left( 46189 x^{10} - 109395 x^8 + 90090 x^6 - 30030 x^4 + 3465 x^2 -63 \right) \)

The Legendre polynomials can also be defined via Bonnet’s recursion formula:

\[ \left( n+1 \right) P_{n+1} (x) = \left( 2n+1 \right) x\, P_n (x) - n\,P_{n-1} (x), \qquad n=2,3, \ldots ; \quad P_0 (x) =1, \quad P_1 (x) =x; \]
which follow from the generating function for Legendre polynomials:
\[ \frac{1}{\sqrt{1- 2xt + t^2}} = \sum_{n\ge 0} P_n (x)\, t^n \qquad\Longrightarrow \qquad P_n (x) = \frac{1}{2^n} \,\sum_{k=0}^n \binom{n}{k}^2 \left( x-1 \right)^{n-k} \left( x+1 \right)^k . \]
Its exponential generating function is
\[ e^{xz}\,J_0 \left( z \sqrt{1-x^2} \right) = \sum_{n\ge 0} P_n (x)\, \frac{z^n}{n!} . \]
The Rodrigues formula can be derived from the Lagrange inversion theorem (LIT) using
\[ w = f(z) = 2 \, \frac{z- z_0}{z^2 -1} , \]
where \( z_0 = z(0) , \) with \( w_0 = f(z_0 ) . \) Then
\[ \frac{1}{1 - (w- w_0 ) \, \frac{{\text d}}{{\text d} x} \left( \frac{z-z_0}{f(z) - w_0} \right)_{z=z(w)}} = \sum_{n\ge 0} c_n \left( w- w_0 \right)^n , \]
where
\[ c_n = \frac{1}{n!} \, \frac{{\text d}^n}{{\text d} z^n} \left. \left( \frac{z- z_0}{f(z) - w_0} \right) \right\vert_{z= z_0} = \frac{1}{2^n \, n!} \, \frac{{\text d}^n}{{\text d} z^n} \left( z^2 -1 \right)^n . \]

Legendre functions of the second kind


\begin{equation} \frac{1}{\sqrt{1 - 2xt + t^2}}\,\mbox{arccosh} \left( \frac{t-x}{\sqrt{x^2 -1}} \right) = \sum_{n\ge 0} Q_n (x)\, t^n . \end{equation}
Some numerical values:
\[ Q_{2n} (0) = 0, \qquad Q_{2n+1} (0) = (-1)^{n+1} \,\frac{(2n)!!}{(2n+1)!!} , \qquad Q_n (-x) = (-1)^{n+1} \, Q_n (x) . \]

Associated Legendre functions


Generating function
\begin{equation} \frac{(2m)! \left( 1 - x^2 \right)^{m/2} t^m}{2^m m!\left( 1 -xt + t^2 \right)^{m+1/2}} = \sum_{n\ge m} P_n^m (x)\,t^n . \end{equation}
Using formula Rodrigues formula
\begin{equation} \label{EqLege1.5} P_n^m (x) = \left( 1 - x^2 \right)^{m/2} \frac{{\text d}^m}{{\text d} x^m}\, P_n (x) , \qquad m=0,1,2,\ldots , n. \end{equation}
we generate several associated Legendre functions.
       n            m     Associated Legendre function
    n = 0         P00(x) = 1
    n = 1         m = 0         P10(x) = x
    n = 1         m = 1         \( \displaystyle P_1^1 (x) = ( 1- x^2 )^{1/2} \)
    n = 2         m = 0         \( \displaystyle P_2 (x) = \frac{1}{2} \left( 3 x^2 -1 \right) \)
    n = 2         m = 1         \( \displaystyle P_2^1 (x) = \left( 1 - x^2 \right)^{1/2} \)
    n = 2         m = 2         \( \displaystyle P_2^2 (x) = \left( 1- x^2 \right) \)
    n = 3         m = 0         \( \displaystyle P_3^0 (x) = \frac{1}{2} \left( 5 x^3 -3x \right) \)
    n = 3         m = 1         \( \displaystyle P_3^1 (x) = \frac{3}{2} \left( 1-5 x^2 \right) \left( 1- x^2 \right)^{1/2} \)
    n = 3         m = 2         \( \displaystyle P_3^2 (x) = 15 x \left( 1- x^2 \right) \)
    n = 3         m = 3         \( \displaystyle P_3^3 (x) = -15 \left( 1- x^2 \right)^{3/2} \)
    n = 4         m = 0         \( \displaystyle P_4^0 (x) = \frac{1}{8} \left( 35 x^4 -30 x^2 +3 \right) \)
    n = 4         m = 1         \( \displaystyle P_4^1 (x) = \frac{5}{2}\,x \left( 3 - 7 x^2 \right) \left( 1 - x^2 \right)^{1/2} \)
    n = 4         m = 2         \( \displaystyle P_4^2 (x) = \frac{15}{2} \left( 7 x^2 -1 \right) \left( 1 - x^2 \right) \)
    n = 4         m = 3         \( \displaystyle P_4^3 (x) = -105x \left( 1 - x^2 \right)^{3/2} \)
    n = 4         m = 4         \( \displaystyle P_4^4 (x) = 105 \left( 1 - x^2 \right)^2 \)
    n = 5         m = 0         \( \displaystyle P_5 (x) = \frac{1}{8} \left( 63 x^5 -70 x^3 + 15 x \right) \)

By convention the label m on the functions is indicated as a superscript. This label is not to be confused with a power: Pmn is not Pn raised to the power m. The definition of Eq.\eqref{EqLege1.5} implies that m≥0, and it is understood that P0n(x) = Pn(x). Because Pn(x) is a polynomial in x of degree n, taking m derivatives reduces the largest power of x to nm, and there is nothing left to be differentiated once m has reached its limiting value m=n. This implies that the associated Legendre functions are identically zeroes for m>n, and Eq.\eqref{EqLege1.5} therefore comes with the condition 0 ≤ m &ke; n.

Since the Legendre equation has two regular singular points x = ±1, it can be considered in any interval not containing these singular points. However, applications of Legendre polynomials dictaits that |x| ≤ 1. Moreover, the factor \( ( 1 - x^2 )^{m/2} \) nserted in the definition of Pmn(x) implies that in general, these functions are not polynomials for odd m.

  1. Clenshaw, C.W., Norton, H.J.: The solution of nonlinear ordinary differential equations in chebyshev series. The Computer Journal, 1963, {\bf 6}, Issue 1, 88–92; https://doi.org/10.1093

 

Return to Mathematica page
Return to the main page (APMA0340)
Return to the Part 1 Matrix Algebra
Return to the Part 2 Linear Systems of Ordinary Differential Equations
Return to the Part 3 Non-linear Systems of Ordinary Differential Equations
Return to the Part 4 Numerical Methods
Return to the Part 5 Fourier Series
Return to the Part 6 Partial Differential Equations
Return to the Part 7 Special Functions