Implicit Sum and linear functions



On 5/20/08, Paulo Grahl <pgrahl at gmail.com> wrote:

> E(sum(f(i),i,1,n)) does not expand to sum(E(f(i)),i,1,n).
>  Any idea on how I implement such an expansion ?

I may be overlooking something simpler, but the following might be useful.

matchdeclare ([aa, bb, cc], all);
matchdeclare (dd, lambda ([ee], ee < inf));
simp : false;
tellsimp (E ('sum (aa, bb, cc, dd)), apply (nounify (sum), [E (aa),
bb, cc, dd]));
simp : true;

E ('sum (g (k), k, 1, 5));
 => 'sum (E (g (k)), k, 1, 5);

E ('sum (h (k), k, 1, n));
 => 'sum (E (h (k)), k, 1, n)

E ('sum (f (i), i, 1, inf));
 => E ('sum (f (i), i, 1, inf))

There are some limitations. (1) This works only for E, not any other
function (unless rules are made for them too).
(2) Should check the lower limit of summation as well as the upper.
(3) For an infinite sum, maybe there should be a test on the summand;
but then the appropriate test depends on E, right?
I don't know what to do in general.

Anyway I hope this is helpful in some way.

Robert Dodier