a)
\(x^4+1996x^2+1995x+1996\)
\(=\left(x^4-x\right)+\left(1996x^2+1996x+1996\right)\)
\(=x\left(x^3-1\right)+1996\left(x^2+x+1\right)\)
\(=x\left(x-1\right)\left(x^2+x+1\right)+1996\left(x^2+x+1\right)\)
\(=\left(x^2+x+1\right)\left[x\left(x-1\right)+1996\right]\)
\(=\left(x^2+x+1\right)\left(x^2-x+1996\right)\)
b)
\(x^4+1997x^2+1996x+1997\)
\(=\left(x^4-x\right)+\left(1997x^2+1997x+1997\right)\)
\(=x\left(x^3-1\right)+1997\left(x^2+x+1\right)\)
\(=x\left(x-1\right)\left(x^2+x+1\right)+1997\left(x^2+x+1\right)\)
\(=\left(x^2+x+1\right)\left[x\left(x-1\right)+1997\right]\)
\(=\left(x^2+x+1\right)\left(x^2-x+1997\right)\)