# Bug in associated Legendre Polynomials?

Mathematica's definition of the connection of associated Legendre polynomials with $m$ and $-m$ is:

$P_l^{-m}=(-1)^m \frac{(l-m)!}{(l+m)!} P_l^m$.

We also now that $|m|>l \Rightarrow P_l^m=0$. Try this in Mathematica and tell me if it is a bug or can be explained by something else:

LegendreP[0,1,x]


and

LegendreP[0,-1,x]


The first one will give 0, which to my knowledge is correct. The second one yields $\sqrt{1-x}/\sqrt{1+x}$ although it should also yield 0! Why?

The identity $P_{\ell}^{-m}(z) =(-1)^m \frac{(\ell-m)!}{(\ell+m)!} P_{\ell}^m (z)$ only holds for $$(\ell, m) \in \left\{ \mathbb{Z}_{\geqslant 0} \times \mathbb{Z} \colon -\ell \leqslant m \leqslant \ell\right\}.$$
Mathematica's definition for associated Legendre's polynomial is given by formula 05.07.02.0001.01: $$P_{\ell}^{\mu}(z) = \frac{\left(1+z\right)^{\mu/2}}{\left(1-z\right)^{\mu/2}} \sum_{k}^{\ell} \frac{(-\ell)_k \cdot \left(\ell+1\right)_k}{\Gamma\left(k + 1-\mu\right)} \cdot \frac{\left(1-z\right)^2}{2^k \cdot k!}$$ This formula is also consistent with NIST's DLMF/14.3.E1.
In particular, for $\ell = 0$: $$P_0^{\mu}\left(z\right) = \frac{\left(1+z\right)^{\mu/2}}{\left(1-z\right)^{\mu/2}} \cdot \frac{1}{\Gamma(1-\mu)}$$ which makes it zero for positive integer values of $\mu$, but not for non-positive integer values.
• Actually, I think there is something wrong here. The answer is correct if taken by itself, but it is inconsistent with the definition of SphericalHarmonicY because there you do get 0 for {l,m} = {1,-1}. – Jens Jan 22 '15 at 20:48