8
$\begingroup$

Mathematica computes for n = 1,2,...:

(-1)^n (LegendreP[n, -1, -3]/Sqrt[2])
-I, -3 I, -11 I, -45 I, -197 I, ...

Maple computes for n = 1,2,...:

(-1)^n*LegendreP(n, -1, -3)/sqrt(2)
1, 3, 11, 45, 197, ...    

Question: Is there a bug or just different definitions?

Edit: Which one conforms with the (standard) definition in the Handbook of Mathematical Functions respectively with the definition in DLMF?

$\endgroup$
1

2 Answers 2

10
$\begingroup$

Yes, they have different definitions:

  • Maple

Legendre function in Maple

  • Mathematica

Legendre function in Mathematica

  • Wikipedia

$$P_\ell^m(x)=(-1)^m \left(1-x^2\right)^{m/2} \frac{\mathrm d^m}{\mathrm dx^m} P_\ell(x)$$

This difference produces different complex phases (different branches of the square root).

$\endgroup$
1
  • 2
    $\begingroup$ @SophiaAntipolis It seems to me that DLMF corresponds to Mathematica: dlmf.nist.gov/14.6 $\endgroup$
    – ybeltukov
    Sep 6, 2014 at 16:33
5
$\begingroup$

Something ybeltukov forgot to mention: LegendreP[] takes a third optional parameter corresponding to the "type" of Legendre function needed. There are three types, all agreeing within the unit disk, but having different branch cut structures outside it. By default, the type 1 function is computed: LegendreP[n, m, z] == LegendreP[n, m, 1, z].

In particular, Maple's choice of type corresponds to type 3 in Mathematica's convention. Thus:

Table[(-1)^n LegendreP[n, -1, 3, -3]/Sqrt[2], {n, 5}]
   {1, 3, 11, 45, 197}

P.S. Similar remarks hold for LegendreQ[].

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.