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