In Griffith's "Introduction to quantum mechanics", the spherical harmonics are defined for integers $l$ and $-l\leq m\leq l$ as $$Y_{l}^m(\theta,\phi) = \epsilon \sqrt{\frac{2l+1}{4\pi}\frac{(l-|m|)!}{(l+|m|)!}}e^{im\phi} P_{l}^m (\cos \theta)$$ where $\epsilon=(-1)^m$ for $m\geq 0$ and $\epsilon=1$ for $m\leq 0$.
Also, $$P_{\ell}^m (x) = \frac{(-1)^l}{2^l l!} (1-x^2)^{|m|/2} \left(\frac{d}{dx} \right)^{l+|m|} \left( 1-x^2 \right)^l$$ are the associated Legendre functions. Clearly then
$$P_{\ell}^m (\cos \theta) = \frac{(-1)^l}{2^l l!} \sin^{|m|}\theta \left(\frac{d}{d\cos\theta} \right)^{l+|m|} \sin^{2l} \theta$$ so that $$Y_{l}^m(\theta,\phi) = \epsilon \frac{(-1)^l}{2^l l!} \sqrt{\frac{2l+1}{4\pi}\frac{(l-|m|)!}{(l+|m|)!}}e^{im\phi} \sin^{|m|}\theta \left(\frac{d}{d\cos\theta} \right)^{l+|m|} \sin^{2l} \theta.$$
Now, other books claim that the Spherical harmonics can be written as
$$Y_{l}^m(\theta,\phi) = \frac{(-1)^l}{2^l l!} \sqrt{\frac{2l+1}{4\pi}\frac{(l+m)!}{(l-m)!}}e^{im\phi} \sin^{-m}\theta \left(\frac{d}{d\cos\theta} \right)^{l-m} \sin^{2l} \theta.$$ for any $l,m$, but I cannot see why this is true. Clearly the two become equal for $m \leq 0$, but how to show equivalence for $m \geq 0$?