Q: About constants inside Distribute

*To*: mathgroup at smc.vnet.net*Subject*: [mg9187] Q: About constants inside Distribute*From*: sergio at scisun.sci.ccny.cuny.edu (Sergio Rojas)*Date*: Tue, 21 Oct 1997 02:03:01 -0400*Organization*: City College Of New York - Science*Sender*: owner-wri-mathgroup at wolfram.com

Hi guys, The rule: rule = Dot[s___,(k:(a[i_]))m___, r___]:> k Dot[s,m,r] works fine separating constants (a[i_]) in the distribution of a Dot product: f = O1*a[1] + O2*a[2] g = P1*a[3] h = O2*a[3] In[44]:= Distribute[f.g.h]//.rule 2 2 Out[44]= a[1] a[3] O1 . P1 . O2 + a[2] a[3] O2 . P1 . O2 However, the rule does not work if product of constants ( a[i_]*a[j_] ) are included. For example, taking: g = P1*a[3]*a[1] In[45]:= g = P1*a[3]*a[1] Out[45]= P1 a[1] a[3] In[46]:= Distribute[f.g.h]//.rule 2 Out[46]= a[1] a[3] O1 . P1 . a[3] . O2 + a[1] a[2] a[3] O2 . P1 . a[3] . O2 After playing with this for a while ( a big one ), I was unable to figure out what is going on and how to fix it. Could anybody point out some suggestions? Salut, Rojas E-mail: sergio at scisun.sci.ccny.cuny.edu