# Manipulating polynomial output

**URL:** <https://community.wolfram.com/t/manipulating-polynomial-output/3054>\
**Category:** Questions\
**Tags:** mathematica, algebra\
**Created:** [August 22, 2014, 10:34am UTC](https://community.wolfram.com/t/manipulating-polynomial-output/3054 "2014-08-22T10:34:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bostjangabrovsek](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@bostjangabrovsek](https://community.wolfram.com/u/bostjangabrovsek)\
**Post date:** [August 22, 2014, 10:34am UTC](https://community.wolfram.com/t/manipulating-polynomial-output/3054/1 "2014-08-22T10:34:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![danl](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/danl/32/41267_2.png) [@danl](https://community.wolfram.com/u/danl)\
**Post date:** [August 22, 2014, 1:02pm UTC](https://community.wolfram.com/t/manipulating-polynomial-output/3054/2 "2014-08-22T13:02:17Z")

</div>

`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 *)

```
