Solution to Legendre's Differential Equation

Equation
Legendre's differential equation is a second order ODE of the form:
 * $\displaystyle \left({1 - x^2}\right) \frac{\mathrm d^2 y} {\mathrm d x^2} - 2 x \frac{\mathrm d y} {\mathrm d x} + p \left({p + 1}\right) y = 0$

Or sometimes written in the form,

$\qquad (1-{ x }^{ 2 })\ddot { y } -2x\dot { y } +p(p+1)y=0$

The parameter $p$ may be any arbitrary real or complex number.

Solution
The solutions of Legendre's differential equation are known as Legendre polynomials, and they are functions of the parameter $p$. The Solution of the Legendre Differential Equation can be obtained by Power Series Solution method.

Assume,

$\displaystyle y=\sum _{ n=0 }^{ \infty }{ { a }_{ n } } { x }^{ k-n }$ and ${ a }_{ 0 }\neq 0$

Differenciating,

$\displaystyle\dot { y } =\sum _{ n=0 }^{ \infty }{ { a }_{ n } } (k-n){ x }^{ k-n-1 }$

$\displaystyle\ddot { y } =\sum _{ n=0 }^{ \infty }{ { a }_{ n } } (k-n)(k-n-1){ x }^{ k-n-2 }$

Substituting in the original equation,

$\displaystyle(1-{ x }^{ 2 })\ddot { y } -2x\dot { y } +p(p+1)y=0 \\\displaystyle\Rightarrow(1-{ x }^{ 2 })\sum _{ n=0 }^{ \infty }{ { a }_{ n } } (k-n)(k-n-1){ x }^{ k-n-2 }-2x\sum _{ n=0 }^{ \infty  }{ { a }_{ n } } (k-n){ x }^{ k-n-1 }+p(p+1)\sum _{ n=0 }^{ \infty  }{ { a }_{ n } } { x }^{ k-n }=0 \\\displaystyle\Rightarrow\sum _{ n=0 }^{ \infty }{ { a }_{ n } } (k-n)(k-n-1){ x }^{ k-n-2 }-{ x }^{ 2 }\sum _{ n=0 }^{ \infty  }{ { a }_{ n } } (k-n)(k-n-1){ x }^{ k-n-2 }-2x\sum _{ n=0 }^{ \infty  }{ { a }_{ n } } (k-n){ x }^{ k-n-1 }+p(p+1)\sum _{ n=0 }^{ \infty  }{ { a }_{ n } } { x }^{ k-n }=0$

Multiplying $x$ into the summation, (since the summation doesn't depend on the variable $x$ but $n$)

$\displaystyle\Rightarrow\sum _{ n=0 }^{ \infty }{ { a }_{ n } } (k-n)(k-n-1){ x }^{ k-n-2 }-\sum _{ n=0 }^{ \infty  }{ { a }_{ n } } (k-n)(k-n-1){ x }^{ k-n }-2\sum _{ n=0 }^{ \infty  }{ { a }_{ n } } (k-n){ x }^{ k-n }+p(p+1)\sum _{ n=0 }^{ \infty  }{ { a }_{ n } } { x }^{ k-n }=0 \\\displaystyle\Rightarrow\sum _{ n=0 }^{ \infty }{ { a }_{ n } } (k-n)(k-n-1){ x }^{ k-n-2 }+\sum _{ n=0 }^{ \infty  }{ { a }_{ n } } { x }^{ k-n }\left[ p(p+1)-(k-n)(k-n-1)-2(k-n) \right] =0$

Increasing the summation variable $n$ to $n+2$,

$\displaystyle\Rightarrow\sum _{ n=2 }^{ \infty }{ { a }_{ n-2 } } (k-n+2)(k-n+1){ x }^{ k-n }+\sum _{ n=0 }^{ \infty  }{ { a }_{ n } } { x }^{ k-n }\left[ p(p+1)-(k-n)(k-n+1) \right] =0$

Taking the first 2 terms of the second summation out,

$\displaystyle\Rightarrow\sum _{ n=2 }^{ \infty }{ { a }_{ n-2 } } (k-n+2)(k-n+1){ x }^{ k-n }+{ a }_{ 0 }{ x }^{ k }\left[ p(p+1)-k(k+1) \right] +{ a }_{ 1 }{ x }^{ k-1 }\left[ p(p+1)-k(k-1) \right] +\sum _{ n=2 }^{ \infty  }{ { a }_{ n-2 } } { x }^{ k-n } + { a }_{ n } \left[ p(p+1)-(k-n)(k-n+1) \right] =0 \\\displaystyle\Rightarrow{ a }_{ 0 }{ x }^{ k }\left[ p(p+1)-k(k+1) \right] +{ a }_{ 1 }{ x }^{ k-1 }\left[ p(p+1)-k(k-1) \right] +\sum _{ n=2 }^{ \infty }{ { x }^{ k-n }\left\{ { a }_{ n-2 }(k-n-2)(k-n+1) + { a }_{ n }\left[ p(p+1)-(k-n)(k-n+1) \right]  \right\}  } =0$

Equating each term to $0$,

$\displaystyle{ a }_{ 0 }{ x }^{ k }\left[ p(p+1)-k(k+1) \right] =0$ (Eqn 1)

$\displaystyle\\ { a }_{ 1 }{ x }^{ k-1 }\left[ p(p+1)-k(k-1) \right] =0$ (Eqn 2)

$\displaystyle\\ \sum _{ n=2 }^{ \infty }{ { x }^{ k-n }\left\{ { a }_{ n-2 }(k-n-2)(k-n+1) + { a }_{ n }\left[ p(p+1)-(k-n)(k-n+1) \right]  \right\}  } =0$ (Eqn 3)

Now,

$\displaystyle{ a }_{ 0 }{ x }^{ k }\left[ p(p+1)-k(k+1) \right] =0$ (Eqn 1)

Since we have assumed ${ a }_{ 0 }\neq 0$ and ${ x }^{ k }$ can never be zero for any value of $k$,

$\displaystyle p(p+1)-k(k+1)\\ \Rightarrow { p }^{ 2 }-{ k }^{ 2 }+p-k=0\\ \Rightarrow (p-k)(p+k)+(p-k)=0\\ \Rightarrow (p-k)(p+k+1)=0\\ \Rightarrow p-k=0\quad or\quad p+k+1=0\\ \Rightarrow k=p\quad or\quad k=-p-1$

$\displaystyle{ a }_{ 1 }{ x }^{ k-1 }\left[ p(p+1)-k(k-1) \right] =0$ (Eqn 2)

Similarly, as ${ x }^{ k-1 }$ can never be zero,

$\displaystyle{ a }_{ 1 }\left[ p(p+1)-k(k-1) \right] =0$

Substituting the value of $k$ from Eqn 1,

$\displaystyle\qquad2{ a }_{ 1 }k =0$

Since $2k \neq 0$,

$\displaystyle{ a }_{ 1 }=0$

$\displaystyle\sum _{ n=2 }^{ \infty }{ { x }^{ k-n }\left\{ { a }_{ n-2 }(k-n-2)(k-n+1) + { a }_{ n }\left[ p(p+1)-(k-n)(k-n+1) \right]  \right\}  } =0$ (Eqn 3)

Since ${ x }^{ k-n }$ can never be $0$,

$\displaystyle{ a }_{ n-2 }(k-n-2)(k-n+1) + { a }_{ n }\left[ p(p+1)-(k-n)(k-n+1) \right]$

$\displaystyle\Rightarrow{ a }_{ n }=-\frac { (k-n+2)(k-n+1) }{ p(p+1)-(k-n)(k-n+1) } { a }_{ n-2 }$ (Eqn 4)

Since Legendre Differential Equation is a second order ODE, it has two independent solutions.

Solution 1 (for $k=p$):

$\displaystyle y={ x }^{ p }\sum _{ n=0 }^{ \infty }{ { a }_{ n } } { x }^{ -n }$

$\displaystyle\Rightarrow y={ x }^{ k }\left[ { a }_{ 0 }+{ a }_{ 1 }{ x }^{ -1 }+{ a }_{ 2 }{ x }^{ -2 }+{ a }_{ 3 }{ x }^{ -3 }+{ a }_{ 3 }{ x }^{ -4 }+\dots \right]$

From Eqn 4,

$\displaystyle{ a }_{ n }=-\frac { (p-n+2)(p-n+1) }{ p(p+1)-(p-n)(p-n+1) } { a }_{ n-2 }\\\displaystyle \Rightarrow { a }_{ n }=-\frac { (p-n+2)(p-n+1) }{ n(2p-n+1) } { a }_{ n-2 }$

For $n=2$, $\displaystyle { a }_{ 2 }=-\frac { p(p-1) }{ 2(2p-1) } { a }_{ 0 }$

For $n=4$, $\displaystyle { a }_{ 4 }=-\frac { (p-2)(p-3) }{ 4(2p-3) } { a }_{ 2 }=\frac { p(p-1)(p-2)(p-3) }{ 2\cdot 4(2p-1)(2p-3) } { a }_{ 0 }$

For $n=6$, $\displaystyle { a }_{ 6 }=-\frac { (p-4)(p-5) }{ 6(2p-5) } { a }_{ 4 }=-\frac { p(p-1)(p-2)(p-3)(p-4)(p-5) }{ 2\cdot 4 \cdot 6(2p-1)(2p-3)(2p-5) } { a }_{ 0 }$

Similarly, $\displaystyle { a }_{ 2n }={ (-1) }^{ n }\frac { p(p-1)(p-2)(p-3)\dots (p-2n-1) }{ [2\cdot 4\cdot 6\dots 2n](2p-1)(2p-3)(2p-3)\dots (2p-2n+1) } { a }_{ 0 }$

And, ${ a }_{ 3 }={ a }_{ 5 }={ a }_{ 7 }=\dots ={ a }_{ 2n+1 }={ a }_{ 1 }=0$

Substituting the value of ${ a }_{ n }$,

$\displaystyle\Rightarrow y={ a }_{ 0 }{ x }^{ k }\left[ 1+\frac { -p(p-1) }{ 2(2p-1) } { x }^{ -2 }+\frac { p(p-1)(p-2)(p-3) }{ 2\cdot 4(2p-1)(2p-3) } { x }^{ -4 }+\dots +{ (-1) }^{ n }\frac { -p(p-1)(p-2)...(p-2n+1) }{ \{ 2\cdot 4\cdot 6\dots 2n\} (2p-1)(2p-3)\dots (p-2n+1) } { x }^{ -2n }+\dots \right] $

Solution 2 (for $k=-p-1$):

$\displaystyle y={ x }^{ -p-1 }\sum _{ n=0 }^{ \infty }{ { a }_{ n } } { x }^{ -n }$

$\displaystyle\Rightarrow y={ x }^{ -k-1 }\left[ { a }_{ 0 }+{ a }_{ 1 }{ x }^{ -1 }+{ a }_{ 2 }{ x }^{ -2 }+{ a }_{ 3 }{ x }^{ -3 }+{ a }_{ 3 }{ x }^{ -4 }+\dots \right]$

From Eqn 4,

$\displaystyle{ a }_{ n }=-\frac { (-p-1-n+2)(-p-1-n+1) }{ p(p+1)-(-p-1-n)(-p-n) } { a }_{ n-2 }\\\displaystyle \Rightarrow { a }_{ n }=\frac { (p+n-1)(p+n) }{ n(2p+n+1) } { a }_{ n-2 }$

For $n=2$, $\displaystyle { a }_{ 2 }=\frac { (p+1)(p+2) }{ 2(2p+3) } { a }_{ 0 }$

For $n=4$ $\displaystyle { a }_{ 4 }=\frac { (p+3)(p+4) }{ 4(2p+5) } { a }_{ 2 }=\frac { (p+1)(p+2)(p+3)(p+4) }{ 2\cdot 4(2p+3)(2p+5) } { a }_{ 0 }$

For $n=6$, $\displaystyle { a }_{ 6 }=\frac { (p+5)(p+6) }{ 6(2p+7) } { a }_{ 4 }=\frac { (p+1)(p+2)(p+3)(p+4)(p+5)(p+6) }{ 2\cdot 4\cdot 6(2p+3)(2p+5)(2p+7) } { a }_{ 0 }$

Similarly, $\displaystyle { a }_{ 2n }=\frac { (p+1)(p+2)(p+3)\dots (p+2n) }{ [2\cdot 4\cdot 6\dots 2n](2p+3)(2p+5)(2p+7)\dots (2p+2n+1) } { a }_{ 0 }$

And, ${ a }_{ 3 }={ a }_{ 5 }={ a }_{ 7 }=\dots ={ a }_{ 2n+1 }={ a }_{ 1 }=0$

$\displaystyle y={ a }_{ 0 }{ x }^{ -k-1 }\left[ 1+\frac { (p+1)(p+2) }{ 2(2p+3) } { x }^{ -2 }+\frac { (p+1)(p+2)(p+3)(p+4) }{ 2\cdot 4(2p+3)(2p+5) } { x }^{ -4 }+\dots +{ (-1) }^{ n }\frac { (p+1)(p+2)(p+3)...(p+2n) }{ \{ 2\cdot 4\cdot 6\dots 2n\} (2p+3)(2p+5)\dots (p-2n) } { x }^{ -2n }+\dots \right]$

Finally the two solution are,

$\displaystyle\Rightarrow y={ a }_{ 0 }{ x }^{ k }\left[ 1+\frac { -p(p-1) }{ 2(2p-1) } { x }^{ -2 }+\frac { p(p-1)(p-2)(p-3) }{ 2\cdot 4(2p-1)(2p-3) } { x }^{ -4 }+\dots +{ (-1) }^{ n }\frac { -p(p-1)(p-2)...(p-2n+1) }{ \{ 2\cdot 4\cdot 6\dots 2n\} (2p-1)(2p-3)\dots (p-2n+1) } { x }^{ -2n }+\dots \right] $

and,

$\displaystyle y={ a }_{ 0 }{ x }^{ -k-1 }\left[ 1+\frac { (p+1)(p+2) }{ 2(2p+3) } { x }^{ -2 }+\frac { (p+1)(p+2)(p+3)(p+4) }{ 2\cdot 4(2p+3)(2p+5) } { x }^{ -4 }+\dots +{ (-1) }^{ n }\frac { (p+1)(p+2)(p+3)...(p+2n) }{ \{ 2\cdot 4\cdot 6\dots 2n\} (2p+3)(2p+5)\dots (p-2n) } { x }^{ -2n }+\dots \right]$