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?

If you take $x = 17$ then $x^{2} - 8x + 17 = 289 - 56 + 17 = 362 \not=0$
Neither hold if you take $x = 25$
You can use Bhaskara's formula. $x = \frac{8+\sqrt{64 - 68}}{2} = 4 + i$ or $x = \frac{8-\sqrt{64 - 68}}{2} = 4 - i$
