Mathematica 9 is now available
Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to Extract a common factor from a Sum

  • To: mathgroup at
  • Subject: [mg12952] Re: How to Extract a common factor from a Sum
  • From: "Stephen P Luttrell" <luttrell at>
  • Date: Sun, 28 Jun 1998 02:51:44 -0400
  • Organization: Defence Evaluation and Research Agency
  • References: <6mq9k4$>
  • Sender: owner-wri-mathgroup at

>I have a symbolical sum like
>expr = Sum[ a f[k], {k,1,N}] and I want to force Mathematica to write
>this as
>expr = a Sum[f[k], {k,1,N}]
>What ever I tried it did not work.
>Does anyone knows a solution?

Add the following definition to Sum:

Sum[a x_,y__]:=a Sum[x,y];

where the double blank __ allows multiple sums to be matched.

Now evaluate your expression

Sum[ a f[k], {k,1,N}]

to obtain the result

a Sum[f[k], {k, 1, N}]

Here is a double summation

Sum[ a  f[k,l], {k,1,N},{l,1,M}]

which yields the output

a Sum[f[k,l],{k,1,N},{l,1,M}]


Stephen P Luttrell
luttrell at
Adaptive Systems Theory                           01684-894046 (phone)
Room EX21, DERA                                    01684-894384 (fax)
Malvern, Worcs, WR14 3PS, U.K.

  • Prev by Date: Re: Piecewise defined functions
  • Next by Date: Re: Inconsistencies in pattern matching.
  • Previous by thread: Re: How to Extract a common factor from a Sum
  • Next by thread: Visual c++ mathematics