How does $x^2-8x+17=0$ have nonreal solutions? 
The solutions of $x^2-8x+17=0$ are $4 + i$ and $4 - i$.

Well, I calculated and the results are different.
$$\begin{align}
x^2-8x+17 &= 0 \\
x^2-8x &=17 \\
x(x-8) &= 17 
\end{align}$$
So the roots are $x=17$ or $x=17+8=25$.
Why $i$ comes from the problem? Could you please explain about it?

Your answer is not correct, please check it.
$x^{2}-8x+17=(x-4)^{2}+1=0$ by completing the square, so we have $(x-4)^{2}=-1$ and thus $x=4+i$ and $x=4-i$ are the required solutions where $i=\sqrt{-1}$.
