Let R be any ufd. The content of a polynomial p(x) in R[x] is the greatest common divisor of its coefficients. A primitive polynomial has content 1.
The product of two primitive polynomials is primitive. If q prime divides the content of a(x)*b(x), let ai and bj be the first coefficients in a and b respectively that are not divisible by q. The coefficient i+j in the product is not divisible by q. This holds for all q, hence the product has content 1.
Factor out the contents of two polynomials to derive the corollary: content(a*b) = content(a)*content(b).
The concept of a primitive polynomial generalizes to rings that are not ufds. The polynomial p(x) is primitive if its coefficients generate the entire ring. The product f*g is primitive iff f and g are primitive. If f*g is not primitive, embed its coefficients in a maximal ideal H, then reduce R mod H, giving a field. The corresponding polynomials over R/H form an integral domain. The product f*g = 0, so either f or g is 0, and its coefficients lie in H. Conversely, if the coefficients of f lie in H, so must the coefficients of f*g.
All these results hold for polynomials in multiple indeterminants.
Let R be a ufd and let F be the fraction field of R. For example, if R is the integers, F is the rationals. If p(x) primitive is reducible in R[x] it is certainly reducible in F[x]. Conversely, if p(x) is reducible in F[x], write p(x) = a(x)*b(x). Multiply through by all denominators, being units, and the equation lies in R[x]. Recall that content(a*b) = content(a)*content(b). Divide through by these contents. Now the product of the primitive polynomials a and b must be the primitive polynomial p. Thus primitive polynomials are irreducible in R[x] iff they are irreducible in F[x]. (This fails when R is not a ufd; click here for an example.)
Now factor p(x) in R[x], starting with the content, which lies in R and factors uniquely. All other factors are irreducible in F[x], and must be unique.
Applying Gauss' lemma twice, R[x][y] is a ufd. Keep adjoining indeterminants, as many as you like, and by induction the result is always a ufd. Thus Z[x,y,z] is a ufd. This is not a pid, since the ideal generated by x and y is not principal. Every pid is a ufd, but not the converse. Similarly, every ufd is a factorization domain by definition, but there are factorization domains that are not ufds. This was illustrated by adjoining sqrt(-5) to the integers.
When two polynomials are multiplied together, the product of their highest terms, largest degree and largest indeterminants, is nonzero, hence S is an integral domain.
Suppose a polynomial p factors two ways in S. These factorizations use a finite number of indeterminants, which contradicts the fact that R[x1,x2,…xn] is a ufd. Therefore all of S is a ufd.
Bring in the indeterminants one at a time and build an ascending chain of ideals. The first is generated by x1, the second by x1 and x2, the third by x1 x2 and x3, and so on. At the same time, we can build a complementary chain of descending ideals. Let the first ideal be generated by all indeterminants except x1. The second is generated by all indeterminants except x1 and x2, and so on.
So, if you're at a party, and the question comes up, "Is there a ufd that is neither noetherian nor artinian?", you can say yes.
Consider the polynomial 3x3 - 2x2 + 12x - 8. A rational root has numerator 1 2 4 or 8, and denominator 1 or 3. And of course the root could be negative. In this case the only rational root is 2/3. The other roots are ±2i.
Let p = u2-3uv+7v-1. When factoring p, we may view it as a polynomial in u, with coefficients taken from the ufd Z[v]. The lead coefficient is 1, and the constant coefficient is 7v-1. If q is a factor of p its lead coefficient is 1 and its constant coefficient divides 7v-1, which is prime in Z[v]. Thus p is the product of u±1 times u±(7v-1). This produces the term ±7uv, which cannot equal -3uv, hence p is irreducible.
Yet p does have rational solutions, lots of them. Set u to any rational number and solve for v. If we're lucky, and 3u-7 divides u2-1, u and v can be integers. Examples include ±1,0 and 5,3.
If we are given a 2 variable polynomial where each term has the same degree d, divide through by vd, and let r = u/v. The result is a polynomial in r, which must obtain a rational root. The numerator of R divides the constant term, which was the coefficient on vd. Similarly the denominator is drawn from the coefficient on ud. In other words, v divides the coefficient of ud and u divides the coefficient of vd. Consider p = u2 - uv - 2v2. The only nonzero coprime solutions are 2,1 and 1,-1.
Try to factor the polynomial x2+y2-z2. The only possible notrivial factor is x±y±z, and whenever you multiply two of these factors together, mixed terms remain. It is not possible to cancel them out, the way we did with (x+y)×(x-y) = x2-y2. Therefore x2+y2-z2 is irreducible. Yet it has infinitely many integer solutions, namely the pythagorean triples.