# Clarification of legendre polynomials from WolframMathWorld

I don't understand the way they got to the angle-based equation. What I did is in blue, what seems to be the problem in pink.

This is an application of the chain rule. First, note that

$x = \cos(\theta) \implies \frac{\partial}{\partial x} = \frac{\partial \theta}{\partial x}\frac{\partial}{\partial \theta} = -\frac{1}{\sin(\theta)}\frac{\partial}{\partial \theta}$

Now,

$\frac{\partial^2}{\partial x^2} = \frac{\partial}{\partial x}\left(\frac{\partial}{\partial x}\right)$

which on substituting from above becomes

$-\frac{1}{\sin{\theta}}\frac{\partial}{\partial \theta} \left(-\frac{1}{\sin{\theta}}\frac{\partial}{\partial \theta} \right)$

Now apply the chain rule to get

$-\frac{1}{\sin{\theta}}\left(-\frac{1}{\sin(\theta)}\frac{\partial^2}{\partial \theta^2} + \frac{\cos(\theta)}{\sin^2(\theta)} \frac{\partial}{\partial \theta} \right)$

and simplify to finally get

$\frac{\partial^2}{\partial x^2} = \frac{1}{\sin^2{\theta}} \frac{\partial}{\partial \theta^2} - \frac{\cos{\theta}}{\sin^3{\theta}}\frac{\partial}{\partial \theta}$

Put it all together:

$\sin^2{\theta}\frac{\partial^2}{\partial x^2} - 2 \cos{\theta}\frac{\partial}{\partial x} = \frac{\partial}{\partial \theta^2} - \frac{\cos(\theta)}{\sin(\theta)}\frac{\partial}{\partial \theta} + 2 \frac{\cos(\theta)}{\sin(\theta)}\frac{\partial}{\partial \theta} = \frac{\partial}{\partial \theta^2} + \frac{\cos(\theta)}{\sin(\theta)}\frac{\partial}{\partial \theta}$

and the $l(l+1)$ term remains the same.