please explain why. Thanks

Is (x-2) is a factor of x³-3x²-x +7 –
We are given –
[tex]\qquad[/tex] [tex]\twoheadrightarrow\bf P(x) = x³-3x²-x +7[/tex]
[tex]\qquad[/tex] [tex]\twoheadrightarrow\bf Q(x) =x - 2 [/tex]
[tex]\qquad[/tex] [tex]\twoheadrightarrow\bf If \:Q(x) = 0[/tex]
[tex]\qquad[/tex] [tex]\twoheadrightarrow\bf x - 2 = 0[/tex]
[tex]\qquad[/tex] [tex]\twoheadrightarrow\bf x = 2[/tex]
Now Put x = 2 into the polynomial –
[tex]\qquad[/tex] [tex]\purple{\twoheadrightarrow\bf P(2) = 2³-3(2)²-2+7}[/tex]
[tex]\qquad[/tex] [tex]\twoheadrightarrow\sf P(2) = 8 - 3 \times 4 +5[/tex]
[tex]\qquad[/tex] [tex]\twoheadrightarrow\sf P(2) = 8 -12 +5[/tex]
[tex]\qquad[/tex] [tex]\twoheadrightarrow\sf P(2) = 13-12[/tex]
[tex]\qquad[/tex] [tex]\purple{\twoheadrightarrow\bf P(2) =1 }[/tex]
________________________________________