Message Boards Message Boards

0
|
4621 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Function "Distribute" not working as expected

I want to transform the expression x*y*Inactive[Sum][1/n^2,{n,1,Infinity}] to the expression Inactive[Sum][x*y/n^2,{n,1,Infinity}] with the symbolic function Distribute :

Distribute[x*y*Inactive[Sum][1/n^2,{n,1,Infinity}],Inactive[Sum],Times]

But this does not work. I get the answer

Inactive[Sum][x*y/n^2,{x*y*n,x*y,x*y*Infinity}]

What can I do to solve this problem or is this a bug in Mathematica?

POSTED BY: Ralph Trenkler
2 Replies
In[5]:= x*y*Inactive[Sum][1/n^2, {n, 1, Infinity}] /. 
 a_.*Inactive[Sum][b_, c__] :> Inactive[Sum][a*b, c]

Out[5]= Inactive[Sum][(x y)/n^2, {n, 1, \[Infinity]}]
POSTED BY: Frank Kampas

It's distributing across all positions, as it should. If it were inconsistent in this regard, that would be a (serious) bug.

I believe a common approach to this is to use a replacement rule. I am not on a machine with Mathematica at the moment, but something like the following.

x*y*Inactive[Sum][1/n^2,{n,1,Infinity}] /. a_. * Inactive[Sum][b_,c__] :> Inactive[Sum][a*b,c]
POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract