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,

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

Differenciating,

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

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

Substituting in the original equation,

$(1-{ x }^{ 2 })\ddot { y } -2x\dot { y } +p(p+1)y=0 \\\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 \\\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$)

$\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 \\\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$,

$\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,

$\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 \\\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$,

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

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

$\\ \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,

${ 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$,

$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$

${ 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,

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

Substituting the value of $k$ from Eqn 1,

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

Since $2k \neq 0$,

${ a }_{ 1 }=0$

$\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$,

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

$\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:

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

$\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]$

Substituting the value of ${ a }_{ n }$ from Eqn 4,

$\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

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

$\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]$

Substituting the value of ${ a }_{ n }$ from Eqn 4,

$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,

$\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,

$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]$