# Expand without variable in denominator

Given:

originalFormat = 2/3*y + 3/4*y^2 + 1/2*y^3/(1 - y);
simplified = Simplify[originalFormat];


I would like a function that, given "simplified", will return back originalFormat. Functions that get part of the way there are also appreciated. For example, Expand returns:

 -((2 y)/(3 (-1+y)))-y^2/(12 (-1+y))+y^3/(4 (-1+y))


, which, if the factor (-1 + y) was multiplied out, would give the answer, except for the last term. I do not know a function to pair with Expand to multiply out the common denominator.

• given "simplified", will return back originalFormat if I understand you right (and I am not sure I do now), but if so, this is not possible. There are infinite expressions that could give the same simplified result. For example, if I give you x, how would you know the original expression? it could be x^2/x or x^3/x^2 or any number of infinite possibilities. Commented Oct 10, 2019 at 20:50
• Maybe look into Apart? Commented Oct 10, 2019 at 20:51
• Apart[simplified] gives -(1/2)-1/(2 (-1+y))+y/6+y^2/4. Commented Oct 10, 2019 at 20:52
• @Nasser, it's true that it's not one-to-one, but I still think there's an algorithm to consistently get the format I want. Commented Oct 10, 2019 at 20:55
• @ThatGravityGuy, Apart is close too though. With the assumption that 0<y<1, I think Apart would give the correct answer if it only split it into positive components. Commented Oct 10, 2019 at 21:13

The question is not very clearly formulated. Therefore I present a solution that works specifically for the given case.

Notice that what you are asking is essentially a polynomial division with a small difference that highest, not lowest power of y should go into the reminder. This can be realized by inverting the variable, i.e. y->1/z.

The procedure goes on

• by extraction the numerator and the denominator,

• making the substitution,

• polynomial division,

• back-substitution,

• and, finally, computation of the reminder.

n = (Numerator[simplified] /. y -> 1/z) z^3 // Simplify
Out[1]= 3 - z - 8 z^2

d = (Denominator[simplified] /. y -> 1/z) z // Simplify
Out[2]= -12 (-1 + z)

p = PolynomialQuotient[n, d, z]/z^2 /. {z -> 1/y} // Expand
Out[3]= (2 y)/3 + (3 y^2)/4

q = Simplify[simplified - p]
Out[4]= y^3/(2 - 2 y)

p + q
Out[5]= (2 y)/3 + (3 y^2)/4 + y^3/(2 - 2 y)

• There was definite confusion on my part, but your solution does give me better tools to work with Commented Oct 11, 2019 at 16:02