unique factorization implies prime divisor property let $R=\mathbb{Z}[\sqrt(d)]$. How can I show that if $R$ has unique factorization $\implies$ every irreducible in $R$ is prime.  
I know prime means $p|ab \implies p|a$ or $p|b$ 
reducible means $x=ab$ for $a,b,x \in R$ given that $x$ is nonzero and nonunit.
unique factorization means $x=a_1\cdot\cdot\cdot a_n=b_1\cdot\cdot\cdot b_m$ up to relabeling and units
but I don't know how to put everything together.
 A: Unique factorization means unique factorization into prime elements? Or irreducible elements?

Suppose we have unique factorization into prime elements. Let $r$ be any irreducible. It has a factorization into primes $r = p_1 \ldots p_n$. But since $r$ is irreducible, $n=1$, hence $r = p_1$, hence $r$ is prime.
By the way, this doesn't use at all what the specific integral domain is. And it doesn't use the uniqueness.

Suppose we have unique factorization into irreducible elements. Seeking a contradiction, suppose we have an irreducible that is not prime. Call it $r$. So There are $a,b$ such that $r$ divides $ab$ but $r$ does not divide $a$ and $r$ does not divide $b$. Consider the unique factorization of $a$ and $b$:
$$
a = r_1 \cdots r_m \quad \quad b = q_1 \cdots q_n.
$$ 
Since $r$ does not divide $a$ and does not divide $b$:
(A) None of the irreducibles $r_i$, $q_j$ can be $r$ (even up to multiplication by units).
Then 
$$
ab = r_1 \cdots r_m q_1 \cdots q_n
$$
This is the unique factorization of $ab$. Remember that $r$ divides $ab$. So $ab = rk$, for some $k$. Factor $k$ into irreducibles:
$$
k = s_1 \ldots s_h.
$$
Then 
$$
ab = rs_1 \ldots s_h
$$
So we have two factorizations of $ab$:
$$
ab = rs_1 \ldots s_h = r_1 \cdots r_m q_1 \ldots r_n
$$
By uniqueness of factorization: 
(B) $r$ must be one of the $r_i$'s or $q_j$'s (up to units). 
(A) contradicts (B)
Proof complete.
