Solution (source code)

= Solution

Use <completing the square> by adding and subtracting $3^2$:
$$
\boxed{x^2-6x+14=(x-3)^2+5.}
$$