# The ring $\Bbb Z_p[\sqrt{d}]$ and its invertible elements

Let $\Bbb Z_p[\sqrt{d}] = \{a + b\sqrt{d} : a,b \in \Bbb Z_p\}$, where $p$ is a prime and $d$ and $p$ are coprime.. I wish to show that if $d$ is not a quadratic residue modulo $p$, then $|\Bbb Z_p[\sqrt{d}]^\times| = p^2 - 1$. That is to say, the number of units in the multiplicative group $\Bbb Z_p[\sqrt{d}]^\times$ is $p^2-1$.

I was given a hint to use the norm, defined as $N(a+b\sqrt{d}) = a^2-db^2 \in \Bbb Z_p$.

In our ring, we have $p$ choices of $a$ and $p$ choices of $b$. I think that it is the case that my thought was that if I were to find all the solutions that satisfy $a^2-db^2 \equiv 0 \bmod p$, then I'd find all the elements that clearly are not invertible (so everything else is). I think I've worked out that $a=b=0$ is the only such case, since if $d$ is not a square, $db^2$ is not a square either and so $a^2 \equiv db^2 \mod p$ has no non-trivial solution. Which leaves all the other $p^2 - 1$ choices of a and b to use.

My first question is (assuming my reasoning for the above is in fact correct), why is it the case that I am able to reason about $\Bbb Z_p[\sqrt{d}]^\times$ using the norm and $\Bbb Z_p$?

My second question is, how do I then show that $\Bbb Z_p[\sqrt{d}]^\times$ is a cyclic group? I feel like I may use/adapt the proof that $\Bbb Z_p^\times$ is cyclic as a starting point, but I'm not still quite sure about how I can show that I may generate everything in that group from a primitive root just yet.

$\mathbb{F}_p[\sqrt{d}]$ is a field extension of degree $2$ of $\mathbb{F}_p$, hence this field has $p^2$ elements. The multiplicative group of a finite field is well-known to be cyclic, here it has order $p^2-1$.