For the first one : first, notice that are all the squares in . The squares of , by Euler's criterion, are the roots of the polynomial . Therefore, since is a unique factorization domain, we can factor this polynomial as :
Equating the constant terms, you get the theorem.
The second one is exactly the same.