To build on Hall's answer, the quadratic formula is developed by "completing the square." Once you have that formula, completing the square is seldom necessary to solve an equation.
[MATH](x + d)^2 = (x + d)(x + d) = x(x + d) + d(x + d) =\\
x^2 + dx + dx + d^2 = x^2 + 2dx + d^2.[/MATH]Notice the pattern. In the expanded form, the coefficient of x^2 is 1, the coefficient of x is twice some number, d in this case, and the constant term is that SAME number squared, d^2 in this case. The moment you see that pattern, you know that
[MATH]\sqrt{x^2 + 2dx + d^2} = x + d.[/MATH]
That set of very convenient relationships is true for perfect squares, but is NOT true for quadratic expressions in general. So "completing the square" is the technique of turning a quadratic that is not a perfect square into a perfect square. I am going to take baby steps here. Make sure you follow each step. Ask questions if you get lost.
[MATH]\text {Given } a \ne 0,\ \left ( \dfrac{b}{2} \right )^2 \ne c, \text { and } ax^2 + bx + c = 0.[/MATH]
Unless a happens to equal 1, we do not have our desired pattern. But we can fix that problem easily by dividing everything by a, which is not zero.
[MATH]ax^2 + bx + c = 0 \implies x^2 + \dfrac{b}{a} * x + \dfrac{c}{a} = \dfrac{0}{a} = 0.[/MATH]
But we want the coefficient of x to have 2 as a factor. Again, that is easy to fix.
[MATH]\dfrac{b}{a} = 1 * \dfrac{b}{a} = \dfrac{2}{2} * \dfrac{b}{a} = 2 * \dfrac{b}{2a}.\\
\therefore x^2 + \dfrac{b}{a} * x + \dfrac{c}{a} = 0 \implies x^2 + \left ( 2 * \dfrac{b}{2a} \right )x + \dfrac{c}{a} = 0[/MATH]But we assumed that [MATH]\left ( \dfrac{b}{2} \right )^2 \ne c \implies \dfrac{b^2}{4} \ne c \implies \dfrac{b^2}{4a} \ne \dfrac{c}{a}.[/MATH]
That assumption means this is not a perfect square because the constant term is wrong. So we move it to the other side of the equal sign.
[MATH]x^2 + \left (2 * \dfrac{b}{2a} \right )x + \dfrac{c}{a} - \dfrac{c}{a}= 0 - \dfrac{c}{a} \implies x^2 + \left (2 * \dfrac{b}{2a} \right )x = - \dfrac{c}{a}.[/MATH]
The constant we need to turn the expression on the left hand side into a perfect square is the square of the factor of x that is not 2.
[MATH]\left ( \dfrac{b}{2a} \right )^2 = \dfrac{b^2}{4a^2}.[/MATH]
Pure mechanics, no real thought involved. So we add that to the left hand side to get a perfect square, but that means we must also add it to the right hand side.
[MATH] x^2 +\left (2 * \dfrac{b}{2a} \right )x = - \dfrac{c}{a} \implies x^2 + \left (2 * \dfrac{b}{2a} \right )x + \dfrac{b^2}{4a^2} = \dfrac{b^2}{4a^2} - \dfrac{c}{a} [/MATH]
We can combine those fractions on the right hand side by using a common denominator.
[MATH]\dfrac{b^2}{4a^2} - \dfrac{c}{a} = \dfrac{b^2}{4a^2} - \dfrac{c}{a} * \dfrac{4a}{4a} = \dfrac{b^2}{4a^2} - \dfrac{4ac}{4a^2} = \dfrac{b^2 - 4ac}{4a^2}.[/MATH]
So we have
[MATH]x^2 + \left (2 * \dfrac{b}{2a} \right )x + \dfrac{b^2}{4a^2} = \dfrac{b^2 - 4ac}{4a^2}.[/MATH]
But the left hand side is now a perfect square where [MATH]d = \dfrac{b}{2a}.[/MATH]
[MATH]\therefore \sqrt{x^2 + \left (2 * \dfrac{b}{2a} \right )x + \dfrac{b^2}{4a^2}} = x + \dfrac{b}{2a}.[/MATH]
Confirm that if you are unsure. But
[MATH]\therefore x^2 + \left (2 * \dfrac{b}{2a} \right )x + \dfrac{b^2}{4a^2} = \dfrac{b^2 - 4ac}{4a^2} \implies \\
x + \dfrac{b}{2a} = \pm \sqrt{\dfrac{b^2 - 4ac}{4a^2}} = \pm \dfrac{\sqrt{b^2 - 4ac}}{\sqrt{4a^2}} = \pm \dfrac{\sqrt{b^2 - 4ac}}{2a}.\\
\text {And, obviously, } x + \dfrac{b}{2a} = \pm \dfrac{\sqrt{b^2 - 4ac}}{2a} \implies x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a}.[/MATH]We have a general formula to solve all quadratic equations, and we got it by using the method of completing the square.