Show that the set $\mathbb{Q}(\sqrt{p})=\{a+b\sqrt{p}; a,b,p\in\mathbb{Q},\sqrt{p}\notin \mathbb{Q}\}$ is a field Show that the set $\mathbb{Q}(\sqrt{p})=\{a+b\sqrt{p}; a,b,p\in\mathbb{Q},\sqrt{p}\notin \mathbb{Q}\}$ is a field
I am having a little trouble proving that for each non-zero $b\in\mathbb{Q}(\sqrt{p})$, there is $d\in\mathbb{Q}$ such that $b\cdot d=1$.
My attempt:
Let $b=a_1+b_1\sqrt{p}$
Let $d=a_2+b_2\sqrt{p}$
We want $$b\cdot d=(a_1+b_1\sqrt{p})(a_2+b_2\sqrt{p})$$
$$=a_1a_2+a_1b_2\sqrt{p}+a_2b_1\sqrt{p}+b_1b_2p$$
$$=(a_1a_2+b_1b_2p)+(a_1b_2+a_2b_1)\sqrt{p}$$
$$=1$$
Am I following the right approach? What should be my next step
 A: Next step: choose $a_2, b_2$ so that the following two linear equations are satisfied:
$$a_1a_2+b_1b_2p=1$$
$$a_1b_2+b_1a_2=0$$
Keep in mind that $a_1, b_1$ are constants.
In more standard linear-algebraic terms, you want to solve $$\left(\begin{matrix}a_1 & b_1p\\b_1& a_1\end{matrix}\right)\left(\begin{matrix} a_2\\b_2\end{matrix}\right)=\left(\begin{matrix} 1\\0\end{matrix}\right)$$
This should have a solution unless the determinant $a_1^2-b_1^2p$ is zero; but this only happens if $a_1^2=b_1^2p$, or $p=\frac{a_1^2}{b_1^2}$, which is impossible as $\sqrt{p}$ is not in $\mathbb{Q}$.
A: If $R$ is a PID, and $x \in R$ is irreducible, then $(x)$ is a maximal ideal. This is because if $(x) \subset I$ and $I$ is an ideal, then there is $y \in R$ such that $I=(y)$. This gives a $c$ such that $x=cy$, so $c \in R^*$ or $y \in R^*$. In the first case we have $(x)=(y)=I$, in the second case we have $(y)=R$. 
Now $\mathbb{Q}[X]$ is a PID, and $X^2-p$ is irreducible so $(X^2-p)$ is a maximal ideal, so
$$\frac{\mathbb{Q}[X]}{(X^2-p)} \cong \mathbb{Q}(\sqrt p)$$
is a field.
A: For a different take using linear algebra, prove that
$$
a+b\sqrt{p}
\mapsto
\pmatrix{a & bp\\b& a}
$$
is an injective ring homomorphism $\mathbb{Q}(\sqrt{p}) \to \mathbb{Q}^{2\times 2}$, the ring of $2\times 2$ matrices with rational coefficients.
This reduces finding inverses in $\mathbb{Q}(\sqrt{p})$ to inverting matrices.
The homomorphism above is induced by the map $x \mapsto (a+b\sqrt{p})x$ using the basis $1, \sqrt{p}$.
A: I think there is a pretty easy way, based on the simple algebraic identity
$x^2 - y^2 = (x + y)(x - y), \tag 0$
viz.:
Suppose first that $b = 0$; then
$(a + b\sqrt p)^{-1} = a^{-1} \in \Bbb Q \subset \Bbb Q(\sqrt p), \tag 1$
and we are done.
If $b \ne 0$, then $0 \ne a + b\sqrt p \in \Bbb Q(\sqrt p)$, lest $\sqrt p = -(a/b) \in \Bbb Q$, and we note that $a^2 - b^2p \ne 0$, since otherwise we would have
$p = \dfrac{a^2}{b^2}, \tag 2$
whence
$\sqrt p \in \{\pm \dfrac{a}{b} \} \subset \Bbb Q, \tag 3$
also not happening by hypothesis.  Bearing (0) in mind, we note that
$a^2 - b^2 p = (a + b\sqrt p)(a - b\sqrt p), \tag 4$
so
$(a + b\sqrt p)(\dfrac{a - b\sqrt p}{a^2 - b^2p}) = \dfrac{(a + b\sqrt p)(a - b\sqrt p)}{a^2 - b^2p} = \dfrac{a^2 - b^2p}{a^2 - b^2p} = 1; \tag 5$
thus every $a + b\sqrt p \in \Bbb Q(\sqrt p)$ has a multiplicative inverse:
$(a + b\sqrt p)^{-1} = \dfrac{a - b\sqrt p}{a^2 - b^2p}. \tag 6$
Similar algebraic maneuvers occur when dealing with complex numbers, where, if $a + bi \in \Bbb C = \Bbb R[i]$, 
$(a + bi)^{-1} = \dfrac{a - bi}{(a + bi)(a - bi)} = \dfrac{a - bi}{a^2 + b^2}. \tag 7$
A: 
"Am I following the right approach?"

Yes, but you are doing it the hard way.

"What should be my next step"

You should notice that since $\sqrt p$ is irrational that means $(a_1b_2+a_2b_1)$ must be equal to $0$.
But that's the hard way:
Here's the easy way:
I am NOT going to use your notation $b = a_1 + b_1\sqrt{p}$ ($b$ is a bad choice of variable).  I will use $\alpha = a + b\sqrt{p}$.  $a$ and $b$ are both rational and as $\alpha \ne 0$, $a$ and $b$ are not both equal to $0$.
$(a + b\sqrt{p})*\beta = 1$
$\beta = \frac 1{a+b\sqrt{p}}$
$= \frac 1{a+b\sqrt{p}}*\frac {a-b\sqrt{p}}{a-b\sqrt{p}}$
$=\frac {a-b\sqrt{p}}{a^2 -b^2p}= \frac {a}{a^2 - b^2p} - \frac {b}{a^2 - b^2p}\sqrt{p}$
$\beta \in \mathbb Q$ because $\frac {a}{a^2 - b^2p}$ and $- \frac {b}{a^2 - b^2p}$ are rational.
.....
Okay, I had a flash of insight that comes from experience that $(a+b)(a-b) = a^2 - b^2$ is the standard way to remove radicals in denominators.
What if I hadn't had that insight?

Let's go back to your method...

Again I will not use your notation $d = a_2 + b_b\sqrt{p}$.  I will use $\beta = c + d\sqrt{p}$ where $c,d \in \mathbb Q$.
If $(a + b\sqrt{p})$ has an unique inverse then $(a+b\sqrt{p})(c+d\sqrt{p}) = 1$ will have a unique solution for $c,d \in \mathbb Q$. Does it?
Let $c,d\in \mathbb Q$ and 
$(a + b\sqrt{p})(c + d\sqrt{p}) = ac + bc\sqrt p + ad \sqrt p + bdp$
$= ac+ bdp + (bc +ad)\sqrt p = 1$.
Since $\sqrt p$ is not rational then $q + r*\sqrt p$ is not rational for any  rational $q, r$  $r = 0$.  But the above equation is equal to $1$ which is of course rational.
So that means $bc + ad=0$.
And so  $ac + bdp = 1$.
$2$ equations; $2$ unknowns ($c,d$).  
Let's do it:
All right $bc = -ad$ and $c = \frac {-ad}b$.  (This assumes $b \ne 0$.  But that's okay.  $b = 0$ means $a + b\sqrt p = a$ and $a^{-1} =\frac 1a$).
[And as $a + b\sqrt \ne 0$ is not the case that both $a$ and $b$ equal $0$]
So $\frac {-a^2d}b + bdp = 1$
$d(bp-\frac {a^2}b) = 1$
$d = \frac 1{bp-\frac {a^2}b} = \frac b{b^2p - a^2}$
$c =\frac {-ab}{b(b^2p - a^2)}= \frac {-a}{b^2p - a^2}$
These are unique solutions so
so $(a+b\sqrt p)^{-1}= c + d\sqrt p = \frac {-a+ b\sqrt p}{b^2p - a^2}= \frac {a - b\sqrt p}{a^2 - b^2 p}$
A: Let $r + q \sqrt{p}\ne 0$ be in $\mathbb Q[\sqrt p]$.  In other words $r,q\in \mathbb Q$ and it isn't the case that $r = q = 0$.
Show that there is a unique $u + v\sqrt{p} \in \mathbb Q[\sqrt p]$ (i.e. $u, v \in \mathbb Q$) so that $(r+q\sqrt{p})(u+v\sqrt{p} ) = 1$.
Method 1:
$(r+q\sqrt{p})x = 1 \implies$
$x = \frac 1{r+q\sqrt{p}}$
$=\frac 1{r+q\sqrt{p}}\frac {r-q\sqrt{p}}{r-q\sqrt{p}}$
$= \frac r{r^2 - q^2p} - \frac q{r^2-q^2p}\sqrt{p}$ which is a unique solution in $\mathbb Q[\sqrt p]$.
Method 2:
$(r + q\sqrt p)(u + v\sqrt p) = 1$
$(ru + qvp)+(rv + qu)\sqrt{p} = 1$.
$ru+qvp\in \mathbb Q$ and $rv + qu \in \mathbb Q$ and $1 \in \mathbb Q$ but $\sqrt{p} \not \in \mathbb Q$.
So $rv + qu = 0$.
So $ru + qvp = 1$
2 equations; 2 unknowns.
$u= \frac r{r^2 - q^2p}$
$v= -\frac q{r^2 - q^2p}$
So $\frac r{r^2 - q^2p} -\frac q{r^2 - q^2p}\sqrt p$ a unique solution.
