Introduction

The formula you learn for solving a quadratic equation \(ax^2+bx+c=0\) looks like this.

$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$$

At first it looks like a code you just have to memorize. Why minus \(b\)? Where does the \(\pm\) come from? What is \(b^2-4ac\) doing under the square root, and why the \(2a\) in the denominator? But this formula isn't some mysterious invention — it's just two very simple facts, applied in sequence.

  1. Squaring folds two different values onto one, so undoing it always means checking both \(\pm\) directions.
  2. Any quadratic expression can be rebuilt into a perfect square (completing the square) by filling in exactly one missing piece.

Follow these two ideas in order, and that unfamiliar-looking formula walks itself out.

1. Why does squaring fold two values into one

Ask anyone to solve \(x^2=9\) and they'll say \(x=3\) or \(x=-3\). But why is the answer two numbers instead of one?

The reason lies in what "squaring" does as an operation. Plot \(y=x^2\): at \(x=3\), \(y=9\); at \(x=-3\), \(y=9\) too. Two different inputs land on exactly the same output. It's as if the number line were folded in half at \(x=0\), so that \(3\) on the right lands exactly on top of \(-3\) on the left.

So when you ask the reverse question — "what number, squared, gives \(9\)?" — there's no way to tell which of the two folded-together points was the original. Both are equally valid answers. That's where the \(\pm\) comes from: the moment you take a square root, you have to unfold both directions that got folded together.

In general, for \(k \ge 0\),

$$X^2 = k \quad \Longrightarrow \quad X = \pm\sqrt{k}$$

If \(k=0\), the two folded points were already sitting on top of each other at the origin, so there's only one answer, \(X=0\). But whenever \(k>0\), there are always exactly two answers — equal in size, opposite in sign.

2. Any quadratic expression can become a square — completing the square

Now we know where the \(\pm\) comes from. The next question is how to turn a mixed-up expression like \(ax^2+bx+c=0\) into the shape "\(X^2=k\)." The tool for that is completing the square.

First, drop the constant term and consider just \(x^2+px\). Draw this as an area: a square of side \(x\) (area \(x^2\)) with two rectangles of width \(\tfrac{p}{2}\) attached to its right side and its bottom (each has area \(\tfrac{p}{2}\cdot x\), so together they add up to exactly \(px\)).

But once you attach those two rectangles, a small square-shaped gap of side \(\tfrac{p}{2}\) is left empty in the bottom-right corner. Fill that gap in, and the whole shape becomes a perfect square with side \(x+\tfrac{p}{2}\). That is:

$$x^2 + px + \left(\frac{p}{2}\right)^2 = \left(x+\frac{p}{2}\right)^2$$

The piece we added, \(\left(\tfrac{p}{2}\right)^2\), is exactly "the piece you fill in to complete the square." It equals the area of that empty corner precisely because it's the coefficient of \(x\) halved, then squared.

For example, \(x^2+2x\) has \(p=2\), so the missing piece is \(\left(\tfrac{2}{2}\right)^2=1\).

$$x^2+2x+1 = (x+1)^2$$

Now this tool is ready to apply to a general quadratic equation.

3. Combining both ideas to derive the quadratic formula

Start from \(ax^2+bx+c=0\) (with \(a\ne0\)).

① Divide both sides by \(a\) to make the coefficient of \(x^2\) equal to \(1\).

$$x^2 + \frac{b}{a}x + \frac{c}{a} = 0$$

② Move the constant term to the right side.

$$x^2 + \frac{b}{a}x = -\frac{c}{a}$$

③ Apply the completing-the-square rule from Section 2. Here \(p=\tfrac{b}{a}\), so the piece to fill in is \(\left(\tfrac{p}{2}\right)^2=\left(\tfrac{b}{2a}\right)^2\). Add it to both sides equally (an equation is a balance scale — to keep it in balance, you must add the same thing to both sides).

$$x^2 + \frac{b}{a}x + \left(\frac{b}{2a}\right)^2 = \left(\frac{b}{2a}\right)^2 - \frac{c}{a}$$

④ The left side is now exactly a perfect square. Simplify the right side over a common denominator.

$$\left(x+\frac{b}{2a}\right)^2 = \frac{b^2}{4a^2}-\frac{c}{a} = \frac{b^2-4ac}{4a^2}$$

⑤ This is now the shape "\(X^2=k\)." As we saw in Section 1, the moment you take a square root of both sides, \(\pm\) inevitably appears.

$$x+\frac{b}{2a} = \pm\frac{\sqrt{b^2-4ac}}{2a}$$

⑥ Finally, move \(\tfrac{b}{2a}\) back to the other side, and out comes the familiar formula.

$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$$

Putting it all together: the \(2a\) in the denominator is simply what's left over from the "halve it" step in completing the square, and the \(\pm\) is what appears when you undo a square root and unfold the two directions that got folded together. The quantity under the root, \(b^2-4ac\), even has its own name — the discriminant — because its sign determines how many real solutions actually exist. That story goes beyond the scope of this post, so we'll just note the name here.

4. Try it yourself

The top of the interactive below shows Section 1's idea — "why does squaring fold things together" — using the graph of \(y=x^2\) and a horizontal line. Drag the \(k\) slider and watch the intersections always appear as two points symmetric about the origin (or a single point when \(k=0\)).

The bottom shows Section 2's square-completing puzzle. Adjust the \(x\) and \(p\) sliders to build the square-plus-two-rectangles shape, then press the button to fill in the missing corner \(\left(\tfrac{p}{2}\right)^2\) — watch the whole shape complete itself into a square of side \(x+\tfrac{p}{2}\), verified with the actual area numbers.

Taking the quadratic formula apart — ± and completing the square
Top: the two intersections of a horizontal line with y=x² show why ± appears. Bottom: drag the sliders to fill in one missing square and turn x²+px into a perfect square.

Key takeaways

  • \(X^2=k\;(k>0)\) always has two solutions, \(X=\pm\sqrt{k}\), because squaring folds two different numbers onto the same value. Undoing it means restoring both directions that got folded together.
  • Adding \(\left(\tfrac{p}{2}\right)^2\) to \(x^2+px\) produces the perfect square \((x+\tfrac{p}{2})^2\) — because halving the coefficient and squaring it gives exactly the area of the missing corner.
  • Divide \(ax^2+bx+c=0\) by \(a\), complete the square, then take the square root, and \(x=\dfrac{-b\pm\sqrt{b^2-4ac}}{2a}\) falls out directly. The \(2a\) comes from "halving" in completing the square; the \(\pm\) comes from "unfolding" the square root.

Next time you reach for the quadratic formula, remember that its seemingly complicated shape is really just two familiar moves stitched together: "unfolding what got folded" and "filling in the missing square."

Related readingWhy Check Your Answer After Solving — The Two Faces of the Extraneous Root (another case where squaring erases sign information) · Why Factoring Simplifies Things (an alternative way of looking at the same quadratic expression, as a product)