Message Boards Message Boards


Manipulating polynomial output

Posted 9 years ago
1 Reply
0 Total Likes

I need to output a multivariate Laurent polynomial in a certain way.

I have a polynomial stored in L in 2 variables x,y. I would need an output something like this:

y x^(-2) + 4 y^(-1) x^3 - 4y^(-1) x^(-2) 

or even better if it would be grouped by the first (or 2nd) variable:

(y - 4y^(-1))  x^(-2) + 4 y^(-1) x^3 

I am manipulating some results and I need to output a large amount of polynomials in a line-by-line fashion.

POSTED BY: Jaka Spaka

Collect might do what you have in mind.

Collect[y/x^2 + (4*x^3)/y - 4/(y*x^2), x]

(* Out[152]= (4*x^3)/y + (-(4/y) + y)/x^2 *)
POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract