LCM of two polynomials: lcm

### 6.28.8 LCM of two polynomials: lcm

The lcm command computes the LCM (Least Common Multiple) of polynomials. (See 6.5.3 for LCM of integers).

- lcm takes an unspecified number of arguments:
  polys, a sequence or list of polynomials.
- lcm(polys) returns the least common multiple of the polynomials in polys.

Examples.

- Input:
  lcm(x^2+2*x+1,x^2-1)
  Output:

  | ⎛ ⎝ | x+1 | ⎞ ⎠ | ⎛ ⎝ | x2−1 | ⎞ ⎠

- Input:
  lcm(x,x^2+2*x+1,x^2-1)
  or:
  lcm([x,x^2+2*x+1,x^2-1])
  Output:

  | ⎛ ⎝ | x2+x | ⎞ ⎠ | ⎛ ⎝ | x2−1 | ⎞ ⎠