Re: gcd






Yes, Maxima has a greatest common divisor function. Here are
a few examples; for more information, see the user-documentation.
(C1) gcd((x+5)*(x-3),(x+5)*(x^2+1),x);
(D1) x + 5
(C2) gcd(x^2-3,x-sqrt(3),x);
(D2) 1
(C3) gcd(x^2-3,x-sqrt(3),x),algebraic : true;
(D3) x - SQRT(3)
(C4) describe("gcd");

0: EZGCD :(maxima.info)Definitions for Polynomials.
1: GCD :Definitions for Polynomials.
2: GCDEX :Definitions for Polynomials.
Enter n, all, none, or multiple choices eg 1 3 : 1;
Info from file /usr/local/info/maxima.info:
- Function: GCD (p1, p2, var1, ...)
computes the greatest common divisor of p1 and p2. The flag
GCD[SPMOD] determines which algorithm is employed. Setting GCD to ....

You'll discover that there are various algorithms for computing
the gcd; I don't have any advice on which one to use.

The ?gcd function (a Common Lisp function) only works on
integers; for the gcd of polynomimals, use the gcd function.

Barton