Polynomial division in $\mathbb{Z}_5[x]$

69 Views Asked by At

Before my exam I will just test my skills in division algorithm. I found an exercise in my textbook, so here it is:

"Find polynomials $q(x)$ and $r(x)$ such that $f(x)=g(x)q(x)+r(x)$, and $r(x)=0$ or $\deg r(x)<\deg g(x)$:

(c): $f(x)=2x^4+x^2-x+1$ and $g(x)=2x-1$ in $\mathbb{Z}_5[x]$"

My situation is that I can do polynomials division without any problem, but my biggest problem is that we are working in $\mathbb{Z}_5[x]$ and not $\mathbb{Q}$ and therefore my steps by doing the division algorithm would give me fractions which is not in $\mathbb{Z}_5[x]$.

My question is, that when I reach my final step:

$f(x)=g(x)q(x)+r(x)$

$=\left(x^3+\frac{1}{2}x^2+\frac{3}{4}x-\frac{1}{8}\right)\cdot (2x-1)+\frac{7}{8}$

And the solution in the textbook is: $q(x)=x^3+3x^2+2x+3$ and $r(x)=4$ I know my answer is correct if I take all the fractions $\mod 5$ like $\frac{1}{2}x^2=3x^2$ would it be correct to do it this way? If not, what method should I use?

Thanks