> Is there a built-in greatest-common-divisor function in Maxima?
Yes, gcd(a,b). I recommend setting the option gcd:'spmod.
gcd works for integers, e.g. gcd(12,9)=>3 and also polynomials, e.g.
gcd(x^4+2*x^3-2*x^2+2*x-3,x^6-x^5+x^4-2*x^3+x^2-x+1) => x^3-x^2+x-1, and
gcd(-y^2*z+x^2*z-y^3-x*y^2+x^2*y+x^3,y*z-x*z-x*y+x^2) => y-x.
A little more obscurely, it also works for rational numbers:
gcd(77/120,14/45)=>7/360. Note that it does *not* work for general
expressions. You might think that gcd(6^n,9^n) should return 3^n
(actually this is only correct for n>=0), but in fact it returns 1.
Similarly, gcd(x^a-1,x-1)=>1.
-s