# How to prevent fractions in polynomial quotients?

(This was a hard question to give a succinct title to, so feel free to edit it.)

When I divide polynomials, I would like Mathematica to NOT create negative powers of variables. For example:

expr = c*(p^2) + p^4 + c^2 + 2*p + 3*c + 1;
PolynomialQuotientRemainder[expr, c*(p^2) + c, p]
PolynomialQuotientRemainder[expr, c*(p^2) + c, c]


Results:

$\left\{\frac{p^2}{c}-\frac{1}{c}+1,c^2+2 c+2 p+2\right\}$

$\left\{\frac{c}{p^2+1}+\frac{p^2}{p^2+1}+\frac{3}{p^2+1},p^4+2 p+1\right\}$

I don't want fractions with variables in the quotients.

Desired result:

$\left\{1,c^2+2 c+p^4+2 p+1\right\}$

How can I accomplish this?

• In[387]:= PolynomialReduce[c*(p^2) + p^4 + c^2 + 2*p + 3*c + 1, c*(p^2) + c, {c, p}] Out[387]= {{1}, 1 + 2 c + c^2 + 2 p + p^4} – Daniel Lichtblau Jan 13 '16 at 0:39

## 1 Answer

Daniel Lichtblau has supplied the answer in a comment: use PolynomialReduce, rather than PolynomialQuotientRemainder. As such:

PolynomialReduce[expr, c*(p^2) + c, {c, p}]
(* -> {{1}, 1 + 2 c + c^2 + 2 p + p^4} *)


which is the desired result.

• Yeah, Daniel does that a lot. I wish there was an option to "Accept this Comment as the Answer". – Jerry Guern Jan 17 '16 at 20:18
• From what I can tell, Daniel is not big on one-liner answers (he talks to me at times, which really unnerves his spouse). – Daniel Lichtblau Jan 18 '16 at 16:34
• @Daniel lol --- – Mr.Wizard Feb 21 '17 at 7:45