I have two questions on this topic. The first one is finding the x^{3}+2 as a product of linear factors in Z_{3}[X]. I have in my notes that -

x^{3}+2=x^{3}-1 (in mod 3)

=(x)^{3}-(1)^{3}

=(x^{3}-1)(x^{2}+x+1)

=(x-1)(x^{2}+x+1)

=(x-1)(x-1)(x-1)

The part of this I dont get is the second and third step. How do we go from x^{3}-1 to (x)^{3}-(1)^{3}=(x^{3}-1)(x^{2}+x+1)?

The second question is to show 2x^{3}+3x-7x-5 as a product of linear factors in Z_{1}[x]. I keep running into polynomials that cant be factored. I presume the step Im missing is just like the previous question where i need to use the properties of mod, but Im not sure how/where to do it?