MathGroup Archive 1991

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

Search the Archive

Problem with Collect

  • To: mathgroup at
  • Subject: Problem with Collect
  • From: Markus Lautenbacher <Markus.Lautenbacher at>
  • Date: Fri, 1 Feb 91 23:27:04 -0600

Colin Williams <cwilliam at> noticed an unexpected
behavior of Collect[].  I have no explanation for this.  Instead I
want to bring another point to your attention which I found when
experimenting with Collect:

(* the original example *)

In[1]:= t = 2^(n-3) + x

         -3 + n
Out[1]= 2       + x

(* something that should be equivalent to the original example *)

In[2]:= texp = t // ExpandAll

Out[2]= -- + x

In[3]:= t - texp // Simplify

Out[3]= 0

In[4]:= Collect[t,x]

Out[4]= 2  + x

In[5]:= Collect[texp,x]

Out[5]= -- + x

So a temporary cure to the problem seems to be to use
"Collect[ExpandAll[expr],x]" instead of "Collect[expr,x]".

Anyway it is not that unreasonable to expand everything (to "bring the x's
out") before passing it to Collect, although I expected Collect to do 
the expansion automatically. 


  • Prev by Date: bug in raising a Series to a power
  • Next by Date: Solve
  • Previous by thread: bug in raising a Series to a power
  • Next by thread: Solve