2

The documentation of the polynom package refers in chapter "4.6 Low-level commands" (p. 6) to a command called \polyremainder, which should display only the remainder of a polynomial division. I'm not quite sure how to use it, but even calling the command yields the following error: Undefined control sequence. \polyremainder

I've already tried the following:

\polyadd\polya{x^4}{0}
\polyadd\polyb{x^4+2x^3+2x+1}{0}
\polyremainder

and

\polyadd\polya{x^4}{0}
\polyadd\polyb{x^4+2x^3+2x+1}{0}
\polyremainder\polya\polyb

The local copy of polynom is the most recent version on CTAN (2006/04/20 0.17 (CH,HA)).

Using TeX Live 2015 on Windows 7 SP1 64 bit

2
  • 1
    don't you need to divide, instead of adding to get a remainder? According to the definition of the package, \polyremainder is only set if \polydiv is given first.
    – Runar
    Jun 25, 2016 at 16:42
  • @RunarTrollet Thanks, calling \polydiv first solves the issue. Actually, I've missed that the \polyremainder line in the documentation isn't meant to be on its own. If you write your comment as an answer, I'll gladly accept it. Jun 25, 2016 at 18:30

1 Answer 1

2

To get the remainder you need to do a division first, and in polynom you need to do \polydiv before \polyremainder.

Output

enter image description here

Code

\documentclass[11pt]{article}
\usepackage{polynom}
\begin{document}
 \polyadd\polya { (X^2+X+1)(X-2) }{0}
    \polyadd\polyb { X-1 }{0}


Dividing \polyprint\polya{} by \polyprint\polyb.
\[\polylongdiv\polya\polyb\]

\polydiv\polyc{ (X^2+X+1)(X-2) }{ X-1 }
Remainder is: \polyprint{\polyremainder}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .