# Writing a polynomial quotient with a specific denominator

I have a polynomial quotient 1−z+z4(1−z)21−z+z4(1−z)2\frac{1-z+z^4}{(1-z)^2}
that I want to write in the form g(z)(1−z)(1−z4)(1−z5)(1−z6)(1−z7).g(z)(1−z)(1−z4)(1−z5)(1−z6)(1−z7).\frac{g(z)}{(1 – z) (1 – z^4) (1 – z^5) (1 – z^6) (1 – z^7)}.

However, every time I try some combination of multiplication or division to get it into this form, Mathematica simplifies it back to the original form.
I’ve tried searching for solutions, since I’m sure there must already be loads, but I couldn’t narrow down the searches enough to find anything relevant.

=================

This may not be trivial: it is sometimes tricky to force Mathematica to output an expression in a specific form that is not the one it deems the simplest. Perhaps take a look at this recent discussion that discusses some methods to manipulate expressions to get them closer to a desired form.
– MarcoB
Sep 11 ’15 at 11:45

=================

2 Answers
2

=================

Turns out that a simple method does work (and I found it literally just after posting this question):

f = (1 – z + z^4)/(1 – z)^2
g = f (1 – z) (1 – z^4) (1 – z^5) (1 – z^6) (1 – z^7)
Expand[Simplify[g]]

You might try also this:

f = (1 – z + z^4)/(1 – z)^2;
ff = f*(1 – z) (1 – z^4) (1 – z^5) (1 – z^6) (1 – z^7) // Simplify
fff = ff // Inactive

(* -(1 + z + z^2 + z^3) (1 – z + z^4) (-1 + z^5) (-1 +
z^6) (-1 + z^7)
Inactive[ff] *)

Then

fff/((1 – z) (1 – z^4) (1 – z^5) (1 – z^6) (1 – z^7)) // Activate

yielding

(* -(((1 + z + z^2 + z^3) (1 – z + z^4) (-1 + z^5) (-1 + z^6) (-1 +
z^7))/((1 – z) (1 – z^4) (1 – z^5) (1 – z^6) (1 – z^7))) *)

Have fun!