Question about the dimension of elements in quotient ring Here is the question:
Let $\def\Z{\mathbb Z}\Z[X]$ be the polynomial ring over $\Z$ with variable $X$. Let $f(X) = X^3+X^2+2X+2$. Let $I$ be the ideal of $\Z[X]$ generated by $f(x)$ and $5$. Put $A =\Z[X]/I$.


*

*Find the number of elements $a$ in $A$ such that $a^2=1$

*Find the number of elements $b$ in $A$ such that $b^{18}=1$
I try to use the properties of multiplication and addition on quotient ring and I almost solved the question 1 very straightly by enumeration. Then I find that enumeration is useless for question 2, I wonder whether there is a common solution such that I can analyze the dimensions of the elements in quotient ring and the dimension of the quotient ring especially in the situation that the original ring is infinite ring. Thank you for your help.
 A: Note that $X^3+X^2+2X+2 = (X+1)(X^2+2)$. So we have, by the Chinese reminder theorem:
$$
\Bbb Z_5[X]/(X^3+X^2+2X+2) \cong \Bbb Z_5[X]/(X+1)\times \Bbb Z_5[X]/(X^2+2)
$$
We can find the number of solutions to $a^2 = 1$ and $b^{18} = 1$ in each of those separately. This is helpful because each of those two factors in the product to the right are fields (one is isomorphic to $\Bbb F_5 = \Bbb Z_5$, and the other one is $\Bbb F_{25}$).
For $a^2 = 1$, which becomes $(a+1)(a-1) = 0$. Using that fields are integral domains (a product is $0$ iff one of the factors is zero) we see that $(\pm 1, \pm1)$ (where the two $\pm$ are independent) are the only four solutions. These correspond to $\pm 1$ and $\pm(X^2 + 3)$ in the original ring.
$b^{18} = 1$ is a bit more tricky. Let's take $\Bbb Z_5[X]/(X+1)$ first. By Fermat's little theorem, $b^{18} = b^2$, so the same two solutions as above are the only two solutions.
For $\Bbb Z_5[X]/(X^2+2)$, the corresponding version of Fermat's little theorem says that as long as $b\neq 0$ (and $0$ isn't a solution anyways, so we don't lose anything by assuming this), we have $b^{24} = 1$. If we want to have $b^{18} = 1$, then this implies that we also need $b^6 = 1$. Thus we get
$$
0 = b^6-1 = (b^3-1)(b^3+1)\\
= (b-1)(b^2+b+1)(b+1)(b^2-b+1)
$$
We are interested in just finding the number of solutions to $b^6-1 = 0$, and there is theory which lets us do that rather quickly. I have done the actual calculation too, and you may skip to that if there is too much unfamiliar theory here.
$\Bbb Z_5[X]/(X^2+2)$ is a quadratic extension of the finite field $\Bbb Z_5$, and it must therefore contain the roots of any quadratic polynomial, including $b^2\pm b+1$. We know that there cannot be repeated roots because $b^6-1$ and its derivative $b^5$ are coprime polynomials. Thus there are six distinct solutions.
So that means $b^6 = 1$ has six solutions in $\Bbb Z_5[X]/(X^2+2)$. Combined with the two solutions from $\Bbb Z_5[X]/(X+1)$, this gives $2\cdot 6 = 12$ solutions in our original ring.

Solving $b^6 = 1$: We see $b\pm 1$ in the factorisation above, so $b = \pm 1$ are two solutions. As for the other two factors, the quadratic equation works just as well here as it does for real numbers (only we have to remember we're working in a finite field, so division and square roots work a little differently):
$$
b^2+b+1 = 0\implies b = \frac{-1\pm\sqrt{1-4}}{2} = 2\pm 3\sqrt{2}
$$
Now we just need to find $\sqrt2$. By definition, we have
$$
X^2+2 = 0\\
X^2 = 3\\
4X^2 = 2\\
(2X)^2 = 2
$$
so $\sqrt2 = 2X$ (or, more precisely, $\pm\sqrt2$ represents the same two elements as $\pm2X$; we haven't decided on a square root convention, and we don't need to). Thus we have
$$
b = 2\pm3\cdot 2X = 2\pm X
$$
These are the solutions to $b^2+b+1 = 0$. Now note that $b^2-b+1 = 0$ necessarily has the same solutions with opposite sign: $b = 3\pm X$.
So, going back to our original ring, we saw that the four solutions from before, $\pm 1$ and $\pm(X^2+3)$ work. The other $8$ solutions are given by
$$
\begin{array}{|c|c|c|c|}\hline
\Bbb Z_5[X]/(X+1)&\Bbb Z_5[X]/(X^2+2)&&\Bbb Z_5[X]/(f(X))\\
\hline 1&2+X&&X+2\\
1&2-X&&X^2-X-1\\
1&3+X&&3X^2+X-1\\
1&3-X&&-X^2-X + 1\\\hline
\end{array}
$$
and their negatives.
