Answer
See below
Work Step by Step
Given:
$\frac{d^2}{d\phi ^2}Y+\cot \phi \frac{d}{d\phi}Y+\alpha(\alpha +1)Y=0$
Assume $x=\cos \phi$ we get:
$\frac{dY}{d\phi}=\frac{dx}{d\phi} \times \frac{dY}{dx}\\
=-\sin \phi \times \frac{dY}{dx}\\
=-\sqrt 1-x^2 \frac{dY}{dx}$
and $\frac{d^2Y}{d\phi^2}=-\sqrt 1-x^2 \times \frac{d}{dx} (-\sqrt 1-x^2 \times \frac{dY}{dx})\\
=-x\frac{dY}{dx}+\frac{(1-x^2)d^2Y}{dx^2}$
Substituting:
$x\frac{dY}{dx}+\frac{(1-x^2)d^2Y}{dx^2}+\frac{-x\sqrt 1-x^2 dY}{\sqrt 1-x^2 dx}+\alpha(\alpha +1)Y=0 \\
(1-x^2)\frac{d^2Y}{dx^2}-2x\frac{dY}{dx}+\alpha(\alpha +1)Y=0$