Math + You = 1

# Corrected exercise: Legendre polynomials

Here is the statement of an exercise that will use the Legendre polynomials, of which we will demonstrate various properties. It is a family of classical polynomials. We will therefore put this exercise in the chapter on polynomials. This is a second year higher education exercise.

And here is the statement:

## A little culture

The first 10 Legendre polynomials are:

\begin{array}{l|c}
n   & P_n(x)\\
\hline
0 & 1\\
1 & x\\
2 & \dfrac{1}{2}(3x^2-1)\\
3 & \dfrac{1}{2}(5x^3-3x)\\
4 & \dfrac{1}{8}(35x^4-30x^2+3)\\
5 &  \dfrac{1}{8}(63x^5-70x^3+15x)\\
6 &  \dfrac{1}{16}(231x^6-315x^4+105x^2-5)\\
7 &  \dfrac{1}{16}(429x^7-693x^5+315x^3-35x)\\
8 & \dfrac{1}{128}(6435x^8-12012 x^6+6930x^4-1260x^2+35)\\
9 & \dfrac{1}{128}(12155x^9-25740x^7+18018x^5-4620x^3+315x)\\
10 &\dfrac{1}{256}(46189x^{10}-109395x^8+90090x^6-30030x^4+3465x^2-63)\\
\end{array}

Note that the degree of Pn is n.

## Corrected

### Question 1

To calculate Pn(1), we will explain the function. Let's study

P_n(X) = (X^2-1)^n = (X-1)^n(X+1)^n

We will use the Leibniz formula to differentiate n times:

\begin{array}{ll} P_n^{(n)}(X) &=\displaystyle \sum_{k=1}^n \binom{n}{k} ((X-1)^n)^{ (k)}((X+1)^n)^{nk}\\ &= \displaystyle \sum_{k=1}^n \binom{n}{k} n(n-1)\ldots(n -k+1) (X-1)^{nk}n(n-1)\ldots (k+1)(X+1)^k\\ &= \displaystyle \sum_{k=1}^n \ biname{n}{k}\dfrac{n!}{(nk)!}(X-1)^{nk}\dfrac{n!}{k!}(X+1)^k\\ &=n ! \displaystyle \sum_{k=1}^n \binom{n}{k}^2(X-1)^{nk}(X+1)^k \end{array}

Identifying X as 1, only the term k = n is non-zero. So we have :

\begin{array}{ll} L_n(1) &= \displaystyle \dfrac{1}{2^nn!}P_n^{(n)}(1) \\ &=\displaystyle \dfrac{1}{2 ^nn!}n! \biname{n}{n}^2(1-1)^{nn}(1+1)^n\\ &= 1 \end{array}

Now, for case -1, we can again use the explicit form used above. This time, only the term k = 0 is nonzero:

\begin{array}{ll}
L_n(-1) &= \displaystyle \dfrac{1}{2^nn!}P_n^{(n)}(-1) \\
&=\displaystyle \dfrac{1}{2^nn!}n! \binom{n}{0}^2(1-(-1))^{n-0}(1-1)^0\\
&= \dfrac{(-2)^n}{2^n}\\
&= (-1)^n
\end{array}

### Question 2: Orthogonality

The second case is symmetric: we will assume to ask this question that n < m. We will therefore have:

\angle L_n | L_m \rangle = \int_{-1}^1 \dfrac{1}{2^nn!}((t^2-1)^n)^{(n)} \dfrac{1}{2^mm! }((t^2-1)^m)^{(m)} dt

We will then perform m integrations by parts: We integrate m times the right-hand side and we derive m times the left-hand side. Without writing all the calculations, we note that

• -1 and 1 are roots of order m of (t2 - 1)m
• So for all k between 0 and m-1
P_m^{(k)}(1) = P_m^{(k)}(-1) = 0
• Which means that each time the hook of the integration by parts will be zero
• Moreover, the m-th derivative of Ln is zero, so the last term will be zero.

Conclusion: We have:

\angle L_n | L_m \rangle = 0

### Question 3

To calculate

\angle L_n | L_n \rangle

P_n = (X^2-1)^n

is 1. If we differentiate n times X2n, we obtain

(X^{2n})^{(n)} = 2n(2n-1)\ldots (n+1) = \dfrac{(2n)!}{n!}

We then obtain as the leading coefficient for Ln :

\dfrac{(2n)!}{2^nn!^2} = \dfrac{\binom{2n}{n}}{2^n}

This means that we can decompose Ln in :

 \dfrac{\binom{2n}{n}}{2^n} X^n +Q

with deg(Q) ≤ n – 1.
Note further that the family of Li is staggered. So we only have the family

(L_i)_{1 \leq i \leq n-1}

is a basis of

\mathbb{R}_{n-1}[X]

So we have :

Q \in vect(L_0,\ldots , L_{n-1}) \subset vect(L_n)^{\perp}

Which means that we are reduced to calculating

\angle L_n | \dfrac{\binom{2n}{n}}{2^n} X^n \rangle

We then have:

\angle L_n | X^n \rangle =\displaystyle \int_{-1}^1 L_n(t) t^n dt

We again do n integration by parts to get

\angle L_n | X^n \rangle = \dfrac{1}{2^n}\displaystyle \int_{-1}^1 (t^2-1)^n dt

The n! was simplified by differentiating n times the function which has t associates tn. We are now going to do n integrations by parts to calculate this integral. Here too the elements between square brackets are zero:

\begin{array}{ll}
\langle L_n |  X^n \rangle &=\displaystyle \dfrac{1}{2^n}\displaystyle \int_{-1}^1 (t^2-1)^n dt\\
&=\displaystyle \dfrac{1}{2^n}\displaystyle \int_{-1}^1(t-1)^n(t+1)^n dt\\
&=\displaystyle \dfrac{(-1)^n}{2^n}\displaystyle \int_{-1}^1n! \dfrac{n!}{(2n)!}(t+1)^{2n} dt\\
&=\displaystyle \dfrac{(-1)^n}{2^n\binom{2n}{n}}\left[\dfrac{(t-1)^{2n+1}}{2n+1}\right]_{-1}^1\\
&=\displaystyle \dfrac{(-1)^n}{2^n\binom{2n}{n}}\dfrac{-(-2)^{2n+1}}{2n+1}\\
&=\displaystyle \dfrac{2^{n+1}}{(2n+1)\binom{2n}{n}}
\end{array}

We finally have:

\langle L_n |L_n \rangle = \dfrac{\binom{2n}{n}}{2^n} \dfrac{2^{n+1}}{(2n+1)\binom{2n}{n} } = \dfrac{2}{2n+1}

### Question 4: Recurrence relation

We can write that, thanks to the fact that the Li form a baseand that XLn is a polynomial of degree n+1.

XL_n(X) = \sum_{k=0}^{n+1} a_kL_k(X)

However, we notice that:

\langle XL_n |L_k \rangle = \langle L_n |XL_k \rangle

with deg(XLk) = k + 1. So if k + 1 < n ie k < n – 1:

XL_k \in vector(L_0, \ldots , L_k) \subset L_n^{\perp}

So,

a_k = \langle XL_n |L_k \rangle = \langle L_n |XL_k \rangle = 0

We can therefore write:

XL_n(X) = aL_{n-1}(X) + bL_n(X) + cL_{n+1}(X)

By looking at the parity of the members, we obtain that b = 0. Then, by identifying X in 1, we obtain:

a+c = 1

Now, we look at the terms of highest degree, so n+1, we have

\dfrac{\binom{2n}{n}}{2^n} = c \dfrac{\binom{2n+2}{n+1}}{2^{n+1}}

So, simplifying, we get:

c = \dfrac{n+1}{2n+1}

Then,

a = \dfrac{n}{2n+1}

From where

XL_n(X) =\dfrac{n+1}{2n+1}L_{n-1}(X) + \dfrac{n}{2n+1}L_{n+1}(X)

And putting everything on the same side and multiplying by 2n+1, we have:

(n+1)L_{n+1} - (2n+1)xL_n +n L_{n-1} = 0

### Question 5: Differential equation

We note that :

\dfrac{d}{dx} ((1-x^2)L'_n(x)) = (1-x)^2L_n''(x) -2xL'_n(X)

Which looks a lot like part of the differential equation. Moreover, this result is of degree at most n. It can therefore be written in the form:

\dfrac{d}{dx} ((1-x^2)L'_n(x)) = \sum_{k=0}^na_k L_k(x)

Taking the scalar product by Lk, we obtain :

a_k ||L_k||^2 = \int_{-1}^1 \dfrac{d}{dx} ((1-t^2)L'_n(t)) L_k(t) dt

By doing 2 integrations by successive parts, we obtain:

a_k ||L_k||^2 = \int_{-1}^1 \dfrac{d}{dx} L_n(t)((1-t^2)L'_i(t)) dt= \langle L_n | Q_k \rangle

with deg(Qk) = k. From where

Q_k \in vector(L_0, \ldots , L_k) \subset L_n^{\perp}

Hence, if k < n, ak = 0

So we have :

(1-x)^2L_n''(x) -2xL'_n(X) = a_n L_n(X)

It suffices to look at the coefficients of higher degree to find that

a_n = -n(n+1)

And therefore:

(1-x)^2L_n''(x) -2xL'_n(X) +n(n+1) L_n(X) = 0

Which concludes this question and therefore this exercise on Legendre polynomials!

I also suggest this bonus question for you to do on your side, using the entire series. Demonstrate that :

\dfrac{1}{1-2xt+t^2} = \sum_{n=0}^{+\infty}P_n(x)t^n, |t| < 1, |x| \leq 1

Did you like this exercise?