# Polynomial greatest common divisor (polynomial_gcd)

Greatest common divisor of two polynomials.

## How to write it

### polynomial_gcd(p, q)

**p**

A polynomial. Takes a polynomial.

**q**

A polynomial. Takes a polynomial.

## Examples

- $\displaystyle \gcd(x^{2}-1, x-1) = x-1$

  `polynomial_gcd(x^2 - 1, x - 1)`

  In the solver, `polynomial_gcd(x^2 - 1, x - 1)` gives `x - 1`.

  [Open in the solver](https://hilberon.com/?q=polynomial_gcd%28x%5E2%20-%201%2C%20x%20-%201%29)

## Related functions

- [polynomial_lcm](https://hilberon.com/library/polynomial_lcm)

  Least common multiple of two polynomials.
- [polynomial_quotient](https://hilberon.com/library/polynomial_quotient)

  Quotient of a polynomial division.
- [polynomial_remainder](https://hilberon.com/library/polynomial_remainder)

  Remainder of a polynomial division.
- [minimal_polynomial](https://hilberon.com/library/minimal_polynomial)

  Minimal polynomial of an algebraic number over the rationals.
- [numerator](https://hilberon.com/library/numerator)

  Numerator of a fraction.
- [nc_multiply](https://hilberon.com/library/nc_multiply)

  The noncommutative product: multiplies quaternions in order, and anything else stays as written.

---
Source: https://hilberon.com/library/polynomial_gcd
