MathGroup Archive 2007

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

Search the Archive

Re: Polynomial to List

  • To: mathgroup at
  • Subject: [mg76952] Re: [mg76897] Polynomial to List
  • From: Murray Eisenberg <murray at>
  • Date: Wed, 30 May 2007 05:32:35 -0400 (EDT)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <>
  • Reply-to: murray at

First, let's make the problem a bit more complicated by looking at, say, 
the polynomial:

   p = c + k x - 7 x^2 + x^3 + Pi x^4

Now how does Mathematica parse that?  Use FullForm:


Thus the structure is Plus[...] where the argument of Plus is a sequence 
of the various terms. You want a list consisting of these terms, so a 
way to do it is to change Plus to List.  The Apply function does this:

{c, k*x, -7*x^2, x^3, Pi*x^4}

(There, and below, I show the linear, 1-dimensional InputForm of the 2D 
standard form in which Mathematica would display the output.)

Finally, if you want to save some punctuation, use the @@ input form for 
Apply, like this:

{c, k*x, -7*x^2, x^3, Pi*x^4}

Finally, reverse the order of the terms by using -- what else? -- Reverse:

{Pi*x^4, x^3, -7*x^2, k*x, c}

Nick Hoffman wrote:
> I have a polynomial,
> Lets say:
> 1 + x + x^2 + x^3 + x^4
> and all I need to do is get that into a list of this form
> {x^4, x^3, x^2, x, 1}
> Any help would be greatly appreciated!  Thanks!

Murray Eisenberg                     murray at
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

  • Prev by Date: Re: Re: Stopping Automatic Animation in v6
  • Next by Date: Re: Re: asymptotics
  • Previous by thread: RE: Polynomial to List
  • Next by thread: Re: Polynomial to List