\(x^3+x+2=\left(x^3+1\right)+\left(x+1\right)\)
\(=\left(x+1\right)\left(x^2-x+1\right)+\left(x+1\right)\)
\(=\left(x+1\right)\left(x^2-x+1+1\right)\)
\(=\left(x+1\right)\left(x^2-x+2\right)\)
\(b,x^4+5x^3+10x-4=\left(x^4-4\right)+\left(5x^3-10x\right)\)\(=\left(x^2+2\right)\left(x^2-2\right)+5x\left(x^2+2\right)\)
\(=\left(x^2+2\right)\left(x^2-2+5x\right)\)