<s>[INST] Question in relation to completing the square In description of "completing the square" at http://www.purplemath.com/modules/sqrquad.htm the following is given : 

I'm having difficulty understanding the third part of the transformation.
Where is
$ -\frac{1}{4}$ derived from $-\frac{1}{2}$ ?
Why is $ -\frac {1}{4}$ squared to obtain $ \frac {1}{16}$ ?
 [/INST] In general, to complete the square of something like $x^2 \pm Bx = \pm C$, you take half the coefficient of $x$, which is $B$, and then square it. 
For the third step, they first take half of the $x$ coefficient, which is $-\frac{1}{2}$. Half of $-\frac{1}{2}$ is $-\frac{1}{4}$ since
$$ \frac{-\frac{1}{2}}{2} = \frac{-\frac{1}{2}}{\frac{2}{1}}= -\frac{1}{2} \cdot \frac{1}{2} = -\frac{1}{4}.$$
Then, they square $-\frac{1}{4}$ which is $\frac{1}{16}$ since
$$ \left(-\frac{1}{4}\right)^2 = -\frac{1}{4} \cdot -\frac{1}{4} = \frac{1}{16}.$$
The reason why they add $\left (\frac{B}{2} \right)^2$ to both sides of the equation is to make a squared binomial:
$$x^2 + Bx + \left (\frac{B}{2} \right)^2 = \left(x + \frac{B}{2} \right)^2.$$
</s>