lcm(a, b); /* a and b may be integers or polynomials */ /* In Maxima the gcd of two integers is always positive, and a * b = gcd(a, b) * lcm(a, b), so the lcm may be negative. To get a positive lcm, simply do */ abs(lcm(a, b))