How can I get Mathematica to collect terms from an indexed sum? My application is somewhat convoluted, but this minimum code captures the idea:
s[i_, n_] :=
Sum[l[i, j]*e[c[j]], {j, 1, n}] + Sum[m[i, j]*e[c[j]], {j, 1, n}] +
Sum[l[i, j]*e[z[j]], {j, 1, n}] + Sum[m[i, j]*e[z[j]], {j, 1, n}]
I'm trying to use Collect to report $\sum _ {j = 1}^n e (c (j)) [l (i, j) + m (i, j)] + \sum _ {j = 1}^n e (z (j)) [l (i, j) + m (i, j)]$
How can I achieve that?