simplify/siderels - Maple Programming Help

Home : Support : Online Help : Mathematics : Algebra : Expression Manipulation : Simplifying : simplify/siderels

simplify/siderels

simplify with respect to side relations

 Calling Sequence simplify(expr, eqns) simplify(expr, eqns, vars) simplify(expr, eqns, tord) simplify(expr, eqns, 'mindeg')

Parameters

 expr - expression eqns - set or list of equations (an expression $e$ is understood as the equation $e=0$) vars - (optional) set or list of variables appearing in eqns tord - (optional) a monomial order in the variables appearing in eqns

Description

 • Simplification of expr with respect to the side relations eqns is performed. The result is an expression which is mathematically equivalent to expr but which is in normal form with respect to the specified side relations.
 • In all cases simplify computes a Groebner basis for the set of side relations. This basis contains all the algebraic consequences of eqns, so that if an expression can be rewritten in terms of the relations simplify will reduce it to zero.  Otherwise, simplify returns a remainder in which none of the terms are reducible.
 • To ensure a finite division process simplify imposes a total order on terms which can appear. This order, called a monomial order, is used for both the Groebner basis computation and the division.  The monomial order can be specified by an optional third argument, and different orders can drastically affect a non-zero result:
 If a list of variables vars is specified then pure lexicographic (plex) order is used and the leftmost variables are eliminated first.
 If a set of variables vars is given then a total degree (tdeg) order is used and terms with the highest degree in all the variables are eliminated first.  Terms with the same total degree are ordered heuristically.
 If no third argument was specified then lexicographic order is used and variables appearing on the left hand side of any equation in eqns are eliminated first.
 If a monomial order tord is specified then that order is used for all computations. See Groebner[MonomialOrders] for a list of the available monomial orders.
 • If $\mathrm{expr}$ is a rational expression then one of three algorithms can be used. If a list or set of variables vars is specified or if the third argument is omitted then simplification is applied to the numerator and denominator separately. This method is very fast, however no attempt is made to simplify the ratio of the numerator and denominator so simpler representations of the fraction may be missed.
 • If a monomial order tord is specified then the largest monomial appearing in the numerator and denominator is minimized with respect to tord. The result is a simplified canonical form with respect to the monomial order. Note that in some cases a common factor may be introduced to satisfy this requirement, as in example 2 below.  If the denominator is invertible or if it divides the numerator modulo the side relations then a quotient is computed and it is returned instead.
 • The optional argument $'\mathrm{mindeg}'$ minimizes the sum of the degrees of the resulting fraction. It uses a global search to find an equivalent fraction $\frac{a}{b}$ with $\mathrm{deg}\left(a\right)+\mathrm{deg}\left(b\right)$ minimal. The result is not canonical, but in some cases the output may be preferable to a canonical form, as in example 3 below.  In general the search is exponential time in $\mathrm{deg}\left(a\right)+\mathrm{deg}\left(b\right)$.
 • If the expression is neither a polynomial nor a rational function in the variables, simplify will recurse on the input $\mathrm{expr}$ and apply the normalization to any subexpressions which are rational functions in the variables.

Examples

Example 1: trigonometric polynomials

 > $\mathrm{eqns}≔\left\{{\mathrm{sin}\left(x\right)}^{2}+{\mathrm{cos}\left(x\right)}^{2}=1\right\}:$
 > $e≔{\mathrm{sin}\left(x\right)}^{3}-11{\mathrm{sin}\left(x\right)}^{2}\mathrm{cos}\left(x\right)+3{\mathrm{cos}\left(x\right)}^{3}-\mathrm{sin}\left(x\right)\mathrm{cos}\left(x\right)+2$
 ${e}{≔}{{\mathrm{sin}}{}\left({x}\right)}^{{3}}{-}{11}{}{{\mathrm{sin}}{}\left({x}\right)}^{{2}}{}{\mathrm{cos}}{}\left({x}\right){+}{3}{}{{\mathrm{cos}}{}\left({x}\right)}^{{3}}{-}{\mathrm{sin}}{}\left({x}\right){}{\mathrm{cos}}{}\left({x}\right){+}{2}$ (1)
 > $\mathrm{simplify}\left(e,\mathrm{eqns}\right)$
 ${14}{}{{\mathrm{cos}}{}\left({x}\right)}^{{3}}{-}{{\mathrm{cos}}{}\left({x}\right)}^{{2}}{}{\mathrm{sin}}{}\left({x}\right){-}{\mathrm{sin}}{}\left({x}\right){}{\mathrm{cos}}{}\left({x}\right){-}{11}{}{\mathrm{cos}}{}\left({x}\right){+}{\mathrm{sin}}{}\left({x}\right){+}{2}$ (2)
 > $\mathrm{simplify}\left(e,\mathrm{eqns},\left[\mathrm{sin}\left(x\right),\mathrm{cos}\left(x\right)\right]\right)$
 ${14}{}{{\mathrm{cos}}{}\left({x}\right)}^{{3}}{-}{{\mathrm{cos}}{}\left({x}\right)}^{{2}}{}{\mathrm{sin}}{}\left({x}\right){-}{\mathrm{sin}}{}\left({x}\right){}{\mathrm{cos}}{}\left({x}\right){-}{11}{}{\mathrm{cos}}{}\left({x}\right){+}{\mathrm{sin}}{}\left({x}\right){+}{2}$ (3)
 > $\mathrm{simplify}\left(e,\mathrm{eqns},\left[\mathrm{cos}\left(x\right),\mathrm{sin}\left(x\right)\right]\right)$
 ${-}{14}{}{{\mathrm{sin}}{}\left({x}\right)}^{{2}}{}{\mathrm{cos}}{}\left({x}\right){+}{{\mathrm{sin}}{}\left({x}\right)}^{{3}}{-}{\mathrm{sin}}{}\left({x}\right){}{\mathrm{cos}}{}\left({x}\right){+}{3}{}{\mathrm{cos}}{}\left({x}\right){+}{2}$ (4)
 > $f≔8{\mathrm{sin}\left(x\right)}^{4}\mathrm{cos}\left(x\right)+15{\mathrm{sin}\left(x\right)}^{2}{\mathrm{cos}\left(x\right)}^{3}-15{\mathrm{sin}\left(x\right)}^{2}\mathrm{cos}\left(x\right)+7{\mathrm{cos}\left(x\right)}^{5}-14{\mathrm{cos}\left(x\right)}^{3}+7\mathrm{cos}\left(x\right)$
 ${f}{≔}{8}{}{{\mathrm{sin}}{}\left({x}\right)}^{{4}}{}{\mathrm{cos}}{}\left({x}\right){+}{15}{}{{\mathrm{sin}}{}\left({x}\right)}^{{2}}{}{{\mathrm{cos}}{}\left({x}\right)}^{{3}}{-}{15}{}{{\mathrm{sin}}{}\left({x}\right)}^{{2}}{}{\mathrm{cos}}{}\left({x}\right){+}{7}{}{{\mathrm{cos}}{}\left({x}\right)}^{{5}}{-}{14}{}{{\mathrm{cos}}{}\left({x}\right)}^{{3}}{+}{7}{}{\mathrm{cos}}{}\left({x}\right)$ (5)
 > $\mathrm{simplify}\left(f,\mathrm{eqns}\right)$
 ${0}$ (6)
 > $r≔\frac{1-{\mathrm{cos}\left(x\right)}^{2}+\mathrm{sin}\left(x\right)\mathrm{cos}\left(x\right)}{\mathrm{sin}\left(x\right)\mathrm{cos}\left(x\right)+{\mathrm{cos}\left(x\right)}^{2}}$
 ${r}{≔}\frac{{1}{-}{{\mathrm{cos}}{}\left({x}\right)}^{{2}}{+}{\mathrm{sin}}{}\left({x}\right){}{\mathrm{cos}}{}\left({x}\right)}{{\mathrm{sin}}{}\left({x}\right){}{\mathrm{cos}}{}\left({x}\right){+}{{\mathrm{cos}}{}\left({x}\right)}^{{2}}}$ (7)
 > $\mathrm{simplify}\left(r,\mathrm{eqns}\right)$
 ${-}\frac{{{\mathrm{cos}}{}\left({x}\right)}^{{2}}{-}{\mathrm{sin}}{}\left({x}\right){}{\mathrm{cos}}{}\left({x}\right){-}{1}}{{\mathrm{cos}}{}\left({x}\right){}\left({\mathrm{sin}}{}\left({x}\right){+}{\mathrm{cos}}{}\left({x}\right)\right)}$ (8)
 > $\mathrm{simplify}\left(r,\mathrm{eqns},'\mathrm{mindeg}'\right)$
 $\frac{{\mathrm{sin}}{}\left({x}\right)}{{\mathrm{cos}}{}\left({x}\right)}$ (9)

Example 2: reducing fractions to a canonical form

 > $\mathrm{eqns2}≔\left\{x{y}^{5}-x-y\right\}$
 ${\mathrm{eqns2}}{≔}\left\{{x}{}{{y}}^{{5}}{-}{x}{-}{y}\right\}$ (10)
 > $r≔\frac{{y}^{5}+x+y}{x-y}$
 ${r}{≔}\frac{{{y}}^{{5}}{+}{x}{+}{y}}{{x}{-}{y}}$ (11)
 > $\mathrm{simplify}\left(r,\mathrm{eqns2},\mathrm{tdeg}\left(x,y\right)\right)$
 $\frac{{{x}}^{{2}}{+}{x}{}{y}{+}{x}{+}{y}}{{{x}}^{{2}}{-}{x}{}{y}}$ (12)
 > $\mathrm{simplify}\left(r,\mathrm{eqns2},\mathrm{plex}\left(x,y\right)\right)$
 $\frac{{{y}}^{{9}}{+}{{y}}^{{5}}{-}{{y}}^{{4}}}{{-}{{y}}^{{5}}{+}{2}}$ (13)
 > $\mathrm{simplify}\left(r,\mathrm{eqns2},'\mathrm{mindeg}'\right)$
 $\frac{{-}{{x}}^{{2}}{-}{x}{}{y}{-}{x}{-}{y}}{{-}{{x}}^{{2}}{+}{x}{}{y}}$ (14)
 > $\mathrm{r2}≔\frac{-{x}^{3}-y{x}^{2}-{x}^{4}-y{x}^{3}+2x{y}^{4}+2{y}^{4}+{y}^{5}+x+y}{y{x}^{3}-{x}^{4}+2x{y}^{4}-4+x-y}$
 ${\mathrm{r2}}{≔}\frac{{2}{}{x}{}{{y}}^{{4}}{+}{{y}}^{{5}}{-}{{x}}^{{4}}{-}{{x}}^{{3}}{}{y}{+}{2}{}{{y}}^{{4}}{-}{{x}}^{{3}}{-}{{x}}^{{2}}{}{y}{+}{x}{+}{y}}{{2}{}{x}{}{{y}}^{{4}}{-}{{x}}^{{4}}{+}{{x}}^{{3}}{}{y}{+}{x}{-}{y}{-}{4}}$ (15)
 > $\mathrm{simplify}\left(\mathrm{r2},\mathrm{eqns2}\right)$
 $\frac{{-}{2}{}{x}{}{{y}}^{{4}}{-}{{y}}^{{5}}{+}{{x}}^{{4}}{+}{{x}}^{{3}}{}{y}{-}{2}{}{{y}}^{{4}}{+}{{x}}^{{3}}{+}{{x}}^{{2}}{}{y}{-}{x}{-}{y}}{{-}{2}{}{x}{}{{y}}^{{4}}{+}{{x}}^{{4}}{-}{{x}}^{{3}}{}{y}{-}{x}{+}{y}{+}{4}}$ (16)
 > $\mathrm{simplify}\left(\mathrm{r2},\mathrm{eqns2},\mathrm{tdeg}\left(x,y\right)\right)$
 $\frac{{{x}}^{{2}}{+}{x}{}{y}{+}{x}{+}{y}}{{{x}}^{{2}}{-}{x}{}{y}}$ (17)

Example 3: the canonical form algorithm may increase total degree

 > $\mathrm{eqns3}≔\left\{{x}^{5}+xy-1\right\}$
 ${\mathrm{eqns3}}{≔}\left\{{{x}}^{{5}}{+}{x}{}{y}{-}{1}\right\}$ (18)
 > $r≔\frac{{x}^{3}{y}^{3}-{x}^{4}+x-1}{{x}^{2}-{y}^{2}+1}$
 ${r}{≔}\frac{{{x}}^{{3}}{}{{y}}^{{3}}{-}{{x}}^{{4}}{+}{x}{-}{1}}{{{x}}^{{2}}{-}{{y}}^{{2}}{+}{1}}$ (19)
 > $\mathrm{simplify}\left(r,\mathrm{eqns3},\mathrm{tdeg}\left(x,y\right)\right)$
 $\frac{{x}{}{{y}}^{{4}}{-}{{x}}^{{3}}{-}{{x}}^{{2}}{}{y}{-}{{y}}^{{3}}{+}{{x}}^{{2}}{+}{x}}{{-}{{x}}^{{4}}{+}{{x}}^{{2}}{}{{y}}^{{2}}{-}{{x}}^{{2}}}$ (20)
 > $\mathrm{simplify}\left(r,\mathrm{eqns3},'\mathrm{mindeg}'\right)$
 $\frac{{{x}}^{{3}}{}{{y}}^{{3}}{-}{{x}}^{{4}}{+}{x}{-}{1}}{{{x}}^{{2}}{-}{{y}}^{{2}}{+}{1}}$ (21)

Example 4: the side relations define a field

 > $\mathrm{eqns4}≔\left\{{z}^{3}-{z}^{2}-zy+2{y}^{2}=1,{z}^{3}+{y}^{2}=1,{z}^{2}+zy-{y}^{2}=0,x+y=z\right\}$
 ${\mathrm{eqns4}}{≔}\left\{{x}{+}{y}{=}{z}{,}{{z}}^{{3}}{+}{{y}}^{{2}}{=}{1}{,}{-}{{y}}^{{2}}{+}{y}{}{z}{+}{{z}}^{{2}}{=}{0}{,}{{z}}^{{3}}{+}{2}{}{{y}}^{{2}}{-}{y}{}{z}{-}{{z}}^{{2}}{=}{1}\right\}$ (22)
 > $\mathrm{h1}≔36{z}^{4}{y}^{2}+36z{y}^{4}-36z{y}^{2}-\frac{1{z}^{2}}{2}+zy-\frac{1{y}^{2}}{2}+\frac{1xz}{2}-\frac{1xy}{2}+\frac{2{z}^{4}}{3}+\frac{4{z}^{3}y}{3}-\frac{2{z}^{2}{y}^{2}}{3}-\frac{4z{y}^{3}}{3}+\frac{2{y}^{4}}{3}$
 ${\mathrm{h1}}{≔}{36}{}{{z}}^{{4}}{}{{y}}^{{2}}{+}{36}{}{z}{}{{y}}^{{4}}{-}{36}{}{z}{}{{y}}^{{2}}{-}\frac{{1}}{{2}}{}{{z}}^{{2}}{+}{z}{}{y}{-}\frac{{1}}{{2}}{}{{y}}^{{2}}{+}\frac{{1}}{{2}}{}{x}{}{z}{-}\frac{{1}}{{2}}{}{x}{}{y}{+}\frac{{2}}{{3}}{}{{z}}^{{4}}{+}\frac{{4}}{{3}}{}{{z}}^{{3}}{}{y}{-}\frac{{2}}{{3}}{}{{z}}^{{2}}{}{{y}}^{{2}}{-}\frac{{4}}{{3}}{}{z}{}{{y}}^{{3}}{+}\frac{{2}}{{3}}{}{{y}}^{{4}}$ (23)
 > $\mathrm{simplify}\left(\mathrm{h1},\mathrm{eqns4}\right)$
 ${0}$ (24)
 > $\mathrm{h2}≔z{y}^{2}+{z}^{3}{y}^{3}-3{z}^{2}y+\frac{23}{3}+\frac{5{z}^{2}}{6}+\frac{7zy}{3}-\frac{11{y}^{2}}{6}+\frac{1xz}{2}-\frac{1xy}{2}+\frac{2{z}^{4}}{3}+\frac{4{z}^{3}y}{3}-\frac{2{z}^{2}{y}^{2}}{3}-\frac{4z{y}^{3}}{3}+\frac{2{y}^{4}}{3}$
 ${\mathrm{h2}}{≔}{z}{}{{y}}^{{2}}{+}{{z}}^{{3}}{}{{y}}^{{3}}{-}{3}{}{{z}}^{{2}}{}{y}{+}\frac{{23}}{{3}}{+}\frac{{5}}{{6}}{}{{z}}^{{2}}{+}\frac{{7}}{{3}}{}{z}{}{y}{-}\frac{{11}}{{6}}{}{{y}}^{{2}}{+}\frac{{1}}{{2}}{}{x}{}{z}{-}\frac{{1}}{{2}}{}{x}{}{y}{+}\frac{{2}}{{3}}{}{{z}}^{{4}}{+}\frac{{4}}{{3}}{}{{z}}^{{3}}{}{y}{-}\frac{{2}}{{3}}{}{{z}}^{{2}}{}{{y}}^{{2}}{-}\frac{{4}}{{3}}{}{z}{}{{y}}^{{3}}{+}\frac{{2}}{{3}}{}{{y}}^{{4}}$ (25)
 > $\mathrm{simplify}\left(\mathrm{h2},\mathrm{eqns4},\left\{x,y,z\right\}\right)$
 ${-}\frac{{34}}{{3}}{-}{34}{}{{z}}^{{2}}{}{y}{+}{14}{}{z}{}{y}{+}{16}{}{{z}}^{{2}}{+}{13}{}{y}{+}{8}{}{z}$ (26)
 > $\mathrm{simplify}\left(\mathrm{h2},\mathrm{eqns4},\mathrm{lexdeg}\left(\left[x,z\right],\left[y\right]\right)\right)$
 $\frac{{29}}{{3}}{-}{{y}}^{{5}}{-}{2}{}{{y}}^{{2}}$ (27)
 > $\mathrm{h2inv}≔\mathrm{simplify}\left(\frac{1}{\mathrm{h2}},\mathrm{eqns4},\mathrm{tdeg}\left(x,z,y\right)\right)$
 ${\mathrm{h2inv}}{≔}\frac{{4473752523}}{{42772565971}}{+}\frac{{252548433}}{{42772565971}}{}{{y}}^{{3}}{+}\frac{{815384160}}{{42772565971}}{}{{y}}^{{2}}{+}\frac{{36881532}}{{42772565971}}{}{z}{}{y}{+}\frac{{321405507}}{{42772565971}}{}{y}{+}\frac{{236183994}}{{42772565971}}{}{z}$ (28)
 > $\mathrm{simplify}\left(\mathrm{h2}\mathrm{h2inv},\mathrm{eqns4}\right)$
 ${1}$ (29)

Example 5: a difficult example that can not be handled by other methods

 > $\mathrm{eqns5}≔\left\{{y}^{2}-{x}^{3}+xy-1\right\}$
 ${\mathrm{eqns5}}{≔}\left\{{-}{{x}}^{{3}}{+}{x}{}{y}{+}{{y}}^{{2}}{-}{1}\right\}$ (30)
 > $\mathrm{algcurves}[\mathrm{parametrization}]\left(\mathrm{op}\left(\mathrm{eqns5}\right),x,y,t\right)$
 > $r≔\frac{-{y}^{3}+1-2y{x}^{2}-{x}^{2}{y}^{5}-2x{y}^{2}-{y}^{6}x-{y}^{7}+{y}^{6}}{{y}^{3}-2{y}^{2}+1}$
 ${r}{≔}\frac{{-}{{x}}^{{2}}{}{{y}}^{{5}}{-}{x}{}{{y}}^{{6}}{-}{{y}}^{{7}}{+}{{y}}^{{6}}{-}{2}{}{{x}}^{{2}}{}{y}{-}{2}{}{x}{}{{y}}^{{2}}{-}{{y}}^{{3}}{+}{1}}{{{y}}^{{3}}{-}{2}{}{{y}}^{{2}}{+}{1}}$ (31)
 > $\mathrm{simplify}\left(r,\mathrm{eqns5},\mathrm{tdeg}\left(x,y\right)\right)$
 $\frac{{{y}}^{{5}}{+}{x}{+}{y}}{{x}{-}{y}}$ (32)

References

 Cox, D.; Little, J.; and O'Shea, D. Ideals, Varieties, and Algorithms. 2nd ed. Springer-Verlag, 1997.
 Monagan, M., and Pearce, R. "Rational Simplification Modulo a Polynomial Ideal." ISSAC 2006 proceedings.