\(a,=\left(x^3-1\right)-7x\left(x-1\right)\\ =\left(x-1\right)\left(x^2+x+1-7x\right)\\ =\left(x-1\right)\left(x^2-6x+1\right)\\ b,=\left(x^3+8\right)-2x\left(x+2\right)\\ =\left(x+2\right)\left(x^2-2x+4\right)-2x\left(x+2\right)\\ =\left(x+2\right)\left(x^2-2x+4-2x\right)\\ =\left(x+2\right)\left(x^2-4x+4\right)\\ =\left(x+2\right)\left(x-2\right)^2\)