\(x^3-8+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\)
=\(\left(x-2\right)\left(x^2+2x+4\right)+2x\left(x-2\right)\)
=\(\left(x-2\right)\left(x^2+4x+4\right)\)
=\(\left(x-2\right)\left(x+2\right)^2\)