1

I have a series like this:

Sum[(n/z)^(1 - j + n)*Binomial[1 + n, j]*G[j], {j, 0, 1 + n}]/ ((1 + n)*(n/z)^n)

Before

where G[j] is, at this stage, "some function", unspecified. n is usually pretty large and at some point I'll be truncating the series with an O(n+2) term at the end; but let's not go there just yet.

What I would like to see is, as you might expect:

After

or

Sum[((n/z)^(1 - j)*Binomial[1 + n, j]*G[j])/(1 + n), {j, 0, 1 + n}]

I can't see any way from getting from one to the other and get rid of the notion that simple rearrangements of terms are something that I ought to be able to do.

Can anyone point me in the right direction?

Sektor
  • 3,320
  • 7
  • 27
  • 36

1 Answers1

1
exp = Sum[(n/z)^(1 - j + n)*Binomial[1 + n, j]*G[j], {j, 0, 1 + n}]/((1 + n)*(n/z)^n); 

exp /. a_ Sum[x_, y___] :> Sum[a x, y]

Mathematica graphics

kglr
  • 394,356
  • 18
  • 477
  • 896
  • +1. Or perhaps exp /. a_ Sum[x_, y___] /; FreeQ[a, Alternatives @@ {y}[[All, 1]]] :> Sum[a x, y] for the cautious. (Or ! Internal`DependsOnQ[..] instead of FreeQ, but that might allow more than is desired; e.g. nested sums with the same index. While legal in M, no editor would probably allow it.) – Michael E2 May 31 '15 at 14:12
  • Thank you @MichaelE2, for the vote and the caution. Didn't think about nested sums and possible dependence of a on indices. – kglr May 31 '15 at 14:39