Reduce - Maple Help

Algebraic

 Reduce
 reduce powers of algebraic numbers and algebraic functions

 Calling Sequence Reduce(p, options)

Parameters

 p - any Maple object; typically an expression containing algebraic numbers. options - (optional) equation(s) of the form keyword = value, where keyword is one of 'symbolic', 'expanded', 'characteristic', 'makeindependent', or 'recursive'.

Options

 • If the option 'symbolic'=true is given, and a RootOf whose minimal polynomial factors nontrivially is detected, it will be reduced it to a RootOf of lower degree by picking one of the factors arbitrarily. The default is 'symbolic'=false.
 • If the option 'expanded'=true is given, the result will be a quotient of two expanded polynomials, with the following properties:
 – The variables will be sorted according to a block-lexicographic ordering, where all global variables are considered larger than all local variables.
 – If there is a denominator, it is non-constant.
 The default is 'expanded'=false.
 • If the option 'characteristic'=p is given, where p is a nonnegative integer, the reduced form is computed over an extension of the ring${\mathrm{ℤ}}_{p}$ of integers modulo p. The default is characteristic=0 and means that the reduced form is computed over an extension of the rational numbers.
 • Note that if p is positive but not a prime, then ${\mathrm{ℤ}}_{p}$ is not a field. Reduce will attempt to compute a reduced form anyway. If it does not succeed because it encounters an integer that has no inverse modulo p, it issues the error "zero divisor modulo p detected".
 • If the option 'makeindependent'=true is given, then Reduce 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.
 • If the option 'recursive'=false is given, then Reduce will not map itself recursively over non-algebraic subexpressions. The default is 'recursive'=true.

Description

 • The Reduce command will take powers of algebraic numbers in an expression and reduce the powers to the lowest possible non-negative power, modulo their defining polynomials.
 • Algebraic numbers may be represented by radicals or with the RootOf notation.  In general, they will be returned in the same representation as they were received. (see type,algnum, type,radnum).
 • The result will have the form P/Q, where P and Q are polynomials over the extension field.
 • Powers of radicals will be reduced to the form ${a}^{r}$, where $0 is a rational number.
 • The powers of the RootOfs appearing in the coefficients are positive and lower than the degree of the defining polynomials.  Formally, every integer exponent in a power of the form ${\mathrm{RootOf}\left(f,\mathrm{...}\right)}^{n}$ satisfies $0 .
 • By default, this function attempts to preserve partial factorization of polynomials, but algebraic numbers and functions are always expanded.  If the option 'expanded'=true is specified, then polynomials are also expanded (see below).
 • This function does not rationalize algebraic numbers and does not rationalize leading coefficients of rational functions and polynomials. However, this function will perform a limited amount of simplification on the result by freezing algebraic numbers and canceling the greatest common divisor of the numerator and denominator of the result. For complete normalization of the output, use Normal instead.
 • Non-algebraic subexpressions such as $\mathrm{sin}\left(x\right)$ that are neither variables, rational numbers, or algebraic objects will first be mapped over recursively (unless the option 'recursive'=false is given; see below). Then they are frozen and temporarily replaced by new local variables, which are not considered to be constant in what follows.
 • If the set of radicals and RootOfs appearing in the input are independent (and thus define a field) then Reduce will return 0 if and only if the input is mathematically equal to 0. It may not do so if the RootOfs are dependent or if the polynomial defining a RootOf is reducible.
 • If p is an array, a table, a set, a list, a range, a Matrix, a relation, or a series, then Reduce is mapped over the object.
 • This function does not support input containing floats or algebraic functions such as $\sqrt{x}$.

Examples

 > $\mathrm{with}\left(\mathrm{Algebraic}\right):$

Introductory examples:

 > $\mathrm{Reduce}\left({\left(\mathrm{sqrt}\left(2\right)+\mathrm{sqrt}\left(3\right)\right)}^{3}\right)$
 ${11}{}\sqrt{{2}}{+}{9}{}\sqrt{{3}}$ (1)
 > $\mathrm{R1}≔\mathrm{RootOf}\left({\mathrm{_Z}}^{3}-\mathrm{_Z}-1\right)$
 ${\mathrm{R1}}{≔}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{\mathrm{_Z}}{-}{1}\right)$ (2)
 > $\mathrm{Reduce}\left({\mathrm{R1}}^{3}\right)$
 ${\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{\mathrm{_Z}}{-}{1}\right){+}{1}$ (3)
 > $\mathrm{R3}≔\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-4\right)$
 ${\mathrm{R3}}{≔}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{4}\right)$ (4)
 > $\mathrm{Reduce}\left({\mathrm{R3}}^{3}-8\right)$
 ${4}{}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{4}\right){-}{8}$ (5)
 > $\mathrm{Reduce}\left({\mathrm{RootOf}\left({x}^{5}-{x}^{4}+{x}^{3}-{x}^{2}+x-1\right)}^{6}\right)$
 ${1}$ (6)
 > $p≔\frac{1}{x-\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-2\right)}+\frac{1}{x+\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-2\right)}$
 ${p}{≔}\frac{{1}}{{x}{-}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}\right)}{+}\frac{{1}}{{x}{+}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}\right)}$ (7)
 > $\mathrm{Reduce}\left(p\right)$
 ${-}\frac{{2}{}{x}}{\left({-}{x}{+}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}\right)\right){}\left({x}{+}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}\right)\right)}$ (8)
 > $\mathrm{Reduce}\left(p,'\mathrm{expanded}'\right)$
 $\frac{{2}{}{x}}{{{x}}^{{2}}{-}{2}}$ (9)

Nested and mixed radicals / RootOfs are handled as well:

 > $\mathrm{Reduce}\left({\left(\mathrm{sqrt}\left(2\right)+\mathrm{RootOf}\left({x}^{2}-3\right)\right)}^{3}\right)$
 ${9}{}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{3}\right){+}{11}{}\sqrt{{2}}$ (10)
 > $p≔\left[{\mathrm{RootOf}\left({x}^{2}-x-1\right)}^{5}+2{\mathrm{RootOf}\left({x}^{2}-x-1\right)}^{3},\frac{1}{\mathrm{RootOf}\left({x}^{2}-2,1\right)\mathrm{sqrt}\left(2\right)}\right]$
 ${p}{≔}\left[{{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{\mathrm{_Z}}{-}{1}\right)}^{{5}}{+}{2}{}{{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{\mathrm{_Z}}{-}{1}\right)}^{{3}}{,}\frac{\sqrt{{2}}}{{2}{}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}{,}{1}\right)}\right]$ (11)
 > $\mathrm{Reduce}\left(p\right)$
 $\left[{9}{}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{\mathrm{_Z}}{-}{1}\right){+}{5}{,}\frac{{1}}{{2}}\right]$ (12)
 > $\mathrm{Reduce}\left({\left(1+\mathrm{sqrt}\left(2\right)\right)}^{\frac{5}{4}}\right)$
 ${\left({1}{+}\sqrt{{2}}\right)}^{{1}}{{4}}}{+}{\left({1}{+}\sqrt{{2}}\right)}^{{1}}{{4}}}{}\sqrt{{2}}$ (13)
 > $\mathrm{Reduce}\left(\mathrm{RootOf}\left({x}^{2}-2,\mathrm{index}=1\right)-\mathrm{sqrt}\left(2\right)\right)$
 ${0}$ (14)
 > $\mathrm{Reduce}\left({\mathrm{RootOf}\left({x}^{2}-x+\mathrm{RootOf}\left({x}^{2}-2\right)\right)}^{2}\right)$
 ${\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{\mathrm{_Z}}{+}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}\right)\right){-}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}\right)$ (15)
 > $\mathrm{Reduce}\left({\mathrm{RootOf}\left({x}^{2}-x+\mathrm{sqrt}\left(2\right)\right)}^{2}\right)$
 ${\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{\mathrm{_Z}}{+}\sqrt{{2}}\right){-}\sqrt{{2}}$ (16)

Algebraic functions in the coefficients are not accepted:

 > $\mathrm{Reduce}\left(\mathrm{sqrt}\left(y\right)\mathrm{RootOf}\left({x}^{2}-y,x,\mathrm{index}=1\right)\right)$

Floats are not accepted:

 > $\mathrm{Reduce}\left({\mathrm{RootOf}\left({x}^{2}-x-0.5\right)}^{2}\right)$

Leading coefficients and denominators are not rationalized:

 > $\mathrm{Reduce}\left(\frac{\mathrm{sqrt}\left(2\right)x+\mathrm{sqrt}\left(3\right)y}{1+\mathrm{sqrt}\left(5\right)}\right)$
 $\frac{\sqrt{{2}}{}{x}{+}\sqrt{{3}}{}{y}}{\sqrt{{5}}{+}{1}}$ (17)

An attempt is made to simplify the expression by freezing algebraic numbers and canceling the greatest common divisor of the numerator and denominator of the result. To fully simplify the output, use Normal instead:

 > $\mathrm{Reduce}\left(\frac{{x}^{2}-{\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-2\right)}^{2}}{x+\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-2\right)}\right)$
 ${x}{-}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}\right)$ (18)
 > $\mathrm{Reduce}\left(\frac{{x}^{2}-{\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-4\right)}^{2}}{x+2}\right)$
 ${x}{-}{2}$ (19)
 > $\mathrm{Reduce}\left(\frac{{x}^{2}-2}{x+\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-2\right)}\right)$
 $\frac{{{x}}^{{2}}{-}{2}}{{x}{+}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}\right)}$ (20)
 > $\mathrm{Normal}\left(\frac{{x}^{2}-2}{x+\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-2\right)}\right)$
 ${x}{-}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}\right)$ (21)

Non-algebraic subexpressions are first handled recursively (unless option 'recursive'=false is present) and then temporarily replaced by new variables:

 > $q≔\mathrm{RootOf}\left({x}^{2}-2\right)$
 ${q}{≔}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}\right)$ (22)
 > $\mathrm{Reduce}\left(\mathrm{foo}\left({q}^{2}\right)+{q}^{2}\right)$
 ${\mathrm{foo}}{}\left({2}\right){+}{2}$ (23)
 > $\mathrm{Reduce}\left(\mathrm{foo}\left({\mathrm{RootOf}\left({x}^{2}-2\right)}^{2}\right)+{\mathrm{RootOf}\left({x}^{2}-2\right)}^{2},'\mathrm{recursive}'=\mathrm{false}\right)$
 ${\mathrm{foo}}{}\left({{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}\right)}^{{2}}\right){+}{2}$ (24)

Non-algebraic subexpressions may evaluate to something algebraic after recursive treatment:

 > $\mathrm{Reduce}\left(x+\mathrm{cos}\left(I+\mathrm{RootOf}\left({\mathrm{_Z}}^{2}+1,\mathrm{index}=2\right)\right)\right)$
 ${x}{+}{1}$ (25)

Partial factorizations in the inputs are preserved, unless option 'expanded'=true is given:

 > $\mathrm{Reduce}\left(\left(1+{\mathrm{RootOf}\left({x}^{2}-2\right)}^{2}a\right)\left(1+{\mathrm{RootOf}\left({x}^{2}-3\right)}^{2}b\right)\right)$
 $\left({2}{}{a}{+}{1}\right){}\left({3}{}{b}{+}{1}\right)$ (26)
 > $\mathrm{Reduce}\left(\mathrm{expand}\left(\left(1+{\mathrm{RootOf}\left({x}^{2}-2\right)}^{2}a\right)\left(1+{\mathrm{RootOf}\left({x}^{2}-3\right)}^{2}b\right)\right)\right)$
 ${6}{}{a}{}{b}{+}{2}{}{a}{+}{3}{}{b}{+}{1}$ (27)
 > $\mathrm{Reduce}\left(\left(1+{\mathrm{RootOf}\left({x}^{2}-2\right)}^{2}a\right)\left(1+{\mathrm{RootOf}\left({x}^{2}-3\right)}^{2}b\right),'\mathrm{expanded}'=\mathrm{true}\right)$
 ${6}{}{a}{}{b}{+}{2}{}{a}{+}{3}{}{b}{+}{1}$ (28)

If there is a zero divisor in the denominator, it will be reduced, if possible:

 > $\mathrm{Reduce}\left(\frac{1}{{\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-2\mathrm{_Z}\right)}^{5}}\right)$
 $\frac{{1}}{{16}{}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{2}{}{\mathrm{_Z}}\right)}$ (29)

In this example, there is a RootOf whose leading coefficient is not invertible, so it is not possible to reduce a positive power of of it.  This is because there is no way for Reduce to know whether $\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-\mathrm{_Z}\right)$ without an index represents $0$ or $1$:

 > $\mathrm{Reduce}\left({\mathrm{RootOf}\left(\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-\mathrm{_Z}\right){x}^{2}-1\right)}^{2}\right)$
 ${{\mathrm{RootOf}}{}\left({\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{-}{\mathrm{_Z}}\right){}{{\mathrm{_Z}}}^{{2}}{-}{1}\right)}^{{2}}$ (30)
 > $\mathrm{Reduce}\left({\mathrm{RootOf}\left(\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-\mathrm{_Z},\mathrm{index}=2\right){x}^{2}-1\right)}^{2}\right)$
 ${1}$ (31)

However, if option 'symbolic'=true, then it chooses one possibility.  Here, option 'symbolic'=true picks $1$, so the leading coefficient of the outer RootOf no longer contains a zero divisor, and its power can be reduced:

 > $\mathrm{Reduce}\left({\mathrm{RootOf}\left(\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-\mathrm{_Z}\right){x}^{2}-1\right)}^{2},'\mathrm{symbolic}'=\mathrm{true}\right)$
 ${1}$ (32)

Using option characteristic, powers can be reduced over finite fields:

 > $\mathrm{Reduce}\left({\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-5\right)}^{3},'\mathrm{characteristic}'='3'\right)$
 ${2}{}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{+}{1}\right)$ (33)
 > $\mathrm{Reduce}\left({\left(\mathrm{sqrt}\left(5\right)\right)}^{3},'\mathrm{characteristic}'='3'\right)$
 ${2}{}\sqrt{{5}}$ (34)

The polynomial defining a RootOf will also be reduced modulo the characteristic:

 > $\mathrm{Reduce}\left(\mathrm{RootOf}\left({\mathrm{_Z}}^{2}-3\right),'\mathrm{characteristic}'=7\right)$
 ${\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{+}{4}\right)$ (35)

Reductions can sometimes, but not always, be computed in composite characteristic:

 > $\mathrm{Reduce}\left({\mathrm{RootOf}\left(I{x}^{2}-3\right)}^{2},'\mathrm{characteristic}'='4'\right)$
 ${I}$ (36)
 > $\mathrm{Reduce}\left({\mathrm{RootOf}\left(I{x}^{2}-3\right)}^{2},'\mathrm{characteristic}'='6'\right)$

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

 > $\mathrm{CubeRootOf}\left[-4\right]≔\mathrm{RootOf}\left({\mathrm{_Z}}^{3}+4,\mathrm{index}=1\right)$
 ${{\mathrm{CubeRootOf}}}_{{-4}}{≔}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{+}{4}{,}{\mathrm{index}}{=}{1}\right)$ (37)
 > $\mathrm{CubeRootOf}\left[-2\right]≔\mathrm{RootOf}\left({\mathrm{_Z}}^{3}+2,\mathrm{index}=1\right)$
 ${{\mathrm{CubeRootOf}}}_{{-2}}{≔}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{+}{2}{,}{\mathrm{index}}{=}{1}\right)$ (38)
 > $\mathrm{CubeRootOf}\left[2\right]≔\mathrm{RootOf}\left({\mathrm{_Z}}^{3}-2,\mathrm{index}=1\right)$
 ${{\mathrm{CubeRootOf}}}_{{2}}{≔}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{2}{,}{\mathrm{index}}{=}{1}\right)$ (39)
 > $\mathrm{CubeRootOf}\left[3\right]≔\mathrm{RootOf}\left({\mathrm{_Z}}^{3}-3,\mathrm{index}=1\right)$
 ${{\mathrm{CubeRootOf}}}_{{3}}{≔}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{3}{,}{\mathrm{index}}{=}{1}\right)$ (40)
 > $\mathrm{CubeRootOf}\left[4\right]≔\mathrm{RootOf}\left({\mathrm{_Z}}^{3}-4,\mathrm{index}=1\right)$
 ${{\mathrm{CubeRootOf}}}_{{4}}{≔}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{4}{,}{\mathrm{index}}{=}{1}\right)$ (41)
 > $\mathrm{CubeRootOf}\left[6\right]≔\mathrm{RootOf}\left({\mathrm{_Z}}^{3}-6,\mathrm{index}=1\right)$
 ${{\mathrm{CubeRootOf}}}_{{6}}{≔}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{6}{,}{\mathrm{index}}{=}{1}\right)$ (42)
 > $\mathrm{Reduce}\left(\mathrm{CubeRootOf}\left[4\right]\mathrm{CubeRootOf}\left[-2\right]\mathrm{CubeRootOf}\left[3\right]-\mathrm{CubeRootOf}\left[-4\right]\mathrm{CubeRootOf}\left[6\right]\right)$
 ${\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{+}{2}{,}{\mathrm{index}}{=}{1}\right){}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{3}{,}{\mathrm{index}}{=}{1}\right){}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{4}{,}{\mathrm{index}}{=}{1}\right){-}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{+}{4}{,}{\mathrm{index}}{=}{1}\right){}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{6}{,}{\mathrm{index}}{=}{1}\right)$ (43)
 > $\mathrm{Reduce}\left(\mathrm{CubeRootOf}\left[4\right]\mathrm{CubeRootOf}\left[-2\right]\mathrm{CubeRootOf}\left[3\right]-\mathrm{CubeRootOf}\left[-4\right]\mathrm{CubeRootOf}\left[6\right],'\mathrm{makeindependent}'=\mathrm{true}\right)$
 ${0}$ (44)

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

 > $\mathrm{Reduce}\left(\mathrm{CubeRootOf}\left[2\right]\mathrm{CubeRootOf}\left[3\right]-\mathrm{CubeRootOf}\left[6\right],'\mathrm{makeindependent}'=\mathrm{false}\right)$
 ${\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{2}{,}{\mathrm{index}}{=}{1}\right){}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{3}{,}{\mathrm{index}}{=}{1}\right){-}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{6}{,}{\mathrm{index}}{=}{1}\right)$ (45)