1

I am verifying the series representation of the Sonine polynomial or the associated Laguerre polynomial, which is

$$ L_m^{(n)}(x)=\sum\limits_{l=0}^n\left(-1\right)^l\binom{m+n}{m-l}\frac{x^l}{l!}=S_{n}^{(m)}(x) $$

In this process, I found that name of the variable can affect the calculation results, which means

Sum[(Gamma[n+m+1](-x)^l)/(l!(n-l)!Gamma[l+m+1]),{l,0,n}]

and

Sum[(Gamma[n+m+1](-x)^p)/(p!(n-p)!Gamma[p+m+1]),{p,0,n}]

will give different results.

enter image description here

I wonder why this happens. Is

xzczd
  • 65,995
  • 9
  • 163
  • 468
houzw
  • 338
  • 1
  • 7
  • 1
    They are the same mathematically speaking. Screen shot: Mathematica graphics as to why the letter used makes difference, this came up before many times. Internally there is some lexicographical ordering, which causes different code path to be taken somewhere. it is annoying ofcourse. see this as one example. There are more.... – Nasser Dec 04 '23 at 03:58
  • 2
    We really need to make a new tag called letter_used_makes_difference so it is easy to find such posts later on, as it is now hard to find these in this forum by just googling. – Nasser Dec 04 '23 at 04:12
  • 1
    @Nasser Why not? Let's add it. I'm tired of searching for such posts, too. :D – xzczd Dec 04 '23 at 05:44

2 Answers2

1

Of course, many formulas, that cannot be derived by algorithmical methods - characteristically all forms of Eulers hypergeometric series - are solved by table lookup, corrected by Wolframs work, to verify the tables by numerical approximations, series expansion and algebraical verification methods.

I remember to have read in the first times of CAS invention, that about 15% of all table formulas contain errors.

From the following you see, that general formulas for hypergeometric functions are using different table entries for values of te the summation character from a-k and o-z.

Since this is a local, integer summation variable, the results, depending on its character, show a badly coded table lookup in the sense: ?all symbols from the integer part of the alphabet i,j,k,l,m,n ?.

         ff = Function[{a}, 
             Sum[(Gamma[n + m + 1] (-x)^a)/
                 (a! (n - a)!  Gamma[a + m + 1]), 
                 {a, 0, n}]]
     (# -> ff[#] &) /@ 
        Symbol /@ (Cases[CharacterRange["a", "z"], 
                         Except["l" | "m" | "n" | "x"]]) // TableForm

$$a \dots k \to \frac{\Gamma (m+n+1) \, _1F_1(-n;m+1;x)}{\Gamma (m+1) \Gamma (n+1)}$$ $$o \dots z \to L[n, m, x]$$

If the formula is not textual 1-1 with the definition of the Laguerre polynomial, the general identification as a hypergeometric series from the recurrence formmula of the coefficients in the Taylor series is used.

Mathematica cannot identify the results. There are still large fields open to research for transforms of special function expressions into eachother by an CAS.

Roland F
  • 3,534
  • 1
  • 2
  • 10
1

The only reason I can think of, is that WL sorts sums and multiplications because of the Orderless attribute. You can easily see this when you just let it evaluate the bodies of the two sums:

enter image description here

Note the factor l! (-l + n)! in the first output and (n - p)! p! in the second because l comes before n while p comes after. I'm guessing that this difference somehow cascades to the different results, probably during a pattern matching step. It's undesirable, but this is my guess for what's going on.

Sjoerd Smit
  • 23,370
  • 46
  • 75
  • This is part of the issue. The next part is that intermediate simplifications applied by Sum and the like can have different outcomes. – Daniel Lichtblau Feb 02 '24 at 17:07