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 2002

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

Search the Archive

Re: Sum expansion

  • To: mathgroup at
  • Subject: [mg32646] Re: [mg32630] Sum expansion
  • From: BobHanlon at
  • Date: Fri, 1 Feb 2002 16:10:44 -0500 (EST)
  • Sender: owner-wri-mathgroup at

In a message dated 2/1/02 2:26:08 AM, fischerc at writes:

>I would like to arrange exression
>A Sum [ B_i ,{i,1,s}]
>into expression
>Sum [ A B_i, {i,1,s} ]
>Following transformation code gives unwanted answer:
>A*Sum[Subscript[B, i], {i, 1, s}] /.
>  a_*Sum[b_, {i, 1, s}] -> Sum[a*b, {i, 1, s}]
>Result is
>A s Bi
>I understand, why it behawes this way, but I dont know the correct way.

Use RuleDelayed

A*Sum[Subscript[B,i], {i,1,s}] /.
  a_*Sum[b_, {i_, i0_, in_}] :> Sum[a*b, {i,i0,in}]

Bob Hanlon
Chantilly, VA  USA

  • Prev by Date: Simplify
  • Next by Date: How to draw such 3D surface?
  • Previous by thread: Sum expansion
  • Next by thread: RE: Sum expansion