# Proving that Legendre Polynomial is orthogonal

This is from here

$$\int^1_{-1}f_n(x)P_n(x)dx = 2(-1)^n\frac{a_n}{2^n}\int^1_0(x^2-1)^ndx=2(-1)^n\frac{a_n}{2^n}.I_n$$........(6)

I don't understand as in shouldnt it be like this, $$\int^1_{-1}f_n(x)P_n(x)dx = (-1)^n\frac{a_n}{2^n}\int^1_{-1}(x^2-1)^ndx=0$$ as they should cancel out even if the integral is non-zero.

Edited: Lastly, how does $\int^1_{-1}f_n(x)P_n(x)dx$ shows orthogonality?

• Here $f_n$ is an arbitrary polynomial of degree $\le n$. If $f_n$ is of lower degree then the coefficient $a_n$ is $0$. In particular $\int P_m(x) P_n(x)\, dx = 0$ for any $m<n$. By symmetry this is also true when $m>n$, i.e. for $m\ne n$. – Erick Wong Nov 8 '16 at 3:42

Here is a much simpler proof from Special Functions and Their Applications by N. N. Lebedev.

We begin with Legendre's differential equation $$[(1-x^{2})P^{\prime}_{n}(x)]^{\prime} +n(n+1)P_{n}(x) = 0,\quad n \in \mathbb{Z}_{0}^{+} \label{eq:lp1} \tag{1}$$

The first step is to multiple equation \eqref{eq:lp1} by $P_{m}(x)$ and subtract it from equation \eqref{eq:lp1} written for $m$ and multiplied by $P_{n}(x)$.

$$[(1-x^{2})P^{\prime}_{m}(x)]^{\prime}P_{n}(x) \,-\, [(1-x^{2})P^{\prime}_{n}(x)]^{\prime}P_{m}(x) + [m(m+1)-n(n+1)]P_{m}(x)P_{n}(x) = 0$$

Rearrangement yields $$\{(1-x^{2})[P^{\prime}_{m}(x)P_{n}(x)-P^{\prime}_{n}(x)P_{m}(x)]\}^{\prime} + (m-n)(m+n+1)P_{m}(x)P_{n}(x) = 0 \label{eq:lp2} \tag{2}$$

Integrating equation \eqref{eq:lp2} from -1 to 1, the first term goes to 0 and we are left with $$(m-n)(m+n+1) \int\limits_{-1}^{1} P_{m}(x)P_{n}(x) dx = 0$$ or $$\int\limits_{-1}^{1} P_{m}(x)P_{n}(x) dx = 0, \quad m \ne n$$

• In eqn (2) how did you get the $(1-x^2)$ factor out of the derivative? – daljit97 Feb 7 at 18:02

By parity, for any even integrable function $f$, we have $$\int_{-a}^af(x)dx=2\int_{0}^af(x)dx$$ giving here $$\int^1_{-1}(x^2-1)^ndx=2\int^1_{0}(x^2-1)^ndx.$$