I have another task that somehow should be trivial. Suppose I have the following expression
$$ \sum_{i=1}^n \frac{2}{9} x_i + 2 \sum_{i=1}^n \frac{1}{9} x_i, $$
or in Mathematica-FullForm
Plus[Sum[Times[Rational[2,9],Subscript[x,i]],List[i,1,n]],Times[2,Sum[Times[Rational[1,9],Subscript[x,i]],List[i,1,n]]]]
Obviously, this is equal to $ \sum_{i=1}^n \frac{4}{9} x_i $ but Mathematica 6 wouldn't see that. How can I teach Mathematica to simplify this expression in a most general way (the actual expressions I need to simplify are way more complicated, they involve multiple sums and are mostly generated by some other routines)?
EDIT (21.04.2015): By multiple sums, I meant the following general expression: $$ a \sum_{i_1=1}^n \ldots\sum_{i_k=1}^n b\cdot f(x_{i_1},\ldots,x_{i_k}) + c \sum_{i_1=1}^n \ldots \sum_{i_k=1}^n d\cdot g(x_{i_1},\ldots,x_{i_k}). $$ The constants $a,b,c,d$ may be arbitrarily complex, the $k$ may vary as well. I needed a rule that, when applied, produces $$ \sum_{i_1=1}^n \ldots \sum_{i_k=1}^n \left((a\cdot b) f(x_{i_1},\ldots,x_{i_k}) + (c \cdot d) g(x_{i_1},\ldots,x_{i_k})\right). $$
Based on your replies, I have concocted an amazingly simple solution :
HoldPattern[a_ Sum[c_, y___]] :> Sum[a c, y]
HoldPattern[Sum[a_ b_, y___] + Sum[c_ b_, y___]] :> Sum[Together[a+c] b, y]