Quotient - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Algebraic

  

Quotient

  

quotient of polynomials with algebraic number coefficients

  

Remainder

  

remainder of polynomials with algebraic number coefficients

 

Calling Sequence

Parameters

Options

Description

Examples

Calling Sequence

Quotient(a, b, x, options)

Quotient(a, b, x, `r`, options)

Remainder(a, b, x, options)

Remainder(a, b, x, `q`, options)

Parameters

a, b

-

polynomials in x with algebraic number coefficients

x

-

name

q, r

-

(optional) unevaluated names

options

-

(optional) equation(s) of the form keyword = value, where keyword is either 'makeindependent', 'symbolic', or 'characteristic'

Options

• 

If the option 'symbolic'=true is given and a RootOf whose minimal polynomial factors nontrivially is detected, then it will be reduced to a RootOf of lower degree by picking one of the factors arbitrarily. This will eliminate the possibility of a "reducible RootOf detected" error. The default is 'symbolic'=false.

• 

If the option 'characteristic'=p is given, where p is a non-negative integer, the division is performed over an extension of the ring p of integers modulo p. The default is 'characteristic'=0 and means that the division is computed over an extension of the rational numbers.

• 

Note that if p is positive but not a prime, then p is not a field, so Quotient and Remainder may not be able to perform the division. If they do not succeed because they encounter an integer that has no inverse modulo p, they issue the error "zero divisor modulo p detected"

• 

If the option 'makeindependent'=true is given, then QuotientRemainder will always try to find a field representation for algebraic numbers in the input, regardless of how many algebraic objects the input contains. If the input contains many RootOfs, then this can be a very expensive calculation. If 'makeindependent'=false is given, then no independence checking is performed. The default is 'makeindependent'=FAIL, in which case algebraic dependencies will only be checked for if there are 4 or fewer algebraic objects in the input.

Description

• 

The Quotient and Remainder commands compute the quotient and remainder when a is divided by b. The quotient q and remainder r are polynomials in x and satisfy the relationships a=qb+r and degreer&comma;x<degreeb&comma;x.

• 

The Quotient command will return the quotient q, and if the optional parameter `r` is included, it will be assigned the value of r.

• 

The Remainder command will return the remainder r, and if the optional  parameter `q` is included, it will be assigned the value of q.

• 

The inputs a and b may contain algebraic number coefficients. These may be represented by radicals or with the RootOf notation (see type/algnum, type/radnum). In general, algebraic numbers will be returned in the same representation as they were received in. Nested radicals and RootOfs are also supported.

• 

The property a=qb+r will hold in the domain K[x], where K is an algebraic field generated over the rationals and any algebraic number coefficients occurring in a and b (unless the option 'characteristic' is given; see below).

• 

Note that these functions do not compute quotients or remainders over the integers, as by default, all division is computed over the field of rationals. For integer division, use iquo and irem.

• 

The arguments a and b must be univariate polynomials in the variable x, which is typically a name. If other names or non-algebraic sub-expressions are included and they cannot be evaluated to algebraic numbers, an "unable to divide multivariate polynomials" error will be returned.

• 

x can also be a function such as sinx, in which case it will be frozen and replaced by a new local variable. However, functions that are also of type AlgebraicObject such as sinπ3 will be converted to algebraic numbers before proceeding, so they cannot be treated as variables. Proceed with caution when using a function for x, as treating some functions as variables may produce mathematically unsound results.

• 

The inputs a and b can be polynomials disguised as rational functions, in which case they are normalized first using Algebraic[Normal].

• 

The quotient and remainder will be normalized as follows:

– 

All non-constant factors are monic.

– 

There are at most two constant factors, and at most one of them is not a rational number.

– 

All factors that are not rational numbers have integer content equal to 1, except possibly if there is only one non-constant factor.

– 

All algebraic numbers occurring in the result are reduced modulo their minimal polynomial (see Reduce), and all arguments of functions, if any, are normalized recursively (see Normal).

• 

If the set of radicals and RootOfs in the input cannot be embedded into a field algebraically, then Quotient and Remainder may not be able to perform the division. Quotient and Remainder will try to find a field representation if there are at most 4 algebraic objects in the input (unless option 'makeindependent' is given; see below), and otherwise attempt to proceed anyway. If unsuccessful, a "reducible RootOf detected" error will be returned. (unless the option 'symbolic'=true is given; see below).

• 

These functions do not support input containing floats or radical functions such as x.

Examples

withAlgebraic&colon;

Introductory examples:

Quotientx2+3&comma;x+I&comma;x

xI

(1)

Remainderx2+3&comma;x+I&comma;x

2

(2)

Quotienty3&comma;y2+sqrt2y+1&comma;y&comma;r1&comma;r1

y2&comma;y+2

(3)

root1RootOf_Z23_Z+1

root1RootOf_Z23_Z+1

(4)

Remainderx4+root1x2+x+root12&comma;x2+root1&comma;x

x+3RootOf_Z23_Z+11

(5)

When a name is passed as the fourth argument to Quotient or Remainder, it will be assigned the value of the remainder or quotient, respectively.

Quotientx2+x+1&comma;x2&comma;x&comma;r2&comma;r2

x+3&comma;7

(6)

Remainderx2+x+1&comma;x2&comma;x&comma;q2&comma;q2

7&comma;x+3

(7)

evalbevalr2&comma;Quotientx2+x+1&comma;x2&comma;x&comma;r2=evalq2&comma;Remainderx2+x+1&comma;x2&comma;x&comma;q2

true

(8)

The input may contain both radicals and RootOfs, and Quotient and Remainder will embed the coefficients into an algebraic field, if possible:

Quotientx2+sqrt2x+RootOf_Z23&comma;index=1x+2sqrt6&comma;x+sqrt2&comma;x&comma;r3&comma;r3

x+3&comma;32

(9)

Quotientx2+sqrt2x+RootOf_Z23x+RootOf_Z26&comma;x+sqrt2&comma;x&comma;r4&comma;r4

x+RootOf_Z23&comma;2RootOf_Z23+RootOf_Z26

(10)

Nested and mixed radicals are handled as well:

Quotientx2413+1&comma;x+RootOf_Z32&comma;index=1&comma;x&comma;r5&comma;r5

x213&comma;1

(11)

QuotientxsqrtRootOf_Z23&comma;index=1+1&comma;RootOf_Z2RootOf_Z23&comma;index=1&comma;index=1&comma;x&comma;r6&comma;r6

x+3343&comma;0

(12)

The input must contain univariate polynomials only.  Multiple variables are not supported and an error will be returned:

Quotientx2+xy+y2+1&comma;x+y&comma;x

Error, (in Algebraic:-Quotient) unable to divide multivariate polynomials

This function does not compute quotients and remainders over the integers.  Use iquo and irem for that functionality:

Quotient17&comma;5&comma;x&comma;Remainder17&comma;5&comma;x

175&comma;0

(13)

iquo17&comma;5&comma;irem17&comma;5

3&comma;2

(14)

A polynomial will always be exactly divisible by any invertible, non-zero constant, so the remainder in such a case will always be zero:

Quotientx2+3x+4&comma;RootOf_Z22&comma;x

RootOf_Z22x22+3RootOf_Z22x2+2RootOf_Z22

(15)

Remainderx2+3x+4&comma;RootOf_Z22&comma;x

0

(16)

Quotientx2+3x+4&comma;0&comma;x

Error, (in Algebraic:-Quotient) numeric exception: division by zero

Remainderx2+3x+4&comma;0&comma;x

Error, (in Algebraic:-Remainder) numeric exception: division by zero

The input can also be treated as a pair of polynomials in a non-algebraic sub-expression such as sinx, as it will be frozen and temporarily replaced by a new local variable:

Quotientsinx2+3sinx+7&comma;sinx+1&comma;sinx&comma;r7&comma;r7

sinx+2&comma;5

(17)

Other non-algebraic sub-expressions can only be included if they can be converted to algebraic numbers:

Quotientx2+sinπ4&comma;x+expIπ&comma;x&comma;r8&comma;r8

12&comma;22+12

(18)

Remainderx+siny&comma;x+4&comma;x

Error, (in Algebraic:-Remainder) unable to divide multivariate polynomials

Rational functions are generally not accepted, but polynomials disguised as rational functions are allowed, because they will be simplified by Normal:

Quotient1x&comma;1x2&comma;x

Error, (in Algebraic:-Quotient) polynom(s) with radalgnum coefficients expected

Quotientx3+IxI&comma;x+I&comma;x&comma;r9&comma;r9

x&comma;−1

(19)

The output will always be fully reduced and normalized (see Reduce, Normal):

QuotientxRootOf_Z3_Z+35+1sqrt2&comma;sqrt2RootOf_Z3_Z+32x&comma;x&comma;r10&comma;r10

2RootOf_Z3_Z+32322&comma;22

(20)

Non-algebraic sub-expressions in the input may become algebraic after being recursively normalized:

Remainderx+sinπysqrt24yRootOf_Z22&comma;index=1&comma;x&comma;x

22

(21)

Floats are not accepted.

Quotientx2x+0.25&comma;x12&comma;x

Error, (in Algebraic:-Quotient) polynom(s) with radalgnum coefficients expected

Algebraic functions such as x are not accepted:

Quotientx2+2xsqrtx&comma;x+sqrtx&comma;x

Error, (in Algebraic:-Quotient) polynom(s) with radalgnum coefficients expected

When non-indexed RootOfs are given in the input, often the quotient and remainder can still be determined and expressed in terms of them:

Quotientx3RootOf_Z21+RootOf_Z23&comma;xRootOf_Z21&comma;x&comma;r11&comma;r11

RootOf_Z21x+x2+1&comma;RootOf_Z23

(22)

Quotientx+sqrt2&comma;x+RootOf_Z22&comma;x&comma;r12&comma;r12

1&comma;RootOf_Z22+2

(23)

However, in the following case, Quotient and Remainder are unable to compute the quotient and remainder because they must know whether RootOf_Z22 represents 2 or 2 when no index is given. In such a case, they will return a "reducible RootOf detected" error:

Quotient2sqrt2x&comma;RootOf_Z22&comma;index=1x+sqrt2x+1&comma;x&comma;r12&comma;r12

1&comma;−1

(24)

Quotient2sqrt2x&comma;RootOf_Z22&comma;index=2x+sqrt2x+1&comma;x&comma;r13&comma;r13

22x&comma;0

(25)

Quotient2sqrt2x&comma;RootOf_Z22x+sqrt2x+1&comma;x

Error, (in Algebraic:-Quotient) reducible RootOf detected. Substitutions are {RootOf(_Z^2-2) = -RootOf(_Z^2-2,index = 1), RootOf(_Z^2-2) = RootOf(_Z^2-2,index = 1)}

By using option 'symbolic' = true, Quotient and Remainder can be instructed to automatically select one of the possible substitutions and complete the computation.  Here, they pick RootOf_Z22=2:

Quotient2sqrt2x&comma;RootOf_Z22x+sqrt2x+1&comma;x&comma;r14&comma;symbolic=true&comma;r14

1&comma;−1

(26)

An error will also be returned if the second argument contains a zero divisor.  Again, option 'symbolic' = true will force Quotient and Remainder to select one of the possibilities:

Quotientx2&comma;sqrt2RootOf_Z22&comma;x

Error, (in Algebraic:-Quotient) reducible RootOf detected. Substitutions are {RootOf(_Z^2-2) = -RootOf(_Z^2-2,index = 1), RootOf(_Z^2-2) = RootOf(_Z^2-2,index = 1)}

Quotientx2&comma;sqrt2RootOf_Z22&comma;x&comma;symbolic=true

2x24

(27)

Using option 'characteristic', quotients and remainders can be computed over finite fields:

Quotientx2x1&comma;x+4&comma;x&comma;r15&comma;r15

x5&comma;19

(28)

Quotientx2x1&comma;x+4&comma;x&comma;r16&comma;characteristic=5&comma;r16

x&comma;4

(29)

Quotientx2&comma;xIsqrt2&comma;x&comma;r17&comma;characteristic=7&comma;r17

I2+x&comma;5

(30)

In composite characteristic, quotients and remainders cannot always be computed. Quotient and Remainder will return errors if they encounter a zero divisor:

Quotient2x2+8x&comma;2x+6&comma;x&comma;r18&comma;characteristic=9&comma;r18

x+1&comma;3

(31)

Quotient2x2+8x&comma;2x+6&comma;x&comma;characteristic=10

Error, (in Algebraic:-Quotient) zero divisor modulo 10 detected

With option 'makeindependent'=true, the input will be checked for algebraic dependencies even if there are more than 4 algebraic objects in the input:

CubeRootOf4RootOf_Z3+4&comma;index=1

CubeRootOf−4RootOf_Z3+4&comma;index=1

(32)

CubeRootOf2RootOf_Z3+2&comma;index=1

CubeRootOf−2RootOf_Z3+2&comma;index=1

(33)

CubeRootOf2RootOf_Z32&comma;index=1

CubeRootOf2RootOf_Z32&comma;index=1

(34)

CubeRootOf3RootOf_Z33&comma;index=1

CubeRootOf3RootOf_Z33&comma;index=1

(35)

CubeRootOf4RootOf_Z34&comma;index=1

CubeRootOf4RootOf_Z34&comma;index=1

(36)

CubeRootOf6RootOf_Z36&comma;index=1

CubeRootOf6RootOf_Z36&comma;index=1

(37)

Quotientx+CubeRootOf4CubeRootOf2CubeRootOf3&comma;x+CubeRootOf4CubeRootOf6&comma;x&comma;r19&comma;r19

1&comma;RootOf_Z3+2&comma;index=1RootOf_Z33&comma;index=1RootOf_Z34&comma;index=1RootOf_Z3+4&comma;index=1RootOf_Z36&comma;index=1

(38)

Quotientx+CubeRootOf4CubeRootOf2CubeRootOf3&comma;x+CubeRootOf4CubeRootOf6&comma;x&comma;r20&comma;makeindependent=true&comma;r20

1&comma;0

(39)

With option 'makeindependent'=false, the input will never be checked for algebraic dependencies:

Quotientx+CubeRootOf2CubeRootOf3&comma;x+CubeRootOf6&comma;x&comma;r21&comma;r21

1&comma;0

(40)

Quotientx+CubeRootOf2CubeRootOf3&comma;x+CubeRootOf6&comma;x&comma;makeindependent=false&comma;r22&comma;r22

1&comma;RootOf_Z32&comma;index=1RootOf_Z33&comma;index=1RootOf_Z36&comma;index=1

(41)

See Also

Algebraic

Algebraic[Divide]

Algebraic[PseudoDivision]

Quo

Rem