### Appendix: Polynomial

##### 4. Greatest common divisor

For integers a and b, denote by Div(a, b) the collection of common divisors, which are the natural numbers that divide both a and b. For example, 3 ∈ Div(102, 45) because 102 = 34×3 and 45 = 15× 3.

Starting from a = 102 and b = 45, we carry out the following series of divisions (called euclidean algorithm)

102 = 2×45 + 12,
45 = 3×12 + 9,
12 = 1×9 + 3,
9 = 3×3.

The first equality implies that

102 and 45 are divisible by c45 and 12 are divisible c.

Thus Div(102, 45) = Div(45, 12). In general, it is easy to see that if a = qb + r, then Div(a, b) = Div(b, r). Then the series of divisions tells us

Div(102, 45) = Div(45, 12) = Div(12, 9) = Div(9, 3) = {1, 3},

where the last equality is due to the fact that 9 is a multiple of 3, so that Div(9, 3) consists of divisors of 3.

The biggest number in Div(a, b) is denoted gcd(a, b) and is called the greatest common divisor between a and b. The euclidean algorithm above shows that gcd(102, 45) = 3. Since the algorithm produces smaller and smaller natural numbers, it always stops (say at (a', b')), when one number is an integer multiple of the other (say a' = qb'). Then gcd(a, b) = gcd(a', b') = b'. In particular, we conclude that for integers, the greatest common divisor always exists.

We may introduce similar concepts for polynomials.

The greatest common divisor between two polynomials p(t) and q(t) is a polynomial d(t) = gcd(p(t), q(t)) with the following properties:

• d(t) divides p(t) and q(t).
• c(t) divides p(t) and q(t) ⇒ c(t) divides d(t).

Since polynomials can also be divided, the euclidean algorithm can also be carried out for polynomials. By the same reason, the algorithm produces the greatest common divisor between two polynomials. In particular, this proves the existence of the gcd for polynomials.

Example From this example, we already know

t4 + t3 + 3t2 + t + 1 = (t2 + 2t + 4)(t2 - t + 1) + (3t - 3).

Further computations give us

t2 - t + 1 = (t/3)(3t - 3) + 1,
3t - 3 = (3t - 3) 1.

Thus gcd(t4 + t3 + 3t2 + t + 1, t2 - t + 1) = 1.

If both d1(t) and d2(t) satisfy the conditions for gcd, then d1(t) = u(t)d2(t) and d2(t) = v(t)d1(t) for some polynomials u(t) and v(t). This implies u(t)v(t) = 1, so that both u(t) and v(t) are actually nonzero numbers. Thus we conclude that gcd for polynomials is unique up to a nonzero number multiple.

By tracing the euclidean algorithm between 102 and 45 backwards, we have

3 = 12 - 1×9
= 12 - 1×(45 - 3×12) = (-1)×45 + (1 + 3)times;12
= (-1)×45 + 4×(102 - 2×45) = 4×102 + (-1 -8)×45
= 4×102 - 9×45.

Similarly, from the example above, we have

1 = (t2 - t + 1) - (t/3)(3t - 3)
= (t2 - t + 1) - (t/3)[(t4 + t3 + 3t2 + t + 1) - (t2 + 2t + 4)(t2 - t + 1)]
= (-t/3)(t4 + t3 + 3t2 + t + 1) + [1 + (t/3)(t2 + 2t + 4)](t2 - t + 1)
= [(-1/3)t](t4 + t3 + 3t2 + t + 1) + [(1/3)t3 + (2/3)t2 + (4/3)t + 1](t2 - t + 1).

Such computations can always be carried out in general, and we the following conclusion.

d(t) = gcd(p(t), q(t)) ⇒ d(t) = u(t)p(t) + v(t)q(t) for some polynomials u(t) and v(t).