MathGroup Archive 2006

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

Search the Archive

Re: Converting an expression to a list of terms?


AES schrieb:
> How to convert an expression consisting of a sum of terms in an Output 
> cell:
> 
>    A + B - C + . . . 
> 
> (where A, B, C are themselves product expressions) to a list
> 
>    {A, B, -C, . . . }
> 
> in some easier fashion than doing it by hand using Find and Replace?
> 

Hello,

do you mean

In[1]:=
sumofterms = Expand[(x - y)^3];
In[2]:=
listofterms = List @@ sumofterms
Out[2]=
{x^3, -3*x^2*y, 3*x*y^2, -y^3}

?


  • Prev by Date: Re: Converting an expression to a list of terms?
  • Next by Date: Re: Converting an expression to a list of terms?
  • Previous by thread: Re: Numerical Integration
  • Next by thread: Re: Converting an expression to a list of terms?