I am working on a project and I would like to make sure I use Legendre function correctly. I've made a simple comparision between mpmath and Mathematica and the results are different: for mpmath in python: import mpmath print(mpmath.legenp(-0.5, 1, 1.04018069)) the outcome is: (1.323429779732253753588079e-36 + 0.03499697660646475313011583j) And for Mathematica: LegendreP[-1/2, 1, 1.04018069] and the result is: -2.14295*10^-18 + 0.034997 I It seems they have the same imaginary part but different real part. I want to know where is the issue and how should I use the Legendre function of first and second kind, of degree one and half integer order. Continue reading...