\documentclass{article}
\usepackage{axiom}
\setlength{\textwidth}{400pt}
\begin{document}
\title{\$SPAD/src/input westeralgebra.input}
\author{Michael Wester}
\maketitle
\begin{abstract}
These problems come from the web page
\begin{verbatim}
http://math.unm.edu/~wester/cas_review.html
\end{verbatim}
\end{abstract}
\eject
\tableofcontents
\eject
\begin{chunk}{*}
)set break resume
)set messages autoload off
)set streams calculate 7
)sys rm -f westeralgebra.output
)spool westeralgebra.output
)clear all

\end{chunk}
\section{Algebra}

One would think that the simplification $2\ 2^n => 2^{(n + 1)}$ would happen
automatically or at least easily ...
\begin{chunk}{*}
--S 1 of 63
2*2**n
--R 
--R
--R           n
--R   (1)  2 2
--R                                                    Type: Expression(Integer)
--E 1

\end{chunk}
And how about $4\ 2^n => 2^{(n + 2)}$?   [Richard Fateman]
\begin{chunk}{*}
--S 2 of 63
4*2**n
--R 
--R
--R           n
--R   (2)  4 2
--R                                                    Type: Expression(Integer)
--E 2

\end{chunk}
$(-1)^{(n(n + 1))} => 1$ for integer $n$
\begin{chunk}{*}
--S 3 of 63
(-1)**(n*(n + 1))
--R 
--R
--R              2
--R             n  + n
--R   (3)  (- 1)
--R                                                    Type: Expression(Integer)
--E 3

\end{chunk}
Also easy $=> 2 (3 x - 5)$
\begin{chunk}{*}
--S 4 of 63
factor(6*x - 10)
--R 
--R
--R   (4)  2(3x - 5)
--R                                          Type: Factored(Polynomial(Integer))
--E 4

\end{chunk}
Univariate gcd: $gcd(p1, p2) => 1$, $gcd(p1 q, p2 q) => q$   [Richard Liska]
\begin{chunk}{*}
--S 5 of 63
p1:= 64*x**34 - 21*x**47 - 126*x**8 - 46*x**5 - 16*x**60 - 81
--R 
--R
--R             60      47      34       8      5
--R   (5)  - 16x   - 21x   + 64x   - 126x  - 46x  - 81
--R                                                    Type: Polynomial(Integer)
--E 5

--S 6 of 63
p2:= 72*x**60 - 25*x**25 - 19*x**23 - 22*x**39 - 83*x**52 + 54*x**10 + 81
--R 
--R
--R           60      52      39      25      23      10
--R   (6)  72x   - 83x   - 22x   - 25x   - 19x   + 54x   + 81
--R                                                    Type: Polynomial(Integer)
--E 6

--S 7 of 63
q:= 34*x**19 - 25*x**16 + 70*x**7 + 20*x**3 - 91*x - 86
--R 
--R
--R           19      16      7      3
--R   (7)  34x   - 25x   + 70x  + 20x  - 91x - 86
--R                                                    Type: Polynomial(Integer)
--E 7

--S 8 of 63
gcd(p1, p2)
--R 
--R
--R   (8)  1
--R                                                    Type: Polynomial(Integer)
--E 8

--S 9 of 63
gcd(expand(p1*q), expand(p2*q)) - q
--R 
--R
--R   (9)  0
--R                                                    Type: Polynomial(Integer)
--E 9

\end{chunk}
$resultant(p1 q, p2 q) => 0$
\begin{chunk}{*}
--S 10 of 63
resultant(expand(p1*q), expand(p2*q), x)
--R 
--R
--R   (10)  0
--R                                                    Type: Polynomial(Integer)
--E 10

\end{chunk}
How about factorization? $=> p1 * p2$
\begin{chunk}{*}
--S 11 of 63
factor(expand(p1 * p2))
--R 
--R
--R   (11)
--R   -
--R            60      47      34       8      5
--R        (16x   + 21x   - 64x   + 126x  + 46x  + 81)
--R     *
--R            60      52      39      25      23      10
--R        (72x   - 83x   - 22x   - 25x   - 19x   + 54x   + 81)
--R                                          Type: Factored(Polynomial(Integer))
--E 11

)clear properties p1 p2 q

\end{chunk} 
Multivariate gcd: $gcd(p1, p2) => 1, gcd(p1 q, p2 q) => q$
\begin{chunk}{*}
--S 12 of 63
p1:= 24*x*y**19*z**8 - 47*x**17*y**5*z**8 + 6*x**15*y**9*z**2 - 3*x**22 + 5
--R 
--R
--R               19      17 5  8     15 9 2     22
--R   (12)  (24x y   - 47x  y )z  + 6x  y z  - 3x   + 5
--R                                                    Type: Polynomial(Integer)
--E 12

--S 13 of 63
p2:= 34*x**5*y**8*z**13 + 20*x**7*y**7*z**7 + 12*x**9*y**16*z**4 + 80*y**14*z
--R 
--R
--R            5 8 13      7 7 7      9 16 4      14
--R   (13)  34x y z   + 20x y z  + 12x y  z  + 80y  z
--R                                                    Type: Polynomial(Integer)
--E 13

--S 14 of 63
q:= 11*x**12*y**7*z**13 - 23*x**2*y**8*z**10 + 47*x**17*y**5*z**8
--R 
--R
--R            12 7 13      2 8 10      17 5 8
--R   (14)  11x  y z   - 23x y z   + 47x  y z
--R                                                    Type: Polynomial(Integer)
--E 14

--S 15 of 63
gcd(p1, p2)
--R 
--R
--R   (15)  1
--R                                                    Type: Polynomial(Integer)
--E 15

--S 16 of 63
gcd(expand(p1*q), expand(p2*q)) - q
--R 
--R
--R   (16)  0
--R                                                    Type: Polynomial(Integer)
--E 16

\end{chunk}
How about factorization? $=> p1 * p2$
\begin{chunk}{*}
--S 17 of 63
factor(expand(p1 * p2))
--R 
--R
--R   (17)
--R       7        19      17 5  8     15 9 2     22
--R     2y z((24x y   - 47x  y )z  + 6x  y z  - 3x   + 5)
--R  *
--R         5   12      7 6     9 9 3      7
--R     (17x y z   + 10x z  + 6x y z  + 40y )
--R                                          Type: Factored(Polynomial(Integer))
--E 17

)clear properties p1 p2 q

\end{chunk} 
$=> x^n {\textrm\ for\ } n > 0$   [Chris Hurlburt]
\begin{chunk}{*}
--S 18 of 63
gcd(2*x**(n + 4) - x**(n + 2), 4*x**(n + 1) + 3*x**n)
--R 
--R
--R   (18)  1
--R                                                    Type: Expression(Integer)
--E 18

\end{chunk}

Resultants.  If the resultant of two polynomials is zero, this implies they
have a common factor.  See Keith O. Geddes, Stephen R. Czapor and George
Labahn, ``Algorithms for Computer Algebra'', Kluwer Academic Publishers, 1992,
p. 286 $=> 0$
\begin{chunk}{*}
--S 19 of 63
resultant(3*x**4 + 3*x**3 + x**2 - x - 2, x**3 - 3*x**2 + x + 5, x)
--R 
--R
--R   (19)  0
--R                                                    Type: Polynomial(Integer)
--E 19

\end{chunk}
Numbers are nice, but symbols allow for variability---try some high school
algebra: rational simplification $=> (x - 2)/(x + 2)$
\begin{chunk}{*}
--S 20 of 63
(x**2 - 4)/(x**2 + 4*x + 4)
--R 
--R
--R         x - 2
--R   (20)  -----
--R         x + 2
--R                                          Type: Fraction(Polynomial(Integer))
--E 20

\end{chunk}
This example requires more sophistication $=> e^{(x/2)} - 1$
\begin{chunk}{*}
--S 21 of 63
[(%e**x - 1)/(%e**(x/2) + 1), (exp(x) - 1)/(exp(x/2) + 1)]
--R 
--R
--R            x       x
--R          %e  - 1 %e  - 1
--R   (21)  [-------,-------]
--R            x       x
--R            -       -
--R            2       2
--R          %e  + 1 %e  + 1
--R                                              Type: List(Expression(Integer))
--E 21

--S 22 of 63
map(normalize, %)
--R 
--R
--R            x       x
--R            -       -
--R            2       2
--R   (22)  [%e  - 1,%e  - 1]
--R                                              Type: List(Expression(Integer))
--E 22

\end{chunk}
Expand and factor polynomials
\begin{chunk}{*}
--S 23 of 63
(x + 1)**20
--R 
--R
--R   (23)
--R      20      19       18        17        16         15         14         13
--R     x   + 20x   + 190x   + 1140x   + 4845x   + 15504x   + 38760x   + 77520x
--R   + 
--R            12          11          10          9          8         7         6
--R     125970x   + 167960x   + 184756x   + 167960x  + 125970x  + 77520x  + 38760x
--R   + 
--R           5        4        3       2
--R     15504x  + 4845x  + 1140x  + 190x  + 20x + 1
--R                                                    Type: Polynomial(Integer)
--E 23

--S 24 of 63
D(%, x)
--R 
--R
--R   (24)
--R        19       18        17         16         15          14          13
--R     20x   + 380x   + 3420x   + 19380x   + 77520x   + 232560x   + 542640x
--R   + 
--R             12           11           10           9           8           7
--R     1007760x   + 1511640x   + 1847560x   + 1847560x  + 1511640x  + 1007760x
--R   + 
--R            6          5         4         3        2
--R     542640x  + 232560x  + 77520x  + 19380x  + 3420x  + 380x + 20
--R                                                    Type: Polynomial(Integer)
--E 24

--S 25 of 63
factor(%)
--R 
--R
--R                  19
--R   (25)  20(x + 1)
--R                                          Type: Factored(Polynomial(Integer))
--E 25

\end{chunk}
Completely factor this polynomial, then try to multiply it back together!
\begin{chunk}{*}
--S 26 of 63
radicalSolve(x**3 + x**2 - 7 = 0, x)
--R 
--R
--R   (26)
--R   [
--R     x =
--R                            +------------------+2
--R                            |  +----+       +-+
--R                +---+       |9\|1295  + 187\|3
--R           (- 9\|- 3  + 9)  |------------------
--R                           3|         +-+
--R                           \|      54\|3
--R         + 
--R                            +------------------+
--R                            |  +----+       +-+
--R                +---+       |9\|1295  + 187\|3
--R           (- 3\|- 3  - 3)  |------------------ - 2
--R                           3|         +-+
--R                           \|      54\|3
--R      /
--R                        +------------------+
--R                        |  +----+       +-+
--R            +---+       |9\|1295  + 187\|3
--R         (9\|- 3  + 9)  |------------------
--R                       3|         +-+
--R                       \|      54\|3
--R     ,
--R
--R     x =
--R                            +------------------+2
--R                            |  +----+       +-+
--R                +---+       |9\|1295  + 187\|3
--R           (- 9\|- 3  - 9)  |------------------
--R                           3|         +-+
--R                           \|      54\|3
--R         + 
--R                            +------------------+
--R                            |  +----+       +-+
--R                +---+       |9\|1295  + 187\|3
--R           (- 3\|- 3  + 3)  |------------------ + 2
--R                           3|         +-+
--R                           \|      54\|3
--R      /
--R                        +------------------+
--R                        |  +----+       +-+
--R            +---+       |9\|1295  + 187\|3
--R         (9\|- 3  - 9)  |------------------
--R                       3|         +-+
--R                       \|      54\|3
--R     ,
--R          +------------------+2     +------------------+
--R          |  +----+       +-+       |  +----+       +-+
--R          |9\|1295  + 187\|3        |9\|1295  + 187\|3
--R       9  |------------------  - 3  |------------------ + 1
--R         3|         +-+            3|         +-+
--R         \|      54\|3             \|      54\|3
--R    x= ----------------------------------------------------]
--R                         +------------------+
--R                         |  +----+       +-+
--R                         |9\|1295  + 187\|3
--R                      9  |------------------
--R                        3|         +-+
--R                        \|      54\|3
--R                                    Type: List(Equation(Expression(Integer)))
--E 26

--S 27 of 63
reduce(*, map(e +-> lhs(e) - rhs(e), %))
--R 
--R
--R            3     2       +-+ +----+       3       2
--R         (9x  + 9x  - 63)\|3 \|1295  + 561x  + 561x  - 3927
--R   (27)  --------------------------------------------------
--R                         +-+ +----+       +-+2
--R                       9\|3 \|1295  + 187\|3
--R                                                    Type: Expression(Integer)
--E 27

--S 28 of 63
x**100 - 1
--R 
--R
--R          100
--R   (28)  x    - 1
--R                                                    Type: Polynomial(Integer)
--E 28

--S 29 of 63
factor(%)
--R 
--R
--R   (29)
--R                     2       4    3    2           4    3    2
--R     (x - 1)(x + 1)(x  + 1)(x  - x  + x  - x + 1)(x  + x  + x  + x + 1)
--R  *
--R       8    6    4    2       20    15    10    5       20    15    10    5
--R     (x  - x  + x  - x  + 1)(x   - x   + x   - x  + 1)(x   + x   + x   + x  + 1)
--R  *
--R       40    30    20    10
--R     (x   - x   + x   - x   + 1)
--R                                          Type: Factored(Polynomial(Integer))
--E 29

\end{chunk}
Factorization over the complex rationals

$=> (2 x + 3 i) (2 x - 3 i) (x + 1 + 4 i) (x + 1 - 4 i)$
\begin{chunk}{*}
--S 30 of 63
factor(4*x**4 + 8*x**3 + 77*x**2 + 18*x + 153, [rootOf(i**2 + 1)])
--R 
--R
--R                           3i      3i
--R   (30)  4(x - 4i + 1)(x - --)(x + --)(x + 4i + 1)
--R                            2       2
--R                                  Type: Factored(Polynomial(AlgebraicNumber))
--E 30

\end{chunk}
Algebraic extensions
\begin{chunk}{*}
--S 31 of 63
sqrt2:= rootOf(sqrt2**2 - 2)
--R 
--R
--R   (31)  sqrt2
--R                                                        Type: AlgebraicNumber
--E 31

\end{chunk}
$=> sqrt2 + 1$
\begin{chunk}{*}
--S 32 of 63
1/(sqrt2 - 1)
--R 
--R
--R   (32)  sqrt2 + 1
--R                                                        Type: AlgebraicNumber
--E 32

\end{chunk}
$=> (x^2 - 2 x - 3)/(x - sqrt2) = (x + 1) (x - 3)/(x - sqrt2)$
[Richard Liska]
\begin{chunk}{*}
--S 33 of 63
(x**3 + (sqrt2 - 2)*x**2 - (2*sqrt2 + 3)*x - 3*sqrt2)/(x**2 - 2)
--R 
--R
--R          2
--R         x  - 2x - 3
--R   (33)  -----------
--R          x - sqrt2
--R                                  Type: Fraction(Polynomial(AlgebraicNumber))
--E 33

--S 34 of 63
numer(%)/ratDenom(denom(%))
--R 
--R
--R            2
--R         - x  + 2x + 3
--R   (34)  -------------
--R           sqrt2 - x
--R                                                    Type: Expression(Integer)
--E 34

)clear properties sqrt2

\end{chunk} 
Multiple algebraic extensions
\begin{chunk}{*}
--S 35 of 63
sqrt3:= rootOf(sqrt3**2 - 3)
--R 
--R
--R   (35)  sqrt3
--R                                                        Type: AlgebraicNumber
--E 35

--S 36 of 63
cbrt2:= rootOf(cbrt2**3 - 2)
--R 
--R
--R   (36)  cbrt2
--R                                                        Type: AlgebraicNumber
--E 36

\end{chunk}
$=> 2 cbrt2 + 8 sqrt3 + 18 cbrt2^2 + 12 cbrt2 sqrt3 + 9$
\begin{chunk}{*}
--S 37 of 63
(cbrt2 + sqrt3)**4
--R 
--R
--R                                     2
--R   (37)  (12cbrt2 + 8)sqrt3 + 18cbrt2  + 2cbrt2 + 9
--R                                                        Type: AlgebraicNumber
--E 37

)clear properties sqrt3 cbrt2

\end{chunk}
Factor polynomials over finite fields and field extensions
\begin{chunk}{*}
--S 38 of 63
p:= x**4 - 3*x**2 + 1
--R 
--R
--R          4     2
--R   (38)  x  - 3x  + 1
--R                                                    Type: Polynomial(Integer)
--E 38

--S 39 of 63
factor(p)
--R 
--R
--R           2           2
--R   (39)  (x  - x - 1)(x  + x - 1)
--R                                          Type: Factored(Polynomial(Integer))
--E 39

\end{chunk}
$=> (x - 2)^2 (x + 2)^2 {\textrm\ mod\ } 5$
\begin{chunk}{*}
--S 40 of 63
factor(p :: Polynomial(PrimeField(5)))
--R 
--R
--R                2       2
--R   (40)  (x + 2) (x + 3)
--R                                    Type: Factored(Polynomial(PrimeField(5)))
--E 40

--S 41 of 63
expand(%)
--R 
--R
--R          4     2
--R   (41)  x  + 2x  + 1
--R                                              Type: Polynomial(PrimeField(5))
--E 41

\end{chunk}
$=> (x^2 + x + 1) (x^9 - x^8 + x^6 - x^5 + x^3 - x^2 + 1){\textrm\ mod\ } 65537$
[Paul Zimmermann]
\begin{chunk}{*}
--S 42 of 63
factor(x**11 + x + 1 :: Polynomial(PrimeField(65537)))
--R 
--R
--R           2           9         8    6         5    3         2
--R   (42)  (x  + x + 1)(x  + 65536x  + x  + 65536x  + x  + 65536x  + 1)
--R                                Type: Factored(Polynomial(PrimeField(65537)))
--E 42

\end{chunk}
$=> (x - phi) (x + phi) (x - phi + 1) (x + phi - 1)$

where $phi^2 - phi - 1 = 0$ or $phi = (1 \pm sqrt(5))/2$
\begin{chunk}{*}
--S 43 of 63
phi:= rootOf(phi**2 - phi - 1)
--R 
--R
--R   (43)  phi
--R                                                        Type: AlgebraicNumber
--E 43

--S 44 of 63
factor(p, [phi])
--R 
--R
--R   (44)  (x - phi)(x - phi + 1)(x + phi - 1)(x + phi)
--R                                  Type: Factored(Polynomial(AlgebraicNumber))
--E 44

)clear properties phi p
 
--S 45 of 63
expand((x - 2*y**2 + 3*z**3)**20)
--R 
--R
--R   (45)
--R                60                  2                 57
--R     3486784401z   + (- 46490458680y  + 23245229340x)z
--R   + 
--R                   4                  2               2  54
--R     (294439571640y  - 294439571640x y  + 73609892910x )z
--R   + 
--R                           6                   4                2 2
--R           - 1177758286560y  + 1766637429840x y  - 883318714920x y
--R         + 
--R                        3
--R           147219785820x
--R    *
--R        51
--R       z
--R   + 
--R                       8                   6                 2 4
--R         3336981811920y  - 6673963623840x y  + 5005472717880x y
--R       + 
--R                         3 2                4
--R         - 1668490905960x y  + 208561363245x
--R    *
--R        48
--R       z
--R   + 
--R                         10                    8                  2 6
--R         - 7118894532096y   + 17797236330240x y  - 17797236330240x y
--R       + 
--R                       3 4                 4 2                5
--R         8898618165120x y  - 2224654541280x y  + 222465454128x
--R    *
--R        45
--R       z
--R   + 
--R                        12                    10                  2 8
--R         11864824220160y   - 35594472660480x y   + 44493090825600x y
--R       + 
--R                          3 6                  4 4                 5 2
--R         - 29662060550400x y  + 11123272706400x y  - 2224654541280x y
--R       + 
--R                      6
--R         185387878440x
--R    *
--R        42
--R       z
--R   + 
--R                          14                    12                  2 10
--R         - 15819765626880y   + 55369179694080x y   - 83053769541120x y
--R       + 
--R                        3 8                  4 6                  5 4
--R         69211474617600x y  - 34605737308800x y  + 10381721192640x y
--R       + 
--R                         6 2                7
--R         - 1730286865440x y  + 123591918960x
--R    *
--R        39
--R       z
--R   + 
--R                        16                    14                   2 12
--R         17138079429120y   - 68552317716480x y   + 119966556003840x y
--R       + 
--R                           3 10                  4 8                  5 6
--R         - 119966556003840x y   + 74979097502400x y  - 29991639000960x y
--R       + 
--R                       6 4                 7 2               8
--R         7497909750240x y  - 1071129964320x y  + 66945622770x
--R    *
--R        36
--R       z
--R   + 
--R                          18                    16                   2 14
--R         - 15233848381440y   + 68552317716480x y   - 137104635432960x y
--R       + 
--R                         3 12                   4 10                  5 8
--R         159955408005120x y   - 119966556003840x y   + 59983278001920x y
--R       + 
--R                          6 6                 7 4                8 2
--R         - 19994426000640x y  + 4284519857280x y  - 535564982160x y
--R       + 
--R                     9
--R         29753610120x
--R    *
--R        33
--R       z
--R   + 
--R                        20                    18                   2 16
--R         11171488813056y   - 55857444065280x y   + 125679249146880x y
--R       + 
--R                           3 14                   4 12                  5 10
--R         - 167572332195840x y   + 146625790671360x y   - 87975474402816x y
--R       + 
--R                        6 8                  7 6                 8 4
--R         36656447667840x y  - 10473270762240x y  + 1963738267920x y
--R       + 
--R                        9 2               10
--R         - 218193140880x y  + 10909657044x
--R    *
--R        30
--R       z
--R   + 
--R                         22                    20                  2 18
--R         - 6770599280640y   + 37238296043520x y   - 93095740108800x y
--R       + 
--R                         3 16                   4 14                  5 12
--R         139643610163200x y   - 139643610163200x y   + 97750527114240x y
--R       + 
--R                          6 10                  7 8                 8 6
--R         - 48875263557120x y   + 17455451270400x y  - 4363862817600x y
--R       + 
--R                      9 4               10 2              11
--R         727310469600x y  - 72731046960x  y  + 3305956680x
--R    *
--R        27
--R       z
--R   + 
--R                       24                    22                  2 20
--R         3385299640320y   - 20311797841920x y   + 55857444065280x y
--R       + 
--R                          3 18                   4 16                  5 14
--R         - 93095740108800x y   + 104732707622400x y   - 83786166097920x y
--R       + 
--R                        6 12                  7 10                 8 8
--R         48875263557120x y   - 20946541524480x y   + 6545794226400x y
--R       + 
--R                       9 6                10 4               11 2             12
--R       - 1454620939200x y  + 218193140880x  y  - 19835740080x  y  + 826489170x
--R    *
--R        24
--R       z
--R   + 
--R                         26                   24                  2 22
--R         - 1388840878080y   + 9027465707520x y   - 27082397122560x y
--R       + 
--R                        3 20                  4 18                  5 16
--R         49651061391360x y   - 62063826739200x y   + 55857444065280x y
--R       + 
--R                          6 14                  7 12                 8 10
--R         - 37238296043520x y   + 18619148021760x y   - 6982180508160x y
--R       + 
--R                       9 8                10 6               11 4
--R         1939494585600x y  - 387898917120x  y  + 52895306880x  y
--R       + 
--R                      12 2             13
--R         - 4407942240x  y  + 169536240x
--R    *
--R        21
--R       z
--R   + 
--R                      28                   26                  2 24
--R         462946959360y   - 3240628715520x y   + 10532043325440x y
--R       + 
--R                          3 22                  4 20                  5 18
--R         - 21064086650880x y   + 28963119144960x y   - 28963119144960x y
--R       + 
--R                        6 16                  7 14                 8 12
--R         21722339358720x y   - 12412765347840x y   + 5430584839680x y
--R       + 
--R                         9 10                10 8               11 6
--R         - 1810194946560x y   + 452548736640x  y  - 82281588480x  y
--R       + 
--R                     12 4             13 2            14
--R         10285198560x  y  - 791169120x  y  + 28256040x
--R    *
--R        18
--R       z
--R   + 
--R                        30                  28                 2 26
--R         - 123452522496y   + 925893918720x y   - 3240628715520x y
--R       + 
--R                       3 24                  4 22                  5 20
--R         7021362216960x y   - 10532043325440x y   + 11585247657984x y
--R       + 
--R                         6 18                 7 16                 8 14
--R         - 9654373048320x y   + 6206382673920x y   - 3103191336960x y
--R       + 
--R                       9 12                10 10               11 8
--R         1206796631040x y   - 362038989312x  y   + 82281588480x  y
--R       + 
--R                       12 6              13 4             14 2           15
--R         - 13713598080x  y  + 1582338240x  y  - 113024160x  y  + 3767472x
--R    *
--R        15
--R       z
--R   + 
--R                     32                  30                2 28
--R         25719275520y   - 205754204160x y   + 771578265600x y
--R       + 
--R                         3 26                 4 24                 5 22
--R         - 1800349286400x y   + 2925567590400x y   - 3510681108480x y
--R       + 
--R                       6 20                 7 18                 8 16
--R         3218124349440x y   - 2298660249600x y   + 1292996390400x y
--R       + 
--R                        9 14                10 12               11 10
--R         - 574665062400x y   + 201132771840x  y   - 54854392320x  y
--R       + 
--R                     12 8              13 6             14 4            15 2
--R         11427998400x  y  - 1758153600x  y  + 188373600x  y  - 12558240x  y
--R       + 
--R                16
--R         392445x
--R    *
--R        12
--R       z
--R   + 
--R                      34                 32                2 30
--R         - 4034396160y   + 34292367360x y   - 137169469440x y
--R       + 
--R                      3 28                4 26                5 24
--R         342923673600x y   - 600116428800x y   + 780151357440x y
--R       + 
--R                        6 22                7 20                8 18
--R         - 780151357440x y   + 612976066560x y   - 383110041600x y
--R       + 
--R                      9 16               10 14               11 12
--R         191555020800x y   - 76622008320x  y   + 24379729920x  y
--R       + 
--R                      12 10              13 8             14 6            15 4
--R         - 6094932480x  y   + 1172102400x  y  - 167443200x  y  + 16744320x  y
--R       + 
--R                   16 2         17
--R         - 1046520x  y  + 30780x
--R    *
--R        9
--R       z
--R   + 
--R                   36                34               2 32               3 30
--R         448266240y   - 4034396160x y   + 17146183680x y   - 45723156480x y
--R       + 
--R                     4 28                5 26                6 24
--R         85730918400x y   - 120023285760x y   + 130025226240x y
--R       + 
--R                        7 22               8 20               9 18
--R         - 111450193920x y   + 76622008320x y   - 42567782400x y
--R       + 
--R                     10 16              11 14              12 12
--R         19155502080x  y   - 6965637120x  y   + 2031644160x  y
--R       + 
--R                     13 10            14 8            15 6           16 4
--R         - 468840960x  y   + 83721600x  y  - 11162880x  y  + 1046520x  y
--R       + 
--R                 17 2        18
--R         - 61560x  y  + 1710x
--R    *
--R        6
--R       z
--R   + 
--R                    38               36              2 34              3 32
--R         - 31457280y   + 298844160x y   - 1344798720x y   + 3810263040x y
--R       + 
--R                      4 30               5 28               6 26
--R         - 7620526080x y   + 11430789120x y   - 13335920640x y
--R       + 
--R                     7 24              8 22              9 20              10 18
--R         12383354880x y   - 9287516160x y   + 5675704320x y   - 2837852160x  y
--R       + 
--R                    11 16             12 14             13 12            14 10
--R         1160939520x  y   - 386979840x  y   + 104186880x  y   - 22325760x  y
--R       + 
--R                 15 8          16 6         17 4        18 2      19
--R         3720960x  y  - 465120x  y  + 41040x  y  - 2280x  y  + 60x
--R    *
--R        3
--R       z
--R   + 
--R             40              38            2 36             3 34
--R     1048576y   - 10485760x y   + 49807360x y   - 149422080x y
--R   + 
--R               4 32             5 30             6 28             7 26
--R     317521920x y   - 508035072x y   + 635043840x y   - 635043840x y
--R   + 
--R               8 24             9 22             10 20            11 18
--R     515973120x y   - 343982080x y   + 189190144x  y   - 85995520x  y
--R   + 
--R              12 16           13 14           14 12          15 10         16 8
--R     32248320x  y   - 9922560x  y   + 2480640x  y   - 496128x  y   + 77520x  y
--R   + 
--R            17 6       18 4      19 2    20
--R     - 9120x  y  + 760x  y  - 40x  y  + x
--R                                                    Type: Polynomial(Integer)
--E 45

--S 46 of 63
factor(%)
--R 
--R
--R            3     2     20
--R   (46)  (3z  - 2y  + x)
--R                                          Type: Factored(Polynomial(Integer))
--E 46

--S 47 of 63
expand((sin(x) - 2*cos(y)**2 + 3*tan(z)**3)**20)
--R 
--R
--R   (47)
--R                     60                                         2       57
--R     3486784401tan(z)   + (23245229340sin(x) - 46490458680cos(y) )tan(z)
--R   + 
--R                         2                     2                           4
--R       (73609892910sin(x)  - 294439571640cos(y) sin(x) + 294439571640cos(y) )
--R    *
--R             54
--R       tan(z)
--R   + 
--R                           3                     2      2
--R         147219785820sin(x)  - 883318714920cos(y) sin(x)
--R       + 
--R                            4                            6
--R         1766637429840cos(y) sin(x) - 1177758286560cos(y)
--R    *
--R             51
--R       tan(z)
--R   + 
--R                           4                      2      3
--R         208561363245sin(x)  - 1668490905960cos(y) sin(x)
--R       + 
--R                            4      2                      6
--R         5005472717880cos(y) sin(x)  - 6673963623840cos(y) sin(x)
--R       + 
--R                            8
--R         3336981811920cos(y)
--R    *
--R             48
--R       tan(z)
--R   + 
--R                           5                      2      4
--R         222465454128sin(x)  - 2224654541280cos(y) sin(x)
--R       + 
--R                            4      3                       6      2
--R         8898618165120cos(y) sin(x)  - 17797236330240cos(y) sin(x)
--R       + 
--R                             8                            10
--R         17797236330240cos(y) sin(x) - 7118894532096cos(y)
--R    *
--R             45
--R       tan(z)
--R   + 
--R                           6                      2      5
--R         185387878440sin(x)  - 2224654541280cos(y) sin(x)
--R       + 
--R                             4      4                       6      3
--R         11123272706400cos(y) sin(x)  - 29662060550400cos(y) sin(x)
--R       + 
--R                             8      2                       10
--R         44493090825600cos(y) sin(x)  - 35594472660480cos(y)  sin(x)
--R       + 
--R                             12
--R         11864824220160cos(y)
--R    *
--R             42
--R       tan(z)
--R   + 
--R                           7                      2      6
--R         123591918960sin(x)  - 1730286865440cos(y) sin(x)
--R       + 
--R                             4      5                       6      4
--R         10381721192640cos(y) sin(x)  - 34605737308800cos(y) sin(x)
--R       + 
--R                             8      3                       10      2
--R         69211474617600cos(y) sin(x)  - 83053769541120cos(y)  sin(x)
--R       + 
--R                             12                             14
--R         55369179694080cos(y)  sin(x) - 15819765626880cos(y)
--R    *
--R             39
--R       tan(z)
--R   + 
--R                          8                      2      7
--R         66945622770sin(x)  - 1071129964320cos(y) sin(x)
--R       + 
--R                            4      6                       6      5
--R         7497909750240cos(y) sin(x)  - 29991639000960cos(y) sin(x)
--R       + 
--R                             8      4                        10      3
--R         74979097502400cos(y) sin(x)  - 119966556003840cos(y)  sin(x)
--R       + 
--R                              12      2                       14
--R         119966556003840cos(y)  sin(x)  - 68552317716480cos(y)  sin(x)
--R       + 
--R                             16
--R         17138079429120cos(y)
--R    *
--R             36
--R       tan(z)
--R   + 
--R                          9                     2      8
--R         29753610120sin(x)  - 535564982160cos(y) sin(x)
--R       + 
--R                            4      7                       6      6
--R         4284519857280cos(y) sin(x)  - 19994426000640cos(y) sin(x)
--R       + 
--R                             8      5                        10      4
--R         59983278001920cos(y) sin(x)  - 119966556003840cos(y)  sin(x)
--R       + 
--R                              12      3                        14      2
--R         159955408005120cos(y)  sin(x)  - 137104635432960cos(y)  sin(x)
--R       + 
--R                             16                             18
--R         68552317716480cos(y)  sin(x) - 15233848381440cos(y)
--R    *
--R             33
--R       tan(z)
--R   + 
--R                          10                     2      9
--R         10909657044sin(x)   - 218193140880cos(y) sin(x)
--R       + 
--R                            4      8                       6      7
--R         1963738267920cos(y) sin(x)  - 10473270762240cos(y) sin(x)
--R       + 
--R                             8      6                       10      5
--R         36656447667840cos(y) sin(x)  - 87975474402816cos(y)  sin(x)
--R       + 
--R                              12      4                        14      3
--R         146625790671360cos(y)  sin(x)  - 167572332195840cos(y)  sin(x)
--R       + 
--R                              16      2                       18
--R         125679249146880cos(y)  sin(x)  - 55857444065280cos(y)  sin(x)
--R       + 
--R                             20
--R         11171488813056cos(y)
--R    *
--R             30
--R       tan(z)
--R   + 
--R                         11                    2      10
--R         3305956680sin(x)   - 72731046960cos(y) sin(x)
--R       + 
--R                           4      9                      6      8
--R         727310469600cos(y) sin(x)  - 4363862817600cos(y) sin(x)
--R       + 
--R                             8      7                       10      6
--R         17455451270400cos(y) sin(x)  - 48875263557120cos(y)  sin(x)
--R       + 
--R                             12      5                        14      4
--R         97750527114240cos(y)  sin(x)  - 139643610163200cos(y)  sin(x)
--R       + 
--R                              16      3                       18      2
--R         139643610163200cos(y)  sin(x)  - 93095740108800cos(y)  sin(x)
--R       + 
--R                             20                            22
--R         37238296043520cos(y)  sin(x) - 6770599280640cos(y)
--R    *
--R             27
--R       tan(z)
--R   + 
--R                        12                    2      11
--R         826489170sin(x)   - 19835740080cos(y) sin(x)
--R       + 
--R                           4      10                      6      9
--R         218193140880cos(y) sin(x)   - 1454620939200cos(y) sin(x)
--R       + 
--R                            8      8                       10      7
--R         6545794226400cos(y) sin(x)  - 20946541524480cos(y)  sin(x)
--R       + 
--R                             12      6                       14      5
--R         48875263557120cos(y)  sin(x)  - 83786166097920cos(y)  sin(x)
--R       + 
--R                              16      4                       18      3
--R         104732707622400cos(y)  sin(x)  - 93095740108800cos(y)  sin(x)
--R       + 
--R                             20      2                       22
--R         55857444065280cos(y)  sin(x)  - 20311797841920cos(y)  sin(x)
--R       + 
--R                            24
--R         3385299640320cos(y)
--R    *
--R             24
--R       tan(z)
--R   + 
--R                        13                   2      12
--R         169536240sin(x)   - 4407942240cos(y) sin(x)
--R       + 
--R                          4      11                     6      10
--R         52895306880cos(y) sin(x)   - 387898917120cos(y) sin(x)
--R       + 
--R                            8      9                      10      8
--R         1939494585600cos(y) sin(x)  - 6982180508160cos(y)  sin(x)
--R       + 
--R                             12      7                       14      6
--R         18619148021760cos(y)  sin(x)  - 37238296043520cos(y)  sin(x)
--R       + 
--R                             16      5                       18      4
--R         55857444065280cos(y)  sin(x)  - 62063826739200cos(y)  sin(x)
--R       + 
--R                             20      3                       22      2
--R         49651061391360cos(y)  sin(x)  - 27082397122560cos(y)  sin(x)
--R       + 
--R                            24                            26
--R         9027465707520cos(y)  sin(x) - 1388840878080cos(y)
--R    *
--R             21
--R       tan(z)
--R   + 
--R                       14                  2      13
--R         28256040sin(x)   - 791169120cos(y) sin(x)
--R       + 
--R                          4      12                    6      11
--R         10285198560cos(y) sin(x)   - 82281588480cos(y) sin(x)
--R       + 
--R                           8      10                      10      9
--R         452548736640cos(y) sin(x)   - 1810194946560cos(y)  sin(x)
--R       + 
--R                            12      8                       14      7
--R         5430584839680cos(y)  sin(x)  - 12412765347840cos(y)  sin(x)
--R       + 
--R                             16      6                       18      5
--R         21722339358720cos(y)  sin(x)  - 28963119144960cos(y)  sin(x)
--R       + 
--R                             20      4                       22      3
--R         28963119144960cos(y)  sin(x)  - 21064086650880cos(y)  sin(x)
--R       + 
--R                             24      2                      26
--R         10532043325440cos(y)  sin(x)  - 3240628715520cos(y)  sin(x)
--R       + 
--R                           28
--R         462946959360cos(y)
--R    *
--R             18
--R       tan(z)
--R   + 
--R                      15                  2      14                   4      13
--R         3767472sin(x)   - 113024160cos(y) sin(x)   + 1582338240cos(y) sin(x)
--R       + 
--R                            6      12                    8      11
--R         - 13713598080cos(y) sin(x)   + 82281588480cos(y) sin(x)
--R       + 
--R                             10      10                      12      9
--R         - 362038989312cos(y)  sin(x)   + 1206796631040cos(y)  sin(x)
--R       + 
--R                              14      8                      16      7
--R         - 3103191336960cos(y)  sin(x)  + 6206382673920cos(y)  sin(x)
--R       + 
--R                              18      6                       20      5
--R         - 9654373048320cos(y)  sin(x)  + 11585247657984cos(y)  sin(x)
--R       + 
--R                               22      4                      24      3
--R         - 10532043325440cos(y)  sin(x)  + 7021362216960cos(y)  sin(x)
--R       + 
--R                              26      2                     28
--R         - 3240628715520cos(y)  sin(x)  + 925893918720cos(y)  sin(x)
--R       + 
--R                             30
--R         - 123452522496cos(y)
--R    *
--R             15
--R       tan(z)
--R   + 
--R                     16                 2      15                  4      14
--R         392445sin(x)   - 12558240cos(y) sin(x)   + 188373600cos(y) sin(x)
--R       + 
--R                           6      13                    8      12
--R         - 1758153600cos(y) sin(x)   + 11427998400cos(y) sin(x)
--R       + 
--R                            10      11                     12      10
--R         - 54854392320cos(y)  sin(x)   + 201132771840cos(y)  sin(x)
--R       + 
--R                             14      9                      16      8
--R         - 574665062400cos(y)  sin(x)  + 1292996390400cos(y)  sin(x)
--R       + 
--R                              18      7                      20      6
--R         - 2298660249600cos(y)  sin(x)  + 3218124349440cos(y)  sin(x)
--R       + 
--R                              22      5                      24      4
--R         - 3510681108480cos(y)  sin(x)  + 2925567590400cos(y)  sin(x)
--R       + 
--R                              26      3                     28      2
--R         - 1800349286400cos(y)  sin(x)  + 771578265600cos(y)  sin(x)
--R       + 
--R                             30                          32
--R         - 205754204160cos(y)  sin(x) + 25719275520cos(y)
--R    *
--R             12
--R       tan(z)
--R   + 
--R                    17                2      16                 4      15
--R         30780sin(x)   - 1046520cos(y) sin(x)   + 16744320cos(y) sin(x)
--R       + 
--R                          6      14                   8      13
--R         - 167443200cos(y) sin(x)   + 1172102400cos(y) sin(x)
--R       + 
--R                           10      12                    12      11
--R         - 6094932480cos(y)  sin(x)   + 24379729920cos(y)  sin(x)
--R       + 
--R                            14      10                     16      9
--R         - 76622008320cos(y)  sin(x)   + 191555020800cos(y)  sin(x)
--R       + 
--R                             18      8                     20      7
--R         - 383110041600cos(y)  sin(x)  + 612976066560cos(y)  sin(x)
--R       + 
--R                             22      6                     24      5
--R         - 780151357440cos(y)  sin(x)  + 780151357440cos(y)  sin(x)
--R       + 
--R                             26      4                     28      3
--R         - 600116428800cos(y)  sin(x)  + 342923673600cos(y)  sin(x)
--R       + 
--R                             30      2                    32
--R         - 137169469440cos(y)  sin(x)  + 34292367360cos(y)  sin(x)
--R       + 
--R                           34
--R         - 4034396160cos(y)
--R    *
--R             9
--R       tan(z)
--R   + 
--R                   18              2      17                4      16
--R         1710sin(x)   - 61560cos(y) sin(x)   + 1046520cos(y) sin(x)
--R       + 
--R                         6      15                 8      14
--R         - 11162880cos(y) sin(x)   + 83721600cos(y) sin(x)
--R       + 
--R                          10      13                   12      12
--R         - 468840960cos(y)  sin(x)   + 2031644160cos(y)  sin(x)
--R       + 
--R                           14      11                    16      10
--R         - 6965637120cos(y)  sin(x)   + 19155502080cos(y)  sin(x)
--R       + 
--R                            18      9                    20      8
--R         - 42567782400cos(y)  sin(x)  + 76622008320cos(y)  sin(x)
--R       + 
--R                             22      7                     24      6
--R         - 111450193920cos(y)  sin(x)  + 130025226240cos(y)  sin(x)
--R       + 
--R                             26      5                    28      4
--R         - 120023285760cos(y)  sin(x)  + 85730918400cos(y)  sin(x)
--R       + 
--R                            30      3                    32      2
--R         - 45723156480cos(y)  sin(x)  + 17146183680cos(y)  sin(x)
--R       + 
--R                           34                        36
--R         - 4034396160cos(y)  sin(x) + 448266240cos(y)
--R    *
--R             6
--R       tan(z)
--R   + 
--R                 19             2      18              4      17
--R         60sin(x)   - 2280cos(y) sin(x)   + 41040cos(y) sin(x)
--R       + 
--R                       6      16                8      15
--R         - 465120cos(y) sin(x)   + 3720960cos(y) sin(x)
--R       + 
--R                         10      14                  12      13
--R         - 22325760cos(y)  sin(x)   + 104186880cos(y)  sin(x)
--R       + 
--R                          14      12                   16      11
--R         - 386979840cos(y)  sin(x)   + 1160939520cos(y)  sin(x)
--R       + 
--R                           18      10                   20      9
--R         - 2837852160cos(y)  sin(x)   + 5675704320cos(y)  sin(x)
--R       + 
--R                           22      8                    24      7
--R         - 9287516160cos(y)  sin(x)  + 12383354880cos(y)  sin(x)
--R       + 
--R                            26      6                    28      5
--R         - 13335920640cos(y)  sin(x)  + 11430789120cos(y)  sin(x)
--R       + 
--R                           30      4                   32      3
--R         - 7620526080cos(y)  sin(x)  + 3810263040cos(y)  sin(x)
--R       + 
--R                         34      2                  36                       38
--R       - 1344798720cos(y)  sin(x)  + 298844160cos(y)  sin(x) - 31457280cos(y)
--R    *
--R             3
--R       tan(z)
--R   + 
--R           20           2      19            4      18             6      17
--R     sin(x)   - 40cos(y) sin(x)   + 760cos(y) sin(x)   - 9120cos(y) sin(x)
--R   + 
--R                8      16               10      15                12      14
--R     77520cos(y) sin(x)   - 496128cos(y)  sin(x)   + 2480640cos(y)  sin(x)
--R   + 
--R                    14      13                 16      12
--R     - 9922560cos(y)  sin(x)   + 32248320cos(y)  sin(x)
--R   + 
--R                     18      11                  20      10
--R     - 85995520cos(y)  sin(x)   + 189190144cos(y)  sin(x)
--R   + 
--R                      22      9                  24      8
--R     - 343982080cos(y)  sin(x)  + 515973120cos(y)  sin(x)
--R   + 
--R                      26      7                  28      6
--R     - 635043840cos(y)  sin(x)  + 635043840cos(y)  sin(x)
--R   + 
--R                      30      5                  32      4
--R     - 508035072cos(y)  sin(x)  + 317521920cos(y)  sin(x)
--R   + 
--R                      34      3                 36      2
--R     - 149422080cos(y)  sin(x)  + 49807360cos(y)  sin(x)
--R   + 
--R                     38                      40
--R     - 10485760cos(y)  sin(x) + 1048576cos(y)
--R                                                    Type: Expression(Integer)
--E 47

--S 48 of 63
factor(%)
--R 
--R
--R   (48)
--R                     60                                         2       57
--R     3486784401tan(z)   + (23245229340sin(x) - 46490458680cos(y) )tan(z)
--R   + 
--R                         2                     2                           4
--R       (73609892910sin(x)  - 294439571640cos(y) sin(x) + 294439571640cos(y) )
--R    *
--R             54
--R       tan(z)
--R   + 
--R                           3                     2      2
--R         147219785820sin(x)  - 883318714920cos(y) sin(x)
--R       + 
--R                            4                            6
--R         1766637429840cos(y) sin(x) - 1177758286560cos(y)
--R    *
--R             51
--R       tan(z)
--R   + 
--R                           4                      2      3
--R         208561363245sin(x)  - 1668490905960cos(y) sin(x)
--R       + 
--R                            4      2                      6
--R         5005472717880cos(y) sin(x)  - 6673963623840cos(y) sin(x)
--R       + 
--R                            8
--R         3336981811920cos(y)
--R    *
--R             48
--R       tan(z)
--R   + 
--R                           5                      2      4
--R         222465454128sin(x)  - 2224654541280cos(y) sin(x)
--R       + 
--R                            4      3                       6      2
--R         8898618165120cos(y) sin(x)  - 17797236330240cos(y) sin(x)
--R       + 
--R                             8                            10
--R         17797236330240cos(y) sin(x) - 7118894532096cos(y)
--R    *
--R             45
--R       tan(z)
--R   + 
--R                           6                      2      5
--R         185387878440sin(x)  - 2224654541280cos(y) sin(x)
--R       + 
--R                             4      4                       6      3
--R         11123272706400cos(y) sin(x)  - 29662060550400cos(y) sin(x)
--R       + 
--R                             8      2                       10
--R         44493090825600cos(y) sin(x)  - 35594472660480cos(y)  sin(x)
--R       + 
--R                             12
--R         11864824220160cos(y)
--R    *
--R             42
--R       tan(z)
--R   + 
--R                           7                      2      6
--R         123591918960sin(x)  - 1730286865440cos(y) sin(x)
--R       + 
--R                             4      5                       6      4
--R         10381721192640cos(y) sin(x)  - 34605737308800cos(y) sin(x)
--R       + 
--R                             8      3                       10      2
--R         69211474617600cos(y) sin(x)  - 83053769541120cos(y)  sin(x)
--R       + 
--R                             12                             14
--R         55369179694080cos(y)  sin(x) - 15819765626880cos(y)
--R    *
--R             39
--R       tan(z)
--R   + 
--R                          8                      2      7
--R         66945622770sin(x)  - 1071129964320cos(y) sin(x)
--R       + 
--R                            4      6                       6      5
--R         7497909750240cos(y) sin(x)  - 29991639000960cos(y) sin(x)
--R       + 
--R                             8      4                        10      3
--R         74979097502400cos(y) sin(x)  - 119966556003840cos(y)  sin(x)
--R       + 
--R                              12      2                       14
--R         119966556003840cos(y)  sin(x)  - 68552317716480cos(y)  sin(x)
--R       + 
--R                             16
--R         17138079429120cos(y)
--R    *
--R             36
--R       tan(z)
--R   + 
--R                          9                     2      8
--R         29753610120sin(x)  - 535564982160cos(y) sin(x)
--R       + 
--R                            4      7                       6      6
--R         4284519857280cos(y) sin(x)  - 19994426000640cos(y) sin(x)
--R       + 
--R                             8      5                        10      4
--R         59983278001920cos(y) sin(x)  - 119966556003840cos(y)  sin(x)
--R       + 
--R                              12      3                        14      2
--R         159955408005120cos(y)  sin(x)  - 137104635432960cos(y)  sin(x)
--R       + 
--R                             16                             18
--R         68552317716480cos(y)  sin(x) - 15233848381440cos(y)
--R    *
--R             33
--R       tan(z)
--R   + 
--R                          10                     2      9
--R         10909657044sin(x)   - 218193140880cos(y) sin(x)
--R       + 
--R                            4      8                       6      7
--R         1963738267920cos(y) sin(x)  - 10473270762240cos(y) sin(x)
--R       + 
--R                             8      6                       10      5
--R         36656447667840cos(y) sin(x)  - 87975474402816cos(y)  sin(x)
--R       + 
--R                              12      4                        14      3
--R         146625790671360cos(y)  sin(x)  - 167572332195840cos(y)  sin(x)
--R       + 
--R                              16      2                       18
--R         125679249146880cos(y)  sin(x)  - 55857444065280cos(y)  sin(x)
--R       + 
--R                             20
--R         11171488813056cos(y)
--R    *
--R             30
--R       tan(z)
--R   + 
--R                         11                    2      10
--R         3305956680sin(x)   - 72731046960cos(y) sin(x)
--R       + 
--R                           4      9                      6      8
--R         727310469600cos(y) sin(x)  - 4363862817600cos(y) sin(x)
--R       + 
--R                             8      7                       10      6
--R         17455451270400cos(y) sin(x)  - 48875263557120cos(y)  sin(x)
--R       + 
--R                             12      5                        14      4
--R         97750527114240cos(y)  sin(x)  - 139643610163200cos(y)  sin(x)
--R       + 
--R                              16      3                       18      2
--R         139643610163200cos(y)  sin(x)  - 93095740108800cos(y)  sin(x)
--R       + 
--R                             20                            22
--R         37238296043520cos(y)  sin(x) - 6770599280640cos(y)
--R    *
--R             27
--R       tan(z)
--R   + 
--R                        12                    2      11
--R         826489170sin(x)   - 19835740080cos(y) sin(x)
--R       + 
--R                           4      10                      6      9
--R         218193140880cos(y) sin(x)   - 1454620939200cos(y) sin(x)
--R       + 
--R                            8      8                       10      7
--R         6545794226400cos(y) sin(x)  - 20946541524480cos(y)  sin(x)
--R       + 
--R                             12      6                       14      5
--R         48875263557120cos(y)  sin(x)  - 83786166097920cos(y)  sin(x)
--R       + 
--R                              16      4                       18      3
--R         104732707622400cos(y)  sin(x)  - 93095740108800cos(y)  sin(x)
--R       + 
--R                             20      2                       22
--R         55857444065280cos(y)  sin(x)  - 20311797841920cos(y)  sin(x)
--R       + 
--R                            24
--R         3385299640320cos(y)
--R    *
--R             24
--R       tan(z)
--R   + 
--R                        13                   2      12
--R         169536240sin(x)   - 4407942240cos(y) sin(x)
--R       + 
--R                          4      11                     6      10
--R         52895306880cos(y) sin(x)   - 387898917120cos(y) sin(x)
--R       + 
--R                            8      9                      10      8
--R         1939494585600cos(y) sin(x)  - 6982180508160cos(y)  sin(x)
--R       + 
--R                             12      7                       14      6
--R         18619148021760cos(y)  sin(x)  - 37238296043520cos(y)  sin(x)
--R       + 
--R                             16      5                       18      4
--R         55857444065280cos(y)  sin(x)  - 62063826739200cos(y)  sin(x)
--R       + 
--R                             20      3                       22      2
--R         49651061391360cos(y)  sin(x)  - 27082397122560cos(y)  sin(x)
--R       + 
--R                            24                            26
--R         9027465707520cos(y)  sin(x) - 1388840878080cos(y)
--R    *
--R             21
--R       tan(z)
--R   + 
--R                       14                  2      13
--R         28256040sin(x)   - 791169120cos(y) sin(x)
--R       + 
--R                          4      12                    6      11
--R         10285198560cos(y) sin(x)   - 82281588480cos(y) sin(x)
--R       + 
--R                           8      10                      10      9
--R         452548736640cos(y) sin(x)   - 1810194946560cos(y)  sin(x)
--R       + 
--R                            12      8                       14      7
--R         5430584839680cos(y)  sin(x)  - 12412765347840cos(y)  sin(x)
--R       + 
--R                             16      6                       18      5
--R         21722339358720cos(y)  sin(x)  - 28963119144960cos(y)  sin(x)
--R       + 
--R                             20      4                       22      3
--R         28963119144960cos(y)  sin(x)  - 21064086650880cos(y)  sin(x)
--R       + 
--R                             24      2                      26
--R         10532043325440cos(y)  sin(x)  - 3240628715520cos(y)  sin(x)
--R       + 
--R                           28
--R         462946959360cos(y)
--R    *
--R             18
--R       tan(z)
--R   + 
--R                      15                  2      14                   4      13
--R         3767472sin(x)   - 113024160cos(y) sin(x)   + 1582338240cos(y) sin(x)
--R       + 
--R                            6      12                    8      11
--R         - 13713598080cos(y) sin(x)   + 82281588480cos(y) sin(x)
--R       + 
--R                             10      10                      12      9
--R         - 362038989312cos(y)  sin(x)   + 1206796631040cos(y)  sin(x)
--R       + 
--R                              14      8                      16      7
--R         - 3103191336960cos(y)  sin(x)  + 6206382673920cos(y)  sin(x)
--R       + 
--R                              18      6                       20      5
--R         - 9654373048320cos(y)  sin(x)  + 11585247657984cos(y)  sin(x)
--R       + 
--R                               22      4                      24      3
--R         - 10532043325440cos(y)  sin(x)  + 7021362216960cos(y)  sin(x)
--R       + 
--R                              26      2                     28
--R         - 3240628715520cos(y)  sin(x)  + 925893918720cos(y)  sin(x)
--R       + 
--R                             30
--R         - 123452522496cos(y)
--R    *
--R             15
--R       tan(z)
--R   + 
--R                     16                 2      15                  4      14
--R         392445sin(x)   - 12558240cos(y) sin(x)   + 188373600cos(y) sin(x)
--R       + 
--R                           6      13                    8      12
--R         - 1758153600cos(y) sin(x)   + 11427998400cos(y) sin(x)
--R       + 
--R                            10      11                     12      10
--R         - 54854392320cos(y)  sin(x)   + 201132771840cos(y)  sin(x)
--R       + 
--R                             14      9                      16      8
--R         - 574665062400cos(y)  sin(x)  + 1292996390400cos(y)  sin(x)
--R       + 
--R                              18      7                      20      6
--R         - 2298660249600cos(y)  sin(x)  + 3218124349440cos(y)  sin(x)
--R       + 
--R                              22      5                      24      4
--R         - 3510681108480cos(y)  sin(x)  + 2925567590400cos(y)  sin(x)
--R       + 
--R                              26      3                     28      2
--R         - 1800349286400cos(y)  sin(x)  + 771578265600cos(y)  sin(x)
--R       + 
--R                             30                          32
--R         - 205754204160cos(y)  sin(x) + 25719275520cos(y)
--R    *
--R             12
--R       tan(z)
--R   + 
--R                    17                2      16                 4      15
--R         30780sin(x)   - 1046520cos(y) sin(x)   + 16744320cos(y) sin(x)
--R       + 
--R                          6      14                   8      13
--R         - 167443200cos(y) sin(x)   + 1172102400cos(y) sin(x)
--R       + 
--R                           10      12                    12      11
--R         - 6094932480cos(y)  sin(x)   + 24379729920cos(y)  sin(x)
--R       + 
--R                            14      10                     16      9
--R         - 76622008320cos(y)  sin(x)   + 191555020800cos(y)  sin(x)
--R       + 
--R                             18      8                     20      7
--R         - 383110041600cos(y)  sin(x)  + 612976066560cos(y)  sin(x)
--R       + 
--R                             22      6                     24      5
--R         - 780151357440cos(y)  sin(x)  + 780151357440cos(y)  sin(x)
--R       + 
--R                             26      4                     28      3
--R         - 600116428800cos(y)  sin(x)  + 342923673600cos(y)  sin(x)
--R       + 
--R                             30      2                    32
--R         - 137169469440cos(y)  sin(x)  + 34292367360cos(y)  sin(x)
--R       + 
--R                           34
--R         - 4034396160cos(y)
--R    *
--R             9
--R       tan(z)
--R   + 
--R                   18              2      17                4      16
--R         1710sin(x)   - 61560cos(y) sin(x)   + 1046520cos(y) sin(x)
--R       + 
--R                         6      15                 8      14
--R         - 11162880cos(y) sin(x)   + 83721600cos(y) sin(x)
--R       + 
--R                          10      13                   12      12
--R         - 468840960cos(y)  sin(x)   + 2031644160cos(y)  sin(x)
--R       + 
--R                           14      11                    16      10
--R         - 6965637120cos(y)  sin(x)   + 19155502080cos(y)  sin(x)
--R       + 
--R                            18      9                    20      8
--R         - 42567782400cos(y)  sin(x)  + 76622008320cos(y)  sin(x)
--R       + 
--R                             22      7                     24      6
--R         - 111450193920cos(y)  sin(x)  + 130025226240cos(y)  sin(x)
--R       + 
--R                             26      5                    28      4
--R         - 120023285760cos(y)  sin(x)  + 85730918400cos(y)  sin(x)
--R       + 
--R                            30      3                    32      2
--R         - 45723156480cos(y)  sin(x)  + 17146183680cos(y)  sin(x)
--R       + 
--R                           34                        36
--R         - 4034396160cos(y)  sin(x) + 448266240cos(y)
--R    *
--R             6
--R       tan(z)
--R   + 
--R                 19             2      18              4      17
--R         60sin(x)   - 2280cos(y) sin(x)   + 41040cos(y) sin(x)
--R       + 
--R                       6      16                8      15
--R         - 465120cos(y) sin(x)   + 3720960cos(y) sin(x)
--R       + 
--R                         10      14                  12      13
--R         - 22325760cos(y)  sin(x)   + 104186880cos(y)  sin(x)
--R       + 
--R                          14      12                   16      11
--R         - 386979840cos(y)  sin(x)   + 1160939520cos(y)  sin(x)
--R       + 
--R                           18      10                   20      9
--R         - 2837852160cos(y)  sin(x)   + 5675704320cos(y)  sin(x)
--R       + 
--R                           22      8                    24      7
--R         - 9287516160cos(y)  sin(x)  + 12383354880cos(y)  sin(x)
--R       + 
--R                            26      6                    28      5
--R         - 13335920640cos(y)  sin(x)  + 11430789120cos(y)  sin(x)
--R       + 
--R                           30      4                   32      3
--R         - 7620526080cos(y)  sin(x)  + 3810263040cos(y)  sin(x)
--R       + 
--R                         34      2                  36                       38
--R       - 1344798720cos(y)  sin(x)  + 298844160cos(y)  sin(x) - 31457280cos(y)
--R    *
--R             3
--R       tan(z)
--R   + 
--R           20           2      19            4      18             6      17
--R     sin(x)   - 40cos(y) sin(x)   + 760cos(y) sin(x)   - 9120cos(y) sin(x)
--R   + 
--R                8      16               10      15                12      14
--R     77520cos(y) sin(x)   - 496128cos(y)  sin(x)   + 2480640cos(y)  sin(x)
--R   + 
--R                    14      13                 16      12
--R     - 9922560cos(y)  sin(x)   + 32248320cos(y)  sin(x)
--R   + 
--R                     18      11                  20      10
--R     - 85995520cos(y)  sin(x)   + 189190144cos(y)  sin(x)
--R   + 
--R                      22      9                  24      8
--R     - 343982080cos(y)  sin(x)  + 515973120cos(y)  sin(x)
--R   + 
--R                      26      7                  28      6
--R     - 635043840cos(y)  sin(x)  + 635043840cos(y)  sin(x)
--R   + 
--R                      30      5                  32      4
--R     - 508035072cos(y)  sin(x)  + 317521920cos(y)  sin(x)
--R   + 
--R                      34      3                 36      2
--R     - 149422080cos(y)  sin(x)  + 49807360cos(y)  sin(x)
--R   + 
--R                     38                      40
--R     - 10485760cos(y)  sin(x) + 1048576cos(y)
--R                                          Type: Factored(Expression(Integer))
--E 48


\end{chunk}
expand$[(1 - c^2)^5 (1 - s^2)^5 (c^2 + s^2)^{10}] => c^{10} s^{10}$

when $c^2 + s^2 = 1$ [modification of a problem due to Richard Liska]
\begin{chunk}{*}
--S 49 of 63
expand((1 - c**2)**5 * (1 - s**2)**5 * (c**2 + s**2)**10)
--R 
--R
--R   (49)
--R       10     8      6      4     2      30
--R     (c   - 5c  + 10c  - 10c  + 5c  - 1)s
--R   + 
--R         12      10       8       6       4      2      28
--R     (10c   - 55c   + 125c  - 150c  + 100c  - 35c  + 5)s
--R   + 
--R         14       12       10        8       6       4       2       26
--R     (45c   - 275c   + 710c   - 1000c  + 825c  - 395c  + 100c  - 10)s
--R   + 
--R             16       14        12        10        8        6       4       2
--R         120c   - 825c   + 2425c   - 3960c   + 3900c  - 2345c  + 825c  - 150c
--R       + 
--R         10
--R    *
--R        24
--R       s
--R   + 
--R             18        16        14         12         10        8        6
--R         210c   - 1650c   + 5550c   - 10450c   + 12055c   - 8735c  + 3900c
--R       + 
--R                4       2
--R         - 1000c  + 125c  - 5
--R    *
--R        22
--R       s
--R   + 
--R             20        18        16         14         12         10         8
--R         252c   - 2310c   + 8970c   - 19470c   + 26060c   - 22253c   + 12055c
--R       + 
--R                6       4      2
--R         - 3960c  + 710c  - 55c  + 1
--R    *
--R        20
--R       s
--R   + 
--R             22        20         18         16         14         12         10
--R         210c   - 2310c   + 10500c   - 26400c   + 40875c   - 40645c   + 26060c
--R       + 
--R                 8        6       4      2
--R         - 10450c  + 2425c  - 275c  + 10c
--R    *
--R        18
--R       s
--R   + 
--R             24        22        20         18         16         14         12
--R         120c   - 1650c   + 8970c   - 26400c   + 47400c   - 54615c   + 40875c
--R       + 
--R                 10        8       6      4
--R         - 19470c   + 5550c  - 825c  + 45c
--R    *
--R        16
--R       s
--R   + 
--R            26       24        22         20         18         16         14
--R         45c   - 825c   + 5550c   - 19470c   + 40875c   - 54615c   + 47400c
--R       + 
--R                 12        10        8       6
--R         - 26400c   + 8970c   - 1650c  + 120c
--R    *
--R        14
--R       s
--R   + 
--R            28       26        24         22         20         18         16
--R         10c   - 275c   + 2425c   - 10450c   + 26060c   - 40645c   + 40875c
--R       + 
--R                 14         12        10       8
--R         - 26400c   + 10500c   - 2310c   + 210c
--R    *
--R        12
--R       s
--R   + 
--R          30      28       26        24         22         20         18
--R         c   - 55c   + 710c   - 3960c   + 12055c   - 22253c   + 26060c
--R       + 
--R                 16        14        12       10
--R         - 19470c   + 8970c   - 2310c   + 252c
--R    *
--R        10
--R       s
--R   + 
--R             30       28        26        24        22         20         18
--R         - 5c   + 125c   - 1000c   + 3900c   - 8735c   + 12055c   - 10450c
--R       + 
--R              16        14       12
--R         5550c   - 1650c   + 210c
--R    *
--R        8
--R       s
--R   + 
--R            30       28       26        24        22        20        18
--R         10c   - 150c   + 825c   - 2345c   + 3900c   - 3960c   + 2425c
--R       + 
--R               16       14
--R         - 825c   + 120c
--R    *
--R        6
--R       s
--R   + 
--R           30       28       26       24        22       20       18      16  4
--R     (- 10c   + 100c   - 395c   + 825c   - 1000c   + 710c   - 275c   + 45c  )s
--R   + 
--R        30      28       26       24       22      20      18  2    30     28
--R     (5c   - 35c   + 100c   - 150c   + 125c   - 55c   + 10c  )s  - c   + 5c
--R   + 
--R          26      24     22    20
--R     - 10c   + 10c   - 5c   + c
--R                                                    Type: Polynomial(Integer)
--E 49

--S 50 of 63
groebner([%, c**2 + s**2 - 1])
--R 
--R
--R           2    2      20     18      16      14     12    10
--R   (50)  [s  + c  - 1,c   - 5c   + 10c   - 10c   + 5c   - c  ]
--R                                              Type: List(Polynomial(Integer))
--E 50

--S 51 of 63
map(factor, %)
--R 
--R
--R           2    2            5 10       5
--R   (51)  [s  + c  - 1,(c - 1) c  (c + 1) ]
--R                                    Type: List(Factored(Polynomial(Integer)))
--E 51

\end{chunk}
$=> (x + y) (x - y) {\textrm\ mod\ } 3$
\begin{chunk}{*}
--S 52 of 63
factor(4*x**2 - 21*x*y + 20*y**2 :: Polynomial(PrimeField(3)))
--R 
--R   There are 22 exposed and 18 unexposed library operations named ** 
--R      having 2 argument(s) but none was determined to be applicable. 
--R      Use HyperDoc Browse, or issue
--R                               )display op **
--R      to learn more about the available operations. Perhaps 
--R      package-calling the operation or using coercions on the arguments
--R      will allow you to apply the operation.
--R 
--R   Cannot find a definition or applicable library operation named ** 
--R      with argument type(s) 
--R                                 Variable(y)
--R                          Polynomial(PrimeField(3))
--R      
--R      Perhaps you should use "@" to indicate the required return type, 
--R      or "$" to specify which version of the function you need.
--E 52

\end{chunk}
$=> 1/4 (x + y) (2 x +  y [-1 + i sqrt(3)]) (2 x + y [-1 - i sqrt(3)])$
\begin{chunk}{*}
--S 53 of 63
factor(x**3 + y**3, [rootOf(isqrt3**2 + 3)])
--R 
--R
--R              - isqrt3 - 1               isqrt3 - 1
--R   (52)  (y + ------------ x)(y + x)(y + ---------- x)
--R                    2                         2
--R                                  Type: Factored(Polynomial(AlgebraicNumber))
--E 53

\end{chunk}
Partial fraction decomposition $=> 3/(x + 2) - 2/(x + 1) + 2/(x + 1)^2$
\begin{chunk}{*}
--S 54 of 63
(x**2 + 2*x + 3)/(x**3 + 4*x**2 + 5*x + 2)
--R 
--R
--R             2
--R            x  + 2x + 3
--R   (53)  -----------------
--R          3     2
--R         x  + 4x  + 5x + 2
--R                                          Type: Fraction(Polynomial(Integer))
--E 54

--S 55 of 63
fullPartialFraction( _
   % :: Fraction UnivariatePolynomial(x, Fraction Integer))
--R 
--R
--R             2         2        3
--R   (54)  - ----- + -------- + -----
--R           x + 1          2   x + 2
--R                   (x + 1)
--RType: FullPartialFractionExpansion(Fraction(Integer),UnivariatePolynomial(x,Fraction(Integer)))
--E 55

\end{chunk}
Noncommutative algebra: note that $(A B C)^{(-1)} = C^{(-1)} B^{(-1)} A^{(-1)}$

$=> A B C A C B - C^{(-1)} B^{(-1)} C B$
\begin{chunk}{*}
--S 56 of 63
A : SquareMatrix(2, Integer)
--R 
--R                                                                   Type: Void
--E 56

--S 57 of 63
B : SquareMatrix(2, Integer)
--R 
--R                                                                   Type: Void
--E 57

--S 58 of 63
C : SquareMatrix(2, Integer)
--R 
--R                                                                   Type: Void
--E 58

--S 59 of 63
(A*B*C - (A*B*C)**(-1)) * A*C*B
--R 
--R 
--R   A is declared as being in SquareMatrix(2,Integer) but has not been 
--R      given a value.
--E 59

\end{chunk}
Jacobi's identity: $[A, B, C] + [B, C, A] + [C, A, B] = 0$ where 
$[A, B, C] = [A, [B, C]]$ and $[A, B] = A B - B A$ 
is the commutator of $A$ and $B$
\begin{chunk}{*}
--S 60 of 63
comm2(A, B) == A * B - B * A
--R 
--R                                                                   Type: Void
--E 60

--S 61 of 63
comm3(A, B, C) == comm2(A, comm2(B, C))
--R 
--R                                                                   Type: Void
--E 61

--S 62 of 63
comm2(A, B)
--R 
--R 
--R   A is declared as being in SquareMatrix(2,Integer) but has not been 
--R      given a value.
--E 62

--S 63 of 63
comm3(A, B, C) + comm3(B, C, A) + comm3(C, A, B)
--R 
--R 
--R   A is declared as being in SquareMatrix(2,Integer) but has not been 
--R      given a value.
--E 63

)spool
 

)lisp (bye)
\end{chunk}
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}
