Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Polynomial to List

  • To: mathgroup at
  • Subject: [mg76916] Re: Polynomial to List
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at>
  • Date: Wed, 30 May 2007 05:13:53 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <f3grip$49r$>

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!

The head of the expression poly is Plus. We replace it by List thanks to 
the Apply function (short cut @@), then sort the resulting list to get 
the desired form.

poly = 1 + x + x^2 + x^3 + x^4;
Reverse[List @@ poly]


{x^4, x^3, x^2, x, 1}


  • Prev by Date: Re: Re: Ellipse equation simplification on Mathematica:
  • Next by Date: Re: I want some help about ContourPlot function
  • Previous by thread: Re: Polynomial to List
  • Next by thread: Re: Polynomial to List