Legendre's equation polynomial solution This is a problem on analytic solutions of ordinarry differential equations. Any help will be greatly appreciated. Please, try to be as specific as possible as I don't handle this material very well yet.
$$\displaystyle \frac{d}{dz} \left ((1-z^2) \frac{dw}{dz} \right ) + \lambda w = 0$$
What would be a condition of $\lambda$ such that the equation has a polynomial solution?
 A: Suppose the equation has a polynomial solution. Let's write it as:
$$w = a_0 + a_1 z + a_2 z^2 + \cdots + a_n z^n $$
For a simpler case, let's write $w = a_0 + a_1z$, where $a_1 \neq 0$. Then:
$$\frac{dw}{dz} = a_1$$
$$(1 - z^2)\frac{dw}{dz} = a_1 - a_1z^2$$
$$\frac{d}{dz}\left((1 - z^2)\frac{dw}{dz}\right) + \lambda w = -2a_1z + \lambda(a_0 + a_1z) = \lambda a_0 + (\lambda - 2)a_1z$$
Now, it's clear that $a_0 = 0$. But, for the second term to vanish, you see that you must have $\lambda = 2$. And, when $\lambda = 2$, $w = a_1z$ is a solution for all $a_1$. What about a quadratic: $w = a_0 + a_1z + a_2z^2$, where $a_2 \neq 0$. We have:
$$\frac{dw}{dz} = a_1 + 2a_2z$$
$$(1 - z^2)\frac{dw}{dz} = a_1 + 2a_2z - a_1z^2 - 2a_2z^3$$
\begin{align*}\frac{d}{dz}\left((1 - z^2)\frac{dw}{dz}\right) + \lambda w &= 2a_2 - 2a_1z - 6a_2z^2 + \lambda(a_0 + a_1z + a_2z^2) \\
&= (2a_2 + \lambda a_0) + (\lambda - 2)a_1 z + (\lambda - 6)a_2 z^2\end{align*}
Now, for the last term to vanish, we must have $\lambda = 6$. And, when $\lambda = 6$, $a_0 + a_2z^2$ is a solution as long as $a_2 + 3a_0 = 0$. 
At this point, you should be able to attack the general case. You should find that, for each integer $n$, there is a unique value of $\lambda$ such that there is a polynomial solution of degree $n$.
