MathGroup Archive 1998

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

Search the Archive

Re: How to Extract a common factor from a Sum


Hi Frank,
try

extractFactor=
  Sum[expr_Times,{k_,a__}]:>
    Times@@Cases[expr,_?(FreeQ[#,k]&)]Sum[
        Evaluate[DeleteCases[expr,_?(FreeQ[#,k]&)]],{k,a}]

Jrgen


-----Original Message-----
From: Frank Loewenthal <loewenthal at iap.unibe.ch> To:
mathgroup at smc.vnet.net
Subject: [mg12990] [mg12882] How to Extract a common factor from a Sum


>Hi Folks
>
>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?
>
>Thanks in advance
>
>Frank
>



  • Prev by Date: How to declare Integers?
  • Next by Date: (a-b)/(c-d)=!=(b-a)/(d-c) ???
  • Previous by thread: How to Extract a common factor from a Sum
  • Next by thread: Re: How to Extract a common factor from a Sum