TAOCP 4.6 Exercise 1

In polynomial arithmetic modulo $10$, coefficients are reduced modulo $10$ after each operation.

Section 4.6: Polynomial Arithmetic

Exercise 1. [10] If we are doing polynomial arithmetic modulo 10, what is $7x + 2$ minus $x^2 + 5$? What is $6x^2 + x + 3$ times $5x^2 + 2$?

Verified: yes
Solve time: 1m54s


In polynomial arithmetic modulo $10$, coefficients are reduced modulo $10$ after each operation. Thus

$$ (7x+2)-(x^2+5) =-x^2+7x-3. $$

Since $-1\equiv 9\pmod{10}$ and $-3\equiv 7\pmod{10}$,

$$ (7x+2)-(x^2+5)=9x^2+7x+7. $$

For the product,

$$ (6x^2+x+3)(5x^2+2) =30x^4+5x^3+27x^2+2x+6. $$

Reducing each coefficient modulo $10$ gives

$$ 30\equiv0,\qquad 27\equiv7 \pmod{10}, $$

hence

$$ (6x^2+x+3)(5x^2+2)=5x^3+7x^2+2x+6. $$

Therefore

$$ \boxed{(7x+2)-(x^2+5)=9x^2+7x+7,} $$

and

$$ \boxed{(6x^2+x+3)(5x^2+2)=5x^3+7x^2+2x+6.} $$