
As always, read math with a pencil!
Let's say you want to solve a quadratic equation:
Usually if one side of a quadratic equation is easily factored, as this one is, and the other side is zero, factoring is the easiest method to solve the equation. In thise case we rewrite it like this:
Then it's easy to solve. Because zero is special, solutions to either of these linear equations are solutions to the quadratic:
So the solutions are
But some equations are difficult or impossible to factor. How else can we solve quadratic equations we can't factor?
One method is completing the square. We will try this on the same equation. To do this, the first thing is to push the constant term to the other side of the equation by subtracting 5 from both sides:
${{x}^{2}6x}=5$  (1) 
Notice that this is different from factoring, when we try to get zero on one side of the equation.
Now it's time to start wishing. Wouldn't it be nice if ${x}^{2}6x$ were a perfect square? Then we could take the square root of both sides and be done. Ok, so it's not a perfect square, but could we make it into one? What would it take? It turns out this is surprisingly easy, since (unlike when factoring) we don't care if one side of the equation is zero. Notice the coefficient of the linear term, in this case $6$. Take half of that: $3$. Now add that to $x$, giving $x+(3)$ or $x3$. Square that: ${(x3)}^{2}={{x}^{2}6x}{+9}$. Because of how we picked the $3$, when we square $x3$ we get the original left side of the equation, ${{x}^{2}6x}$, plus that annoying $9$. But it's not that annoying since we can just add the same $9$ to the other side, yielding an equivalent equation:
${x}^{2}6x}{+9}=5{+9$  (2) 
Now we solve that:
Notice that these are the same solutions we got by factoring, but the advantage of this method is that it always works, while factoring doesn't.
If the coefficient $a$ is not 1, it may be simplest first to divide both sides of the equation by $a$ and proceed as above:
Then we can proceed as above.
Most quadratic equations don't have pretty solutions like the above. They often involve irrational and complex solutions. For example:
Since this method is so mechanical, we can use it to solve the generic standardform quadratic equation,
Here's how. It's messy, so get ready with your pencil:
Equation (6) should look familiar! It is the quadratic formula, and now you see where it comes from. It is nothing more than prepackaging of the technique of completing the square.
A few notes about the procedure. Equation (3) is where we actually complete the square. Equation (4) is where we actually write the completed square as a square. Equation (5) is where we take square roots of both sides, being careful to use $\pm $ because otherwise we lose a correct solution.
Just for completeness, let's use the quadratic formula to solve the original equation, ${x}^{2}6x+5=0$:
A few notes:
You may remember that the axis of symmetry of a quadratic function in standard form is the line
Where does that come from? One way to see it is to note that the quadratic formula can also be written this way:
Written this way, it's very easy to see that ${\frac{b}{2a}}$ is halfway between the zeros (if they exist), evidence that it really is the $x$coordinate of the axis of symmetry.