You complete the square. There is actually a trick to it. If everything is on the same side, you make x^2-10x into (x-5)^2. You divide b/2 and insert that into the perfect square. You then subtract 25 because FOIL tells you that you need to add 25 when in fact you subtract 25 because you are on the same side.
In final terms, it becomes (x-5)^2+16-25=(x-5)^2-9.