# GCD in ℤ/pℤ[x]: gcd

### 5.34.13 GCD in ℤ/pℤ[x]: gcd

The gcd command finds the greatest common divisor of two polynomials with coefficients in ℤ/pℤ (for prime p). (See also Section 5.5.1 and Section 5.28.5.)

- gcd takes two arguments:
  P and Q, two polynomials with coefficients in ℤ/pℤ (p must be prime).
- gcd(P,Q) returns the GCD of P and Q computed in ℤ/pℤ[x]

#### Example.

Input:

gcd((2*x^2+5)%13,(5*x^2+2*x-3)%13)

Output:

⎛ ⎝ | 1%13 | ⎞ ⎠ | x+2%13