MathGroup Archive 2002

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

Search the Archive

Re: Sum expansion


In a message dated 2/1/02 2:26:08 AM, fischerc at itam.cas.cz 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