Hello Shelby,
Recall your algebraic identities
(x + y)2 = x2 + 2xy + y2
(x - y)2 = x2 - 2xy + y2
We will use these identities to do Completing the square. We have x2 - 2x
To make it a perfect square we will do 2y = -2, so we get y = -1, add square of y to make it a perfect square. y2 = 1. So, we have x2 - 2x + 1 = (x - 1)2 (answer)
To generalize this to any quadratic function of the form x2 + bx. In this, we have 2y = b which gives
y = b/2. Therefore,
x2 + bx + (b/2)2 = (x + (b/2))2
Quadratic function of the form x2 - bx. In this, we have 2y = -b which gives y = -b/2. Therefore,
x2 - bx + (-b/2)2 = (x - (-b/2))2
I hope this helps.