How to Solve Quadratic Equations: 3 Methods Explained

Factoring, completing the square, and the quadratic formula aren't three separate topics to memorize. They're one idea, viewed three ways. Here's how each one works, and which one to reach for.

By Petrus Sheya

July 27, 2026 · 5 min read

What two numbers multiply to give 66, and add up to give 5-5?

Take a second. Actually try it... 2-2 and 3-3 work: (2)×(3)=6(-2) \times (-3) = 6, and (2)+(3)=5(-2) + (-3) = -5.

If you got there, congratulations. You just solved a quadratic equation without ever writing "the quadratic formula."

Every quadratic equation asks one question: for what values of xx does ax2+bx+cax^2 + bx + c hit zero? There are three classic ways to answer it, factoring, completing the square, and the quadratic formula. They're not competing algorithms. They're the same idea, viewed from three angles, and each one is fastest on a different kind of equation.

We'll build all three, one at a time. By the end, you'll know exactly which one to reach for.


Method 1: Factoring, or guessing the two numbers

Take x25x+6=0x^2 - 5x + 6 = 0.

Factoring asks: can we rewrite the left side as (xp)(xq)(x - p)(x - q) for some numbers pp and qq?

If we can, we're basically done. A product is zero only when one of its factors is zero, so either xp=0x - p = 0 or xq=0x - q = 0. That means x=px = p or x=qx = q. Two guesses away from the full answer.

Multiply (xp)(xq)(x-p)(x-q) out and you get x2(p+q)x+pqx^2 - (p+q)x + pq. Compare that to x25x+6x^2 - 5x + 6, and the pattern falls out: the roots add up to b-b, and multiply to cc. For our equation, that's two numbers that add to 55 and multiply to 66. That's 22 and 33. So x25x+6=(x2)(x3)x^2 - 5x + 6 = (x-2)(x-3), and the roots are x=2x = 2 and x=3x = 3.

Drag the two roots along the x-axis, the factored form and the trinomial it expands to update live.

x = 2x = -1
Factored(x 2)(x + 1)
Expanded 1x 2
sum = −b, product = c1, -2

Drag the two roots above and watch the trinomial rebuild itself. Factoring is just this process run backwards, given the trinomial, find the roots that would have produced it.

But here's the catch. Try x2+4x7=0x^2 + 4x - 7 = 0. What two numbers multiply to 7-7 and add to 44? ...There aren't any nice ones. You could hunt through fractions and irrational combinations forever, but at that point you're not factoring anymore, you're guessing blindly. We need something that works even when the roots are ugly.


Method 2: Completing the square, or building a bigger square

Picture x2x^2 as the area of an actual square, with side length xx. Now we want to add bxbx more area. Split that into two thin rectangles, each b2\frac{b}{2} wide by xx tall, and glue one onto the top of the square and one onto the right side.

That leaves a small gap in the corner, a square of side b2\frac{b}{2}. Fill it in, and you've completed one big square of side x+b2x + \frac{b}{2}.

Hit play and watch x² + bx get physically reshaped into a complete square, one tile at a time.

6xStart: x² + 6x
Missing piece (b/2)²9
Resultx² + 6x = (x + 3)² − 9

Hit play and watch the tiles rearrange themselves. That gap you filled has area (b2)2\left(\frac{b}{2}\right)^2, and that's the number we secretly added. So algebraically:

x2+bx=(x+b2)2(b2)2x^2 + bx = \left(x + \frac{b}{2}\right)^2 - \left(\frac{b}{2}\right)^2

Now go back to x2+4x7=0x^2 + 4x - 7 = 0. Half of 44 is 22, and 22=42^2 = 4. Add 44 to both sides:

x2+4x+4=7+4        (x+2)2=11        x=2±11x^2 + 4x + 4 = 7 + 4 \;\;\Rightarrow\;\; (x+2)^2 = 11 \;\;\Rightarrow\;\; x = -2 \pm \sqrt{11}

No guessing required. Completing the square handles irrational roots just as easily as nice ones, because it never relies on spotting a pattern. It just builds the square, every time.


Method 3: The quadratic formula, or completing the square once and for all

Here's the interesting part: the quadratic formula isn't a new idea. It's Method 2, done symbolically, for any aa, bb, and cc, solved once so you never have to repeat the steps again.

Start from ax2+bx+c=0ax^2 + bx + c = 0, divide through by aa, complete the square exactly like before, and solve for xx. What falls out is:

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

That ±\pm is doing something worth noticing: it's the same "two intersection points" idea from completing the square, just written in one line. And the piece under the square root, Δ=b24ac\Delta = b^2 - 4ac, is called the discriminant, because it discriminates between three cases before you even finish solving:

  • Δ>0\Delta > 0: two real roots
  • Δ=0\Delta = 0: one repeated root (the parabola just touches zero)
  • Δ<0\Delta < 0: no real roots (the parabola never crosses zero)

Slide c and watch the discriminant, b² − 4c, decide how many times the curve touches zero. Hover the curve to read any point.

0-6
Discriminant Δ36
Status2 real roots
Roots0, -6

Slide cc and watch the curve rise and fall. Right around Δ=0\Delta = 0, the two roots merge into one and then vanish entirely... the discriminant is telling you the answer before you finish the arithmetic.


Which method should you actually use?

Scrub through five equations and see which method wins, and how many algebra steps each one costs.

x² − 5x + 6 = 0
Factoring2
Completing the square4
Quadratic formula3

Integer roots (2 and 3) jump out immediately.

Discriminant1
Roots3, 2
Best methodFactoring

A few rules of thumb fall straight out of everything above. Try factoring first, but only when a=1a = 1 and you can spot the two numbers in a few seconds. If nothing jumps out within a few tries, stop guessing.

Reach for completing the square when bb is even, it stays clean, and it's the method that shows you why the roots are what they are, not just what they are.

Use the quadratic formula whenever the other two get messy: when a1a \neq 1, when the roots look irrational, or when you're not even sure real roots exist. It always works, because it's just completing the square with the guesswork already removed.


The short version

All three methods answer the exact same question: where does ax2+bx+cax^2+bx+c equal zero? Factoring reverses multiplication, and it's fastest when the roots are friendly integers. Completing the square physically builds a square around x2+bxx^2+bx to isolate xx, and it works even on ugly, irrational roots. The quadratic formula is that same square, completed once, symbolically, for any aa, bb, and cc, so it never fails, especially when the other two get complicated.

Same destination, three different roads. Pick the one that matches the shape of the equation in front of you.


All visualizations are interactive React components running entirely in your browser, computing every root, every discriminant, and every completed square live from the numbers you choose. No libraries beyond React.