rem - Maple Help

# Online Help

###### All Products    Maple    MapleSim

rem

remainder of polynomials

quo

quotient of polynomials

 Calling Sequence rem(a, b, x) rem(a, b, x, 'q') quo(a, b, x) quo(a, b, x, 'r')

Parameters

 a, b - polynomials in x x - name 'q', 'r' - (optional) unevaluated names

Description

 • The rem function returns the remainder of a divided by b. The quo function returns the quotient of a divided by b. The remainder r and quotient q satisfy: $a=bq+r$  where $\mathrm{degree}\left(r,x\right)<\mathrm{degree}\left(b,x\right)$.
 • If a fourth argument is included in the calling sequence for rem or quo, it will be assigned the quotient q or remainder r, respectively.

Examples

 > $\mathrm{divide}\left({x}^{3}+x+1,{x}^{2}+x+1\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{quo}\left({x}^{3}+x+1,{x}^{2}+x+1,x\right)$
 ${x}{-}{1}$ (2)
 > $\mathrm{r1}≔\mathrm{rem}\left({x}^{3}+x+1,{x}^{2}+x+1,x,'\mathrm{q1}'\right)$
 ${\mathrm{r1}}{:=}{2}{+}{x}$ (3)
 > $\mathrm{q1}$
 ${x}{-}{1}$ (4)
 > $a≔\left({x}^{2}+x+1\right)\mathrm{q1}+\mathrm{r1}$
 ${a}{:=}\left({{x}}^{{2}}{+}{x}{+}{1}\right){}\left({x}{-}{1}\right){+}{2}{+}{x}$ (5)
 > $\mathrm{simplify}\left(a\right)$
 ${{x}}^{{3}}{+}{x}{+}{1}$ (6)
 > $\mathrm{q2}≔\mathrm{quo}\left({x}^{4}-3x+2,{x}^{2}-x-1,x,'\mathrm{r2}'\right)$
 ${\mathrm{q2}}{:=}{{x}}^{{2}}{+}{x}{+}{2}$ (7)
 > $\mathrm{r2}$
 ${4}$ (8)
 > $\mathrm{q2}+\frac{\mathrm{r2}}{{x}^{2}-x-1}$
 ${{x}}^{{2}}{+}{x}{+}{2}{+}\frac{{4}}{{{x}}^{{2}}{-}{x}{-}{1}}$ (9)
 > $\mathrm{simplify}\left(\right)$
 $\frac{{{x}}^{{4}}{-}{3}{}{x}{+}{2}}{{{x}}^{{2}}{-}{x}{-}{1}}$ (10)

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam