Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have some complex expression like this F[x] = x*x/(1-x^2)*x/(1-x/(1-x)), I want to represent F[x] in the form of f(x)/g(x) in which both f(x), g(x) are normal polynomial expressions. In the above example we have F[x] = (x^3-x^4)/((1-2x)*1-x^2)

And, after that I want to do the polynomial division if the degree of f(x) is bigger that g(x). Is mathematica able to do that?


share|improve this question
@Loi.Luu The answer is "Yes" –  Alexei Boulbitch Aug 26 '13 at 7:30
Thank you guys :) –  Loi.Luu Aug 26 '13 at 7:41
You should take a look at Together[F[x]] and Together[F[x]] // ExpandAll, sometimes Apart[F[x]] might be better for your needs. Define F this way F[x_] := x*x/(1 - x^2)*x/(1 - x/(1 - x)). –  Artes Aug 26 '13 at 9:45
A search for in the Cocumentation Center for 'common denominator' (no quotes) turns up Togetehr as the second hit. Searching for 'polynomial division' likewise shows relevant hits at the top. This really is a case of simple documentation checking. –  Daniel Lichtblau Aug 26 '13 at 18:29
add comment

closed as off-topic by Artes, Yves Klett, halirutan, Sjoerd C. de Vries, m_goldberg Aug 27 '13 at 21:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Artes, Yves Klett, halirutan, Sjoerd C. de Vries, m_goldberg
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 2 down vote accepted
p = x*x/(1 - x^2)*x/(1 - x/(1 - x));
p = Simplify[p]

Mathematica graphics

num = Numerator[p];
PolynomialQ[num, x]

Mathematica graphics

den = Denominator[p];
PolynomialQ[den, x]

Mathematica graphics

If[Exponent[num, x] >= Exponent[den, x],
 PolynomialQuotient[num, den, x]

Mathematica graphics

PolynomialRemainder[num, den, x]

Mathematica graphics

share|improve this answer
Awesome, thank you @Nasser –  Loi.Luu Aug 26 '13 at 7:40
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.