# Can't retrieve Legendre equation from Laplace equation

I am tasked with the above, converting the 2-dimensional polar form of the Laplace transform:

$$\frac{\partial}{\partial r}\Bigl(r^2 \frac{\partial z}{\partial r}\Bigr) + \frac{1}{\sin(\phi)} \frac{\partial} {\partial\phi}\Bigl(\sin(\phi)\frac{\partial z}{\partial \phi}\Bigr) = 0$$

to the Legendre equation.

I was able to proceed, assuming solution $$z=\Phi(\phi)R(r)$$ using method of separation acquiring equation $$\Phi$$:

$$\frac{d}{d\phi}\Bigl(\sin(\phi) \frac{d\Phi}{d\phi}\Bigr) + \lambda \sin(\phi)\Phi=0$$

and equation $$R$$:

$$\frac{d}{dr}\Bigl(r^2 \frac{dR}{dr}\Bigr) - \lambda R=0$$

Consider only Equation $$\Phi$$. I substituted $$x = \cos(\phi) \implies \theta = \arccos(x)$$ and applied chain rule twice:

$$\frac{d(\Phi)}{dx}=\frac{d(\Phi)}{d\phi}\frac{d\phi}{dx}=-\frac{d(\Phi)}{d\phi}\frac{1}{\sqrt{1-x^2}}$$

Resulting in:

$$\sqrt{1-x^2}\frac{d}{dx}\Bigl(y\sqrt{1-x^2}\frac{d\Phi}{dx}\Bigr) + \lambda y\Phi = 0$$

However, the answer was supposed to simplify to:

$$\frac{d}{dx}\Bigl((1-x^2)\frac{d\Phi}{dx}\Bigr) + \lambda\Phi =0$$

I see the potential for the cancellation of factors which would get the correct answer, but the derivatives won't allow this. What have I done wrong?

OP here. I assumed the solution required the used of polar coordinates. This is incorrect, since the term $$\sin(\phi)$$ should have been found in terms of $$x$$ given $$x = \cos(\phi)$$
$$\sin^2(\phi) + \cos^2(\phi) = 1$$ $$\sin(\phi)=\sqrt{1-\cos^2(\phi)}$$
$$\sin(\phi) = \sqrt{1-x^2}$$
Substituting this into the equation rather than $$y$$ results in the correct result.