1 | initial version |
The answer to the 'howto' question is: don't use symbolic calculus when it's not necessary (see preceding answers). Here is a tentative answer to the 'why' question. Yes there are special rules for evaluation of symbolic sums:
sage: var ('i k n t')
sage: sum(factorial(n+1-i)*k^i*t^i,i,0,n)
sum(k^i*t^i*factorial(-i + n + 1), i, 0, n)
sage: sum(factorial(n+1-i)*k^i*t^i,i,0,n)(n=3)
sum(k^i*t^i*factorial(-i + 4), i, 0, 3)
This is indeed surprising, but think of:
sage: sum(factorial(n+1-i)*k^i*t^i,i,0,n)(n=100)
sum(k^i*t^i*factorial(-i + 101), i, 0, 100)
Do you prefer this symbolic expression, or its full expansion? Hence there is no perfect strategy for evaluation of symbolic expressions, and there are also theoretical obstacles because canonical forms can't exist for symbolic expressions, even for very narrow classes.