By definition:
An integral domain $R$ is a unique factorization domain if the following conditions are satisfied:
- Every element $a \in R$, $a \neq 0$ that is not a unit can be factored into a product $a = c_1 \cdots c_n$ where $c_1,\dots,c_n \in R$ are irreducible elements.
- If $c_1,\dots,c_n$ and $d_1,\dots,d_m$ are two factorizations of the same element of $R$ into irreducibles, then $n = m$ and $d_j$ can be renumbered so that $c_i$ and $d_i$ are associates.
I need to prove that every element $a \in R$, $a \neq 0$ which is not a unit can be written uniquely as: \begin{equation} a = up_1^{e_1} \cdots p_s^{e_s} \end{equation} where $u \in R$ is a unit, $p_1,\dots,p_s \in R$ are irreducible elements mutually not associate and $e_1,\dots,e_s \in \mathbb{N} \setminus \{0\}$. I think I need to start with an arbitrary factorization $a = c_1 \cdots c_n$, then use the following result, but honestly I don't know how to put it formally.
Let $R$ be an integral domain and let $a,b \in R$. If $a$ and $b$ are associate elements, then $a,b \neq 0$ and $a = b \cdot u$ for some unit $u \in R$.