Can you please explain this to me and how you got the answer

~ Jasmin is solving the equation below
X^2-10x=9
what should she add to both sides to complete the square

x ^ 2 - 10 x + ( 10 / 2 ) ^ 2 = 9 + ( 10 / 2 ) ^ 2

x ^ 2 - 10 x + 5 ^ 2 = 9 + 5 ^ 2

x ^ 2 - 10 x + 25 = 9 + 25

( x - 5 ) ^ 2 = 34