\(x^4+2017x^2+2016x+2017\)
\(=\left(x^4+x^2+1\right)+2016\left(x^2+x+1\right)\)
\(=\left(x^4+2x^2+1-x^2\right)+2016\left(x^2+x+1\right)\)
\(=\left[\left(x^2+1\right)-x^2\right]+2016\left(x^2+x+1\right)\)
\(=\left(x^2+x+1\right)\left(x^2-x+1\right)+2016\left(x^2+x+1\right)\)
\(=\left(x^2+x+1\right)\left(x^2-x+2017\right)\)
\(x^4+2017x^2+2016x+2017\)
\(=\left(x^4-x\right)+\left(2007x^2+2007x+2007\right)\)
\(=x.\left(x^3-1\right)+2007.\left(x^2+x+1\right)\)
\(=x.\left(x-1\right)\left(x^2+x+1\right)+2007.\left(x^2+x+1\right)\)
\(=\left(x^2+x+1\right)\left(x^2-x+2007\right)\)