Theorem: Solution to Legendre's Differential Equation

The solution of Legendre's differential equation:
{{:Definition:Legendre's Differential Equation}}
is:
:$\ds A \paren {\sum_{n \mathop = 0}^\infty \prod_{k \mathop = 1}^n \paren {\paren {2 n - 2 k} \paren {2 n - \paren {2 k - 1} } - p \paren {p + 1} } a_0 \frac {x^{2 n} } {2 n!} } + B \paren {\sum_{n \mathop = 0}^\infty \prod_{k \mathop = 1}^n \paren {\paren {\paren {2 n + 1} - 2 k} \paren {\paren {2 n + 1} - \paren {2 k - 1} } - p \paren {p + 1} } a_1 \frac {x^{2 n + 1} } {\paren {2 n + 1}! } }$

Proof:
Begin with the ansatz:
:$\ds y = \sum_{n \mathop = 0}^\infty a_n x^n$
Differentating {{WRT|Differentiation}} $x$:
:$\ds \dot y = \sum_{n \mathop = 0}^\infty a_n n x^{n - 1}$
:$\ds \ddot y = \sum_{n \mathop = 0}^\infty a_n n \paren {n - 1} x^{n - 2}$
Substituting in the original equation:
{{begin-eqn}}
{{eqn | l = \paren {1 - x^2} \ddot y - 2 x \dot y + p \paren {p + 1} y
      | r = 0
      | c = 
}}
{{eqn | ll= \leadsto
      | l = \paren {1 - x^2} \sum_{n \mathop = 0}^\infty a_n n \paren {n - 1} x^{n - 2} - 2 x \sum_{n \mathop = 0}^\infty a_n n x^{n - 1} + p \paren {p + 1} \sum_{n \mathop = 0}^\infty a_n x^n
      | r = 0
      | c = 
}}
{{eqn | ll= \leadsto
      | l = \sum_{n \mathop = 0}^\infty a_n n \paren {n - 1} x^{n - 2} - x^2 \sum_{n \mathop = 0}^\infty a_n n \paren {n - 1} x^{n - 2}
      | o = 
      | c = 
}}
{{eqn | l = {} - 2 x \sum_{n \mathop = 0}^\infty a_n n x^{n - 1}  + p \paren {p + 1} \sum_{n \mathop = 0}^\infty a_n x^n
      | r = 0
      | c = 
}}
{{end-eqn}}
Multiply the $x$'s into the summations, thus:
{{begin-eqn}}
{{eqn | ll= \leadsto
      | l = \sum_{n \mathop = 0}^\infty a_n n \paren {n - 1} x^{n - 2}
      | o = 
      | c = 
}}
{{eqn | l = {} - \sum_{n \mathop = 0}^\infty a_n n \paren {n - 1} x^n - 2 \sum_{n \mathop = 0}^\infty a_n n x^n  + p \paren {p + 1} \sum_{n \mathop = 0}^\infty a_n x^n
      | r = 0
      | c = 
}}
{{eqn | ll= \leadsto
      | l = \sum_{n \mathop = 0}^\infty a_n n \paren {n - 1} x^{n - 2}
      | o = 
      | c = 
}}
{{eqn | l = {} + \sum_{n \mathop = 0}^\infty a_n \paren {p \paren {p + 1} - n \paren {n - 1} - 2 n } x^n
      | r = 0
      | c = 
}}
{{end-eqn}}
The first summation is $0$ for $n = 0$ and $n = 1$
Reindex the first summation by increasing the summation variable $n$ to $n + 2$:
{{begin-eqn}}
{{eqn | ll= \leadsto
      | l = \sum_{n \mathop = 0}^\infty a_{n + 2} \paren {n + 2} \paren {n + 1} x^n
      | o = 
      | c = 
}}
{{eqn | l = {} + \sum_{n \mathop = 0}^\infty a_n \paren {p \paren {p + 1} - n \paren {n - 1 + 2} } x^n
      | r = 0
      | c = 
}}
{{end-eqn}}
Equating coefficients of each $x^n$ term to $0$, we obtain the recurrence:
{{begin-eqn}}
{{eqn | l = a_{n + 2} \paren {n + 2} \paren {n + 1} + a_n \paren {p \paren {p + 1} - n \paren {n + 1} }
      | r = 0
      | c = 
}}
{{eqn | ll= \leadsto
      | l = a_{n + 2} \paren {n + 2} \paren {n + 1}
      | r = - a_n \paren {p \paren {p + 1} - n \paren {n + 1} }
      | c = 
}}
{{eqn | ll= \leadsto
      | l = a_{n + 2}
      | r = \frac {\paren {n \paren {n + 1} - p \paren {p + 1} } } {\paren {n + 2} \paren {n + 1} } a_n
      | c = 
}}
{{end-eqn}}
Since Legendre's differential equation is a second order ODE, it has two independent solutions.
These two independent solutions are based upon whether the index of $a_n$ is even or odd.