a: =(x^2-1)^2-2x(x^2-1)+x(x^2-1)-2x^2
=(x^2-1)(x^2-1-2x)+x(x^2-1-2x)
=(x^2-2x-1)(x^2+x-1)
b: \(=\left(x^2+1\right)^2+x\left(x^2+1\right)+2x\left(x^2+1\right)+2x^2\)
\(=\left(x^2+1\right)\left(x^2+x+1\right)+2x\left(x^2+x+1\right)\)
\(=\left(x^2+x+1\right)\left(x^2+2x+1\right)\)
\(=\left(x+1\right)^2\cdot\left(x^2+x+1\right)\)