Irreducibility of polynomials in ring In text book "A course in abstract algebra" by author Khanna & bhambri" it  is given that,
f(x) = 2( x^2) + 2  is irreducible polynomial over Z. 
Because they used the definition "let R be an Integral domain with unity then a polynomial f(x) in R[x] of positive degree (i.e. deg ≥ 1) is said to be  irreducible polynomial over R if it can not be expressed as product of two polynomials of positive degree. In other words, if whenever f(x) = g(x)• h(x) 
Then deg g = 0 or deg h = 0.
Here f(x) = 2(x^2) + 2 = 2(x^2 + 1) 
Clearly deg g = deg(2) = 0. 
So f(x) is irreducible polynomial over Z by above definition. 
But in book "Contemporary abstract algebra" by "Joseph A. Gallian", they used the definition,
"Let D be an integral domain. A polynomial f(x) in D[x] that is neither a zero polynomial nor unit in D[x] is said to be irreducible over D if, whenever 
f(x) = g(x) • h(x) with, g(x) & h(x) from D[x], then g(x) OR h(x) is unit in D[x]."
Now here f(x) = 2(x^2) + 2 = 2( x^2 + 1)
Clearly neither 2 nor x^2 + 1 in Z[x] are unit. So that f(x) is reducible by definition of book by "Joseph A. Gallian".
So one book says, it is irreducible over Z but other says it is reducible over Z.
Please suggest me which one I should prefer? .
 A: To dramatize the flaw in the definition given in the text by "Khanna & Bhambri" (K &B), consider the polynomials
$$x,\;2x,\;3x,\;6x$$
By K&B's definition, the above polynomials are all irreducible in $\mathbb{Z}[x]$. Moreover, since none of them is a unit factor times one of the others, they would be regarded as distinct irreducibles (i.e., none is an "associate" of any of the others).

But then the polynomial $6x^2$ factors in $\mathbb{Z}[x]$ in two different ways
$$6x^2 = (2x)(3x)\qquad\text{and}\qquad 6x^2 = (x)(6x)$$
as a product of irreducible elements, thus breaking "unique factorization".

As I mentioned in my prior comment, it appears that the K&B text (perhaps accidentally) conflated irreducibility in $\mathbb{Z}[x]$ with irreducibility in $\mathbb{Q}[x]$.

I would regard it as an error, and use the standard definition instead (e.g., Gallian's definition), but check to make sure your teacher agrees.

In any case, good catch!
A: I think Gallian's definition is the more standard definition for the general definition of irreducible.  One typically defines a non-zero non-unit $a\in R$ to be irreducible if $a=bc$ implies $(a)=(b)$ or $(a)=(c)$.  Things are a bit more complicated if the ring has zero-divisors.  
This definition means $2(x^2+1)$ is not irreducible since it factors into $2\cdot (x^2+1)$ and $2(x^2+1) \subsetneq (2)$ and $2(x^2+1) \subsetneq (x^2+1)$.  You see though that if you are looking at polynomials over a field, the definitions coincide since any non-zero, degree $0$ polynomial would be a unit and $(a)=(\lambda a)$ for any unit $\lambda$ and any element $a \in R$.
I should elaborate on why this definition is the same as Gallian's in $D[X]$ where $D$ is a domain.  If suppose $f$ is irreducible and $f=gh$.  Then suppose WLOG, $(f)=(g)$  This means $g=fd$ for some polynomial $d$.  But then $f=(fd)h$, cancellation (since $D[X]$ is a domain if and only if $D$ is) implies $dh=1$ so $h$ is  unit.  Clearly the converse holds.  If $f=gh$ implies $g$ or $h$ is a unit, then $(f)=(h)$ or $(f)=(g)$, respectively.
