a)\(x^3+4x^2-7x-10=x^3+x^2+3x^2+3x-10x-10=x^2\left(x+1\right)+3x\left(x+1\right)-10\left(x+1\right)\)
\(=\left(x+1\right)\left(x^2+3x-10\right)=\left(x+1\right)\left[\left(x^2+5x\right)-\left(2x+10\right)\right]=\left(x+1\right)\left(x+5\right)\left(x-2\right)\)
b) \(x^8+x+1=x^8-x^2+x^2+x+1=x^2\left(x^6-1\right)+\left(x^2+x+1\right)\)
\(=x^2\left(x^3-1\right)\left(x^3+1\right)+\left(x^2+x+1\right)\)
\(=x^2\left(x-1\right)\left(x^2+x+1\right)\left(x^3+1\right)+\left(x^2+x+1\right)\)
\(=\left(x^2+x+1\right)\left[x^2\left(x-1\right)\left(x^3+1\right)+1\right]\)