Message Boards Message Boards

0
|
1579 Views
|
5 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Displaying order of certain polynomials?

Posted 1 year ago

Normally, terms are ordered from least to greatest, so x+1 is displayed as 1+x, xx+1+2x+3xx is displayed 2x+3xx+xx+1, and so on. However, x2x+xx+1 is displayed as x2x+x1+x instead of the expected x1+x+x2x. Also, Format[x^x+x^10,TraditionalForm] gives x10+xx instead of the expected xx+x10. Is this intended behavior?

POSTED BY: Theta Rho
5 Replies

Do you mean this?

MonomialList[x^x + x^10, "NegativeLexicographic"]
(* {x^x, x^10} *)
POSTED BY: Rohit Namjoshi
Posted 1 year ago

Indeed, thank you. This appears to fail with x^(x+1)+x^x however.

POSTED BY: Theta Rho

Not sure what your goal is or what problem you are trying to solve. Maybe all you need is

List @@ (x^x + x^10) // ReverseSort

List @@ (x^(x + 1) + x^x) // ReverseSort
POSTED BY: Rohit Namjoshi
TraditionalForm[x^x + x^10, ParameterVariables :> x]
(* x^x+x^10 *)

Take a look at the Polynomial Orderings section in the Algebraic Manipulation tech note.

POSTED BY: Rohit Namjoshi
Posted 1 year ago

Now, how would you find the parts of that?

POSTED BY: Theta Rho
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract