Divide the coefficient of the second term by 2, and then square it to get the third term:
[tex]\frac{18}{2}\rightarrow9\rightarrow81[/tex]Then, add 81 (the intermediate step) to both sides:
[tex]x^2-18x+81=-117+81[/tex]Factor and simplify:
[tex]\begin{gathered} x^2-18x+81=-117+81 \\ \Rightarrow(x-9)^2=-36 \end{gathered}[/tex]