The formula is the result of one reusable idea: completing the square. We give a visual example of this below and then show how the quadratic formula can be derived.
Consider \(x^2+6x=7\text{.}\) For the picture, temporarily suppose \(x>0\) so it represents a length. Draw a square of area \(x^2\text{,}\) and split the rectangle of area \(6x\) into two strips, each with area \(3x\text{.}\) Place one strip on the right and one below the square. A \(3\)-by-\(3\) corner is missing.
Although negative \(x\) cannot serve as a side length in this picture, the identity \(x^2+6x+9=(x+3)^2\) holds for every real \(x\text{.}\) Both algebraic solutions are valid: \(1+6=7\) and \(49-42=7\text{.}\) The diagram motivates the identity; the algebra is what extends it to all inputs.
Expanding the right side verifies this even when \(p\) or \(x\) is negative, so no assumption about positive lengths is needed in the derivation below.
If \(D<0\text{,}\) a real square cannot equal \(D\text{,}\) so there are no real solutions. Allowing complex square roots gives the same formula for the two complex solutions.
Every step preserves the solutions: we divide only by the nonzero numbers \(a\) and \(2a\text{,}\) add equal quantities to both sides, and keep both possibilities when undoing a square. The symbol \(\pm\) is essential because both a positive number and its negative have the same square.
If \(D>0\text{,}\) the two real roots lie the same horizontal distance from the symmetry line \(x=-b/(2a)\text{.}\) That distance is \(\sqrt{D}/(2|a|)\text{.}\) For the function in our first page, \(f(x)=x^2-2x-3=(x-1)^2-4\text{,}\) the equation \(f(x)=0\) becomes \((x-1)^2=4\text{.}\) The roots are two units to either side of \(x=1\text{.}\)
If \(D=0\text{,}\) that distance is zero: the two branches coincide at the vertex. If \(D<0\text{,}\) there is no real distance with that square, and the graph has no x-intercept. This is why the formula, factoring, and the graph all tell the same story.
The formula agrees: \(D=(-6)^2-4(1)(2)=28\) and \(x=(6\pm\sqrt{28})/2=3\pm\sqrt{7}\text{.}\) Completing the square uses the same steps that produced the formula.
What must be added to \(x^2-10x\) to complete the square? Use it to solve \(x^2-10x+13=0\text{.}\) Explain why you add the same number to both sides and why you need two signs.
Half of \(-10\) is \(-5\text{,}\) whose square is \(25\text{.}\) Starting with \(x^2-10x=-13\text{,}\) add \(25\) to both sides to preserve equality. This gives \((x-5)^2=12\text{,}\) hence \(x=5\pm2\sqrt{3}\text{.}\) Both signs are needed because both \(2\sqrt{3}\) and \(-2\sqrt{3}\) square to \(12\text{.}\)