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}$ ?

Let's begin with the equation 
$$x^2 - \frac{1}{2}x = \frac{5}{4}$$
What the author wants to do is to create a perfect square on the left hand side.  That is, the author wants to transform the expression on the left hand side into the form $(a + b)^2 = a^2 + 2ab + b^2$.  Assume that 
$$a^2 + 2ab = x^2 - \frac{1}{2}x$$
If we let $a = x$, then we obtain
\begin{align*}
x^2 + 2bx & = x^2 - \frac{1}{2}x\\
2bx & = -\frac{1}{2}x\\
\end{align*}
Since the equation $2bx = -\frac{1}{2}x$ is an algebraic identity that holds for each real number $x$, it holds when $x = 1$.  Thus,
\begin{align*}
2b & = -\frac{1}{2}\\
b & = -\frac{1}{4}
\end{align*}
Therefore, 
\begin{align*}
a^2 + 2ab + b^2 & = x^2 + 2\left(-\frac{1}{4}\right)x + \left(-\frac{1}{4}\right)^2\\
                & = x^2 - \frac{1}{2}x + \frac{1}{16}
\end{align*}
If we add $1/16$ to the left hand side of the equation, we must add $1/16$ to 
the right hand side of the equation to balance it, which yields
$$x^2 - \frac{1}{2}x + \frac{1}{16} = \frac{5}{4} + \frac{1}{16}$$
By construction, the expression on the left hand side is the perfect square $(x - \frac{1}{4})^2$, so we obtain
$$\left(x - \frac{1}{4}\right)^2 = \frac{21}{16}$$
We can now solve the quadratic equation by taking square roots, which is why we wanted to transform the left hand side into a perfect square.
