Skip to main content

A bug in Wolfram language Sum

Start form fresh kernel:

In[21]:= Quit[]

This is an indefinite Sum (see the documentation of Sum):

In[1]:= Sum[x[i],i]

Out[1]= Underscript[\[Sum], i]x[i]

In[2]:= Sum[Indexed[x,i],i]

Out[2]= Underscript[\[Sum], i]Subscript[x, i]

This evaluates wrongly:

In[3]:= Sum[_,i]

Out[3]= i _

and seems to break Sum:

In[4]:= Sum[y[i],i]

Out[4]= i _

In[5]:= Sum[Indexed[y,i],i]

Out[5]= i _

although all the sums that were previously evaluated are still correct:

In[6]:= Sum[x[i],i]

Out[6]= Underscript[\[Sum], i]x[i]

In[7]:= Sum[Indexed[x,i],i]

Out[7]= Underscript[\[Sum], i]Subscript[x, i]

Conclusions :

- Sum is broken by Sum[_,i],

- the kernel has some cache.

Indeed there is a cache and it can be cleared

In[8]:= ClearSystemCache[]

but this has no effect on Sum:

In[11]:= Sum[x[i],i]

Out[11]= Underscript[\[Sum], i]x[i]

In[12]:= Sum[y[i],i]

Out[12]= i _

Comments