The expression for the square of a binomial is
[tex] (a+b)^2 = a^2+2ab+b^2 [/tex]
Since your expression starts with [tex] x^2-6x +\ldots [/tex]
It means that [tex] a = x [/tex], and so -6x must be twice the product of x and some number b. If you choose b = -3 you have
[tex] (x-3)^2 = x^2-6x+9 [/tex]
So, if you add 8 to both sides of your equation, you have
[tex] x^2-6x+1+8 = 17+8 \iff x^2-6x+9 = 25 \iff (x-3)^2=25 \iff x-3 = \pm 5 [/tex]
By choosing one sign at a time, we have the two solutions
[tex] x_1 \to x-3 = 5 \iff x = 8 [/tex]
[tex] x_2 \to x-3 = -5 \iff x = -2 [/tex]